7 ms·
So... OP worked on a team of people who didn't care about good code, and were using PHP. It probably happens with PHP more than other platforms, but I've worke
by mgkimsal 13y ago
So... OP worked on a team of people who didn't care about good code, and were using PHP. It probably happens with PHP more than other platforms, but I've worked on teams who did crappy Java and crappy Perl and crappy ASP too.
Bigger takeaways - working in a situation where you get to choose your own tools and be self-directed is probably a better fit for this person. When he works on a team of 3-5 other people who want to do different things in his Django code, there will be tension. Probably not as much as his PHP monstrosity, but there will be some.
Working with large established frameworks, it's hard to see one file have JS, HTML, raw SQL, ORM code and core PHP app logic all in the same file. The conventions dictate where/how to separate.
The OP likes that separation, likes conventions, and wants to move to Python. Great. However, I feel the benefits he's going to get are coming more from a greenfield setup and working alone vs the language or framework itself.
Also, typo alert: the word is 'resonate', not 'resinate'. ;)
- adamors 13y agoYeah, I'm getting the feeling that the OP has no idea of PHP frameworks (or anything that has happened with PHP in the last 5+ years for that matter), and prefers to throw the baby out with the bathwater because of this.
- marklit 13y agoI was using PHP frameworks between 2007 and 2011. Have you been watching what has been happening with the Python-based frameworks in the past 10+ years?
- adamors 13y agoWere you really? Because saying things like "There is package management in PHP but I never found any code bases in the wild" or getting excited by writing RESTful APIs paints another picture.
- marklit 13y agoYou've taken the wrong impression from those statements. Have a look at my CV if you wish.
- mgkimsal 13y agoTo be fair, it's pretty hard to refactor existing spaghetti PHP in to any comprehensive framework, at least production systems within a company with deadlines and customers.
- debacle 13y agoIs that something intrinsic to PHP? It's hard to refactor any code when you have no time allocated to maintenance.
- mgkimsal 13y agoI do think it's a bit harder in PHP, given the nature to which it allows for spaghetti code to happen in the first place. Certainly it's never easy in any platform, of course; I do think "bad" PHP is harder to refactor than "bad" other code. Just an opinion, of course.
- debacle 13y agoAny particular reason? You can do fewer terrible things than you can do in Perl, C, C++, etc.
- methodin 13y agoIndeed but it's ungodly easy to add composer, follow FIG standards and be on your merry way to refactoring. At some point if you keep it up it will be easy to transition into a good framework like Symfony. I just refactored an old class hierarchical system where each class extended a random other one and all functions were called from a global parameter or $this-> so if I can do that, anyone can!
- est 13y agoPython encourages you to write clean code.
- bliti 13y agoDoes it really? I'm not being pedantic. My experience has been that coding guidelines/style and personal standards are what encourage good, maintainable code. Not the language itself. I've seen beautiful PHP, just like I've seen horrendous Python.
- teilo 13y agoSomewhat. The clean syntax of the language certainly helps. However, it's not really Python itself that encourages clean code. It's the Python way -- meaning the culture. The concept that there should be only one right way to do things is extended right down to the way code is formatted. There is even an official PEP (Python equivalent to an RFC) which covers it. In other words, in the Python world, personal standards are discouraged, and there is a remarkable amount of voluntary compliance with the community standards. I work in a number of other languages on a regular basis, and while there are certainly a set of best-practices out there for most languages (often 2 or 3 of them, in fact), I don't see anything nearly so much uniform compliance as in the Python world. I don't really know why.
- bcj 13y agoAs I've grown more experienced with writing Python code, my interest in writing readable code has also grown. I would guess that most of the readability concerns come from graduating, as I started working with other people on non-disposable code. I feel Python has played a part too though. Python has an official style guide (PEP 8), so code is more homogenous across developers. Python also has a set of core principles (the Zen of Python) which put a focus on readable code.
- lsh123 13y agowanna bet that I can write bad code in python? :) :) :)
- 13y ago
- kayoone 13y agoExactly..take Symfony2 for example, which creates clean and maintainable PHP code using very modern methodologies. You have package management, ORMs, ODMs, Template engines, coding standards and a huge community that produce high quality Bundles (like plugins) that you can integrate into your project. Id even argue its better than Django or Rails nowadays.
- badman_ting 13y agoWho didn't see this response coming? I'm sure it is possible to write decent PHP code, but it's funny how that never seems to actually happen.
- mgkimsal 13y agoIt does happen - I've seen it multiple times, from people far more disciplined than myself. As to this (my) response, I was pushing a bit more towards "greenfield projects always tend to feel better", but I'm not sure they'll be much better over the long haul if the same person with the same skill level has the same constraints (time, features, etc).