Hacker News new | ask | show | jobs
by mhuffman 3554 days ago
> Both PHP and Javascript are much more complex from a language design standpoint

Complex in the sense that they were originally thrown together and the results of the program might best be described as "stochastic output", yeah I can agree with that.

> A good engineer can write high quality code in "almost" any programming language. It's the coder, not the language, that determines engineering quality.

Sure, but it sure seems funny that "high quality code" is nearly non-existent in PHP and javascript world ...

2 comments

> Complex in the sense that they were originally thrown together and the results of the program might best be described as "stochastic output", yeah I can agree with that.

Absolutely, they are complex because of poor initial designs, and actually even more complex now due to all the efforts to maintain backwards compatibility...

> Sure, but it sure seems funny that "high quality code" is nearly non-existent in PHP and javascript world ...

jQuery is an incredibly well engineered library by John Resig. I think that jQuery was one of the big technological leaps forward that led to the proliferation of web applications.

For a long time, people thought that cross browser JS inconsistencies and confusing API standards meant that you couldn't build interactive UI applications in the browser. And now they are ubiquitous.

So I guess it depends on your definition of "high quality code". I don't think quality code is about some arbitrary coding aesthetic. It's about results, and it's about what your code does, and how it creates value.

>> So I guess it depends on your definition of "high quality code". I don't think quality code is about some arbitrary coding aesthetic. It's about results, and it's about what your code does, and how it creates value.

Moving the goal posts so that the definition of 'high quality' is basically code that compiles and runs as long as it 'creates value'? What about when you have to change it later? What about if it has to be really fast?

People who think that Javascript and PHP are crappy languages aren't just comparing these languages to 'arbitrary coding aesthetics'.

> People who think that Javascript and PHP are crappy languages aren't just comparing these languages to 'arbitrary coding aesthetics'.

I'm not defending the design of JS and PHP. I'm saying that if you are a good engineer, then you can produce code that is quality in these languages.

Also, I'm pretty sure Facebook gets "updated" and is "fast" ;)

They're both sequential by default and lack threading, and that's hard to mess up. They're both great languages for easy projects.

PHP code is a breeze to work with using composer, and most packages use namespaces and have great intellisense. But good luck doing anything concurrently.

NodeJS is fast, and boy can it handle a lot of tasks at once using the event loop! But I can't for the life of me figure out modules or get good intellisense.

There's plenty of high quality code in each. I'd just never write a complex app in either.

Intellisense can be difficult with JavaScript inside an IDE. I've had some luck with WebStorm and their typescript stubs though.