I haven't done any serious web development stuff since last year because of family/time issues. I need to get back into it because it's my career choice and I'll be finished with my associates degree soon. I decided to revamp a previous website I helped the owner build. After deciding what to change, I couldn't make up my mind if I should continue with writing procedural code or move to a framework. I know without a doubt I can do it with procedural code but I'm undecided between it. I guess I'm looking for a second opinion, what would you do if you were in a similar situation?
Php – Should I continue using procedural php code or move to a framework
frameworksPHP
Related Solutions
Learning OOP is definitely worth it. Passionate hireable developers are always willing to learn to expand their knowledge, specially when you can save time in the long run. I would agree more with the second group of people:
Others say it's incredibly stupid, you're not scaleable, you're never get serious funding, you're the only one who ever be able to work on the project, you should stop and start learning it now, etc.
That's a bit harsh, but the reality is, the more you know, the more you scale. Serious funding is often surrounded by hype, and procedural code is unfortunately not cool enough. OOP and frameworks are.
Am I doomed? I feel lost. My personal opinion on this is, that even though it is a huge system already, it is still a MVP and I guess at some point in the future we would rewrite the code anyways [...]
Large procedural code bases are not uncommon, see WordPress. OOP really helps to abstract and organize your code without relying on procedural conventions (although MVC frameworks have a whole different set of conventions). WordPress started a migration process, that's still going on today. With such large projects all you can do is upgrade your system, step by step, testing that nothing breaks, and keep re-factoring, forever, as you'd introduce new features that will need refactoring later on.
But no, you're not doomed, just a little bit late to the whole process. Learn what you can when you can; less is better than nothing. The learning curve when learning new programming paradigms, or languages, is often steep at first, but after that first hiccup it'll be smooth sailing, and you'll start to really appreciate the difference it can make on your code, and the difference it will make when others read your code.
Edit: Just to clarify, I'm not suggesting the current system needs to be OOP, or that it needs to be built from scratch. Any system is going to be re-factored, at some point, and you may need to break compatibility with previous system, and that's fine if the project requires it; you can have a deprecation cycle as well. What I'm suggesting is to slowly introduce OOP as you refactor your current code, namespaces, etc.
Best Answer
That is a false choice.
There are a lot of php "frameworks" which actually are written in procedural style.
Instead of trying to find some magical framework which would bestow upon you the wisdom of programming , you should just learn how to write code in OOP manner. Here are few books that might you help with that :
You will notice that only 2 books in the list are strictly PHP, because the methods and ideas of OOP are not restricted to single language.
And, i would recommend to you to stay away from frameworks until you have learned how to write good code and understand the concepts and implementation of MVC. Because there does not exist a php framework which does it correctly ( there are some better , some worse, but all have issues ). That would cause you to learn bad coding practices, which then would be hard to get rid of.