by wyager · 10y ago · 0 comments
PHP, much like Javascript is terrible for new developers for this very reason.
Learning a "good" language for lack of a better term is no more difficult than learning PHP/JS and is always worth the effort, if anything learning "good" languages is usually much easier because they are usually internally consistent.
What is a good language? Java?
If all newbs picked up Java as language #1.. would their apps be better? Or would the really bad devs writing copy paste stack overflow code just be unable to understand it, so they would quit?
Like is it safer because it keeps out knuckle-draggers, or safer because it is actually safer? Cuz I can write some horrible Java code that will rival anything you can do in PHP
So you mention Java. Java enforces OOP. Now OOP may not be the best paradigm always, however its a vast improvement on inline procedural PHP.
That isn't to say you can't write some horribly modelled Java code, but the fact that modelling tools are so explicit and forced on the user makes the user at least think about how to use them better.
Other peoples opinion may differ from mine but I maintain this is incredibly important in speeding up new programmers towards writing good code.
You can write low-quality software in e.g. rust, but you're going to work a lot harder at it. Rust (again, just as an example) also makes it easier to write high-quality software.
This is really the only metric by which you can judge the quality of a language, since in the end they're all (mostly) Turing complete.
> its construction actively encourages bad code
That's a statement that needs a reference to back it up.
How would you describe the difference between PHP and assembly? Why is one better than the other in certain cases?