5 ms·
> But neither the choice of language nor the lack of framework are to blame. This is partly true. It is possible to make something great with substandard tools
by wlll 6y ago
> But neither the choice of language nor the lack of framework are to blame.
This is partly true. It is possible to make something great with substandard tools. I suspect a master craftsman with a set of dull saws and blunt chisels using his shoe for a hammer will still have the skill to create something pretty good.
But it will be frustrating, and most people aren't master craftsmen so what they will produce will be adversely affected by the quality of the tools. If you give most people better tools they will have more chance to create something good.
PHP is the rusty saw of the programming world (and yes, I have spend a fair amount of time programming it).
You absolutely can create something great in PHP, but the sheer amount of gotchas and edge cases mean that for a lot of people it's hard to produce something good. There are a lot of people out there who aren't master craftsmen at PHP, and this is reflected in the frequency of the low quality PHP application that are out there.
- simion314 6y agoyou mean your favorite language prevents you to copy paste code, have variables shorter then 4 letters and also fixes the bugs for you, let me know this cool language so I can try it. I am also sure that in your first years of coding your code had no issues similar with the ones you described.
- wlll 6y ago> your favorite language prevents you to copy paste code, have variables shorter then 4 letters "here's one place that PHP doesn't prevent poor quality code that is the same as other languages, and so all languages are the same" No languages prevent these things (that I am aware of), but not all languages have the same number of edge cases that PHP has. > and also fixes the bugs for you, let me know this cool language so I can try it. I've written a lot of languages over the years, but right now I'm enjoying Go, which kinda does help prevent me from writing bugs with it's static typing, but also it's simplicity. > I am also sure that in your first years of coding your code had no issues similar with the ones you described. What's your point here? Noobs write bugs and bad code? Sure, we agree! But that doesn't mean that PHP is a good programming language.
- simion314 6y agoIf PHP is a bad language, your complaints are just just irrelevant, I could probably find some bad code base made in Go and prove that Go is bad. > but not all languages have the same number of edge cases that PHP has. I agree , some have more some have less The things is that from your comment it shows you have no idea what you are talking about, I suggest you let people with experience in PHP to explain hat are the issues and how to work around them. I have a few experience in PHP, experience with 5.4 and older PHP not the 1990 version. What I could complain about PHP are small things I do not feel that I need some feature from Java or C#, my time is spent reproducing bugs reported by our users, debugging and fixing them or spent on adding new features, creating solutions etc. I admit when I was younger I would complain about why do we have to use AS3, or PHP or X for this, there are better languages but this days I know that the language is a small part of the entire project, the hard part is creating solutions, a new dev will start by typing code and offering you a fast solution that someone else needs to fix it later, an experienced dev will think at 2,3 or more solutions, consider all the advantages and disadvantages, test then and finally start writing the code - so IMO the fact that soem language has a bit more sugar coding or and IDE starts 2 times as fast is irelevant, what is important is the person that generates the solutions and the person that when a bug is raised can dig deeper and find the cause and fix it.
- wlll 6y ago> If PHP is a bad language, your complaints are just just irrelevant I don't really understand what you mean here. > I could probably find some bad code base made in Go and prove that Go is bad. "It is possible to write bad programs in PHP and also in Go, and therefore the languages are the same" YOu can write bad code in all languages, but PHP makes it harder to write good code. > The things is that from your comment it shows you have no idea what you are talking about Yes, my 21+ years of experience writing code in over 10 different languages, including a decent amount of time writing PHP, pretty much means I don't know what I am talking about. > I suggest you let people with experience in PHP to explain hat are the issues and how to work around them. <raises hand> > What I could complain about PHP are small things I do not feel that I need some feature from Java or C# I am not talking about features. In fact, Go has a surprising lack of features, it's one of the things that makes it pleasant to write, and easy to write well.
- jmnicolas 6y agoActually my favorite language (C#) comes with static typing, a compiler, a step by step debugger and an IDE that allows me to have long variable names at no cost and I have fewer bugs. So yes my first year code was better than what these 2 interns did in PHP and a random text editor. Had they used C# (or Java for that matter) the app would be much more maintainable in the short time that I can allocate to it.
- slantyyz 6y ago> It is possible to make something great with substandard tools. Is PHP substandard though? While it's no longer my cup of tea, I do remember it being fairly stable and performant. Some of the enterprise software I work with, that was written in Java is ridiculously bad, but I don't consider Java substandard. Real world example: the "Configuration" app I use takes a minute to start up on modern hardware, and it's main job is to give a tabular GUI to an XML file. Even saving the configuration can take a minute.
- wlll 6y agoIn my experience, and of course opinion, yes. Java might also be "bad", I don't know. I programmed it for a bit but didn't like it so moved on. The main problem with PHP, the real killer, is not that it's complex, or the needle/haystack parameters to functions changed, or the iffy string escaping/unescaping or all that stuff, it's that it's hard to know all the edge cases in the language that could cause you to write a bug. It's hard to look at a piece of code and say "that's going to work the way I think it does". Javascript has the same problems with it's string/number/NaN/coercion wattitude. I want to be able to reason about my programs, because almost all of what I do (and I guess most people writing anything other than the most trivial application) revolves around handling data. Names, emails, files, data, preferences. If the language I am writing makes it hard to see the bugs, then it makes it more likely that there will be bugs. There is a common counter to this, and that's that good PHP programmers know about the edge cases, but there's a hell of a lot of average programmers out there.
- slantyyz 6y ago> "that's going to work the way I think it does" I definitely get where you're coming from. But everyone is different, and thinks differently. I did a lot of Rails after PHP, so I like using Coffeescript, even though that admission would get me mocked on any JS forum, since I've seen many people be called an idiot for not preferring Typescript. As for frameworks, I like Svelte, because it works the way I think. I've seen a lot of negative comments from React and Vue users on people using less popular frameworks like Svelte. My general attitude about these things is "if it works for you, that's great". I'm no longer a PHP user, but I don't think the reasons why I liked it 15 years ago have changed, even though my preferences have.
- jiriknesl 6y agoIf PHP is a rusty saw, what isn't? There are hundreds maybe thousands of languages. And when you measure all things (expressiveness, stdlib, productivity, ability to build a team, etc.) PHP would come up in TOP10 for any webapp. Of course, it has its gotchas. So does Clojure, Ruby, Python, C#, etc. Honestly, once a person knows PHP very well, switching a language has almost no impact besides their "feeling". I have switched from PHP to Clojure 8 years ago. I feel better. But I am not significantly more productive. The brevity of code is higher, abstractions easier to do, overall it just feels better. But it's not a silver bullet. At the end, when a huge amount of webapps are mainly working with a database, validation, putting data to templates, and all the auth staff. All this is usually well developed in existing frameworks and libs without any extra overhead. There's not a lot of space for elegant abstractions in average webapp.
- wlll 6y ago> If PHP is a rusty saw, what isn't? There are hundreds maybe thousands of languages. I was curious, there's about 9000 according to a cursory google search. > And when you measure all things (expressiveness, stdlib, productivity, ability to build a team, etc.) PHP would come up in TOP10 for any webapp. > > Of course, it has its gotchas. So does Clojure, Ruby, Python, C#, etc. Honestly, once a person knows PHP very well, switching a language has almost no impact besides their "feeling". Maybe PHP is in the top 10 for some of the things you mentioned, and you can definitely build a PHP team pretty easily, however: Productivity: I am sure that most people can get their PHP programs to a state where they at least seem to do what they want, the problem with PHP is the sheer number of gotchas and edge cases. Here's some I put together for another commenter: https://gist.github.com/wjessop/0923e0667d7dd53ae0503459894e641c https://gist.github.com/wjessop/0923e0667d7dd53ae0503459894e.... It took me minutes to find these, there are many many more. Sure, you might be able to get your e-commerce site off the ground really fast in PHP, but are you doing the job that you should be doing? Did you remember to check for every single edge case? Are you coding security flaws into your app? How sure are you that you didn't miss an edge case and you're tallying your basket wrong in some circumstances? Unless you are very very good at PHP then you are going to miss this stuff and it's going to come back and bite you in the ass. There has even been a study into how bug-prone different languages are: https://www.i-programmer.info/news/98-languages/11184-which-languages-are-bug-prone.html https://www.i-programmer.info/news/98-languages/11184-which-... A key phrase: "The languages with the strongest positive coefficients - meaning associated with a greater number of defect fixes are C++, C, and Objective-C, also PHP and Python. On the other hand, Clojure, Haskell, Ruby and Scala all have significant negative coefficients implying that these languages are less likely than average to result in defect fixing commits." All languages have flaws, but PHP has way more than most. Building a team: Most PHP developers are likely very average PHP programmers, just like most Ruby developers are likely very average Ruby developers. You would need to be a super-human to be able to program PHP correctly taking into account all the edge cases, and so yes, building a team is easy, but if you want to build a team that build software that isn't a liability, then you need to hire the absolute best PHP programmers, and that's going to be very hard. So is it easy to build a PHP team? It depends.