I am new to PHP and writing code is very slow. It takes 2 hours to write a function (continuously modify it until it is optimized and perfected). After you finish writing, come back and look at the code you wrote. It should take you 10 minutes to write it.
This has always been the case, what should I do? Hope to impart experience
I am new to PHP and writing code is very slow. It takes 2 hours to write a function (continuously modify it until it is optimized and perfected). After you finish writing, come back and look at the code you wrote. It should take you 10 minutes to write it.
This has always been the case, what should I do? Hope to impart experience
Write more code, write more code, write more code
Read more php documentation (memorize a few more functions)
Multiple summaries (records in blog form, etc.)
Let me recommend two books to you.
"PHP and MySQL Web Development" There are many examples in it that you can write down by yourself, don't just read them.
2. "In-depth PHP Object Orientation, Patterns and Practices" Don't rush to read many things in it. You can experience it while writing code. I have read it twice.
Of course, the efficiency cannot be improved too much while reading, but it won’t necessarily be the same after that→_→
I often write for hours and then delete or rewrite.
Your foundation may not be solid. If you want to develop quickly, you must first have a solid foundation. Then you can use frameworks for large projects. For small projects, you can try to accumulate some commonly used functions and classes. Over time, you will have solid skills and you will be fine.
I often bring it to work
Experience
So this is all based on experience, it’s okay, just write more.
Everyone will grow in the end. The only thing we can work hard for is the speed of growth.