Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

And don't forget the most important part - incompetent programmers. It is we, the programmers, who writes all that code that that ends up as steaming pile of garbage. We can't blame others on that one. We need to become better with the tools we have.

Thus it is naive to believe that by switching language you somehow magically will write better code but without doing any effort to improve yourself first.



Better tools lead to better outcomes if all rest remains the same, so I don't think that holds true even if we ignore the fact that languages (and their communities!) incentivize different things and can certainly lead to better code.

Its certainly a lot easier writing good Python than good C, for a quick example.


True, but they are somewhat different tools with different purposes, writing an operating system in Python is a bad idea and doing web in C is cumbersome.

Thus I wouldn't blame Python if I used it for something it wasn't designed for, similar I wouldn't blame the screwdriver if I used it for punching a nail into a board.

There seems to be a constant drive to have one language to rule them all, instead of using specialized languages that are designed for a specific domain.

That is why I think PHP is such a good fit for the web because it is actually designed with that in mind.


> it is actually designed with that in mind.

One of the gripes that I -and many- have is that PHP wasn't ever "designed" in the first place.

This is changing. Has changed. But for people, like me, who started with PHP back in the 3.x days, and left in the 5.x days, PHP has a bad history. It might overcome this, or already have. But the history sticks to it.

And it begs the question: why make PHP into a new Python, or Ruby or JS, if we already have a Python or Ruby or JS (or Typescript)? Because if any language is actually designed (for a broad sense of that term) for the Web, it is JavaScript.


PHP was made for the web and yes it was never formally designed, more of an ad hoc evolution, thus string functions differ from array functions and so on.

Today however in respect to the many improvements, not only for the language itself but also to tooling, frameworks and libraries, this is largely irrelevant.

And this is also the case when it comes to history, the past is the past, when comparing technologies it needs to be an up to date comparison and not how it was 20 years ago. And with a relevant comparison PHP has won that every time, today as in the past.

But it seems like many out there carry around these grievances about PHP and even if they know that PHP has changed they can't let go, thus we are no longer in the realm of technology but in the realm of the human psyche.

JavaScript early days was similar to PHP early days, ad hoc evolution made by one person. It was much later JavaScript became more formally designed with committees, standards and backed by billion dollar companies.

But JavaScript was actually never designed for the web, it was designed for the DOM, a browser technology. It was much later that JavaScript got things like template literals, tagged templates and multiline strings, these things are essential when doing web, things that PHP has had from the start.

If your language can't put out a proper HTML document without doing tricks it sucks as a web language. Early days of JavaScript was full of unreadable string concatenation, arrays as string builders and just a bunch of functions calls to the DOM API. It was awful.

Because PHP is a community driven language and it is not backed by billion dollar companies, PHP does not afford to invent new language constructs out of the blue or take the risk of designing fringe features that could potentially alienate large group of programmers, PHP needs to stay mainstream so to speak, thus the design of PHP is largely affected by what is happening in other languages, good and bad.

Funny thing here is that much of the criticism against PHP is that it is becoming a Java like language, where Java on the other hand is designed language, but still Java has become a mess with things like Collections, Iterators, Iterables and Streams - all work differently and requires clunky casting between them, and then the checked exception and unchecked exception debate, especially combined with Streams where checked exception is non-compatible.

Thus somewhere along the line a language that historically was designed becomes a language based on evolution because of the simple fact that we still can't predict the future. Therefore the "not designed" argument can eventually be applied to every other other mature language or at least large parts of it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: