This idea that PHP is somehow unique in it's ability to allow you to write spaghetti code is absurd.
Have you not seen 10,000 line Javascript files of uncommented procedural code? I have. And oooo boy the hoops you have to jump through to write OO JS code in structured files is nuts.
Now granted, some languages provide more structure, or frameworks out-of-the-box... but whew JS is not one of those languages.
Writing bad PHP code is lazy programming or beginner mistakes. Let's stop shifting blame.
Thanks for you comment. And yes I agree with you too in some ways but still PHP's nature is the spaghetti code, though I'm a PHP programmer myself and more than half of my programs have been written in PHP XD
Indeed, bad code is on the programmer not the language ( at least at the initial phase), there is a point as you learn more techniques, OOP, SOLID, PHP Unit, and good practices ,your code structure and refactoring gets better, you dont have to write spaguetti code unless you want to or are very new to programming,a programming language doesnt make you a good programmer from day 1. Some are easier to get started and thats where you see bad code spread everywhere, ex. Using deprecated mysql code instead of PDO or mysqli at least.
This idea that PHP is somehow unique in it's ability to allow you to write spaghetti code is absurd.
Have you not seen 10,000 line Javascript files of uncommented procedural code? I have. And oooo boy the hoops you have to jump through to write OO JS code in structured files is nuts.
Now granted, some languages provide more structure, or frameworks out-of-the-box... but whew JS is not one of those languages.
Writing bad PHP code is lazy programming or beginner mistakes. Let's stop shifting blame.
Thanks for you comment. And yes I agree with you too in some ways but still PHP's nature is the spaghetti code, though I'm a PHP programmer myself and more than half of my programs have been written in PHP XD
It's literally not.
Php mixed into html has been discouraged for like a decade now. Beyond that it's a procedural & OO language. Style or mess... is up to you.
Spot on. Rubbish code is on you as the programmer. If people are writing junk in PHP, they're writing it elsewhere too, especially JS.
Indeed, bad code is on the programmer not the language ( at least at the initial phase), there is a point as you learn more techniques, OOP, SOLID, PHP Unit, and good practices ,your code structure and refactoring gets better, you dont have to write spaguetti code unless you want to or are very new to programming,a programming language doesnt make you a good programmer from day 1. Some are easier to get started and thats where you see bad code spread everywhere, ex. Using deprecated mysql code instead of PDO or mysqli at least.
Thank you Juan for you comment. You are totally right and I couldn't agree with you more.
Couldn't agree more. Additionally, the more recent features and tools of PHP have made it a more pleasant experience.