Hacker News new | past | comments | ask | show | jobs | submit login

You can make low-quality software in any language, PHP just happens to be easier to pick up.



By all means, but having the language nudge people in the right direction makes a world of difference.

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.


See I can't decide on this.

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


As I said, by all means you can write bad code in good languages. I'm not saying choosing a good language excludes all possible bad code, only that they provide some guidance on better practices.

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.


> by all means you can write bad code in good languages

I think the main criticism of the GP was the fact that you use the expression "good languages" without defining what makes a language "good".

> not be the best paradigm always

same as above, what makes a paradigm "best"?

> vast improvement on inline procedural PHP.

but why you assume that the majority of PHP codebases are written in an "inline procedural" style? Do you have any evidence? Regarding the "procedural" part, the only large project that is not OOP-based is Wordpress, and even there spaghetti code (which I assume is what you mean by "inline") is AFAIK frowned upon by the community.

> the fact that modelling tools are so explicit and forced on the user

You need to accept the fact that many people may not like the "opinionated" nature of some language, (in fact that inflexibility that you mentioned is something I dislike about Java); often, a language may or may not be the right tool for a specific job precisely because of those opinionated bits.


You are missing the forest for the trees.

The statement I made is that more consistent and "opinionated" languages encourage better code. They don't enforce it, just encourage it.

It is my opinion that this is valuable.

I did define "good", internally consistent languages with strong guidelines for developers. I made no statements about mature PHP codebases as they are irrelevant to my argument. I do accept that people prefer less "opinionated" languages, I too fall into this camp, but I am no longer a new developer, as such this point is entirely irrelevant to what I was saying.

Nitpicking individual points whilst misconstruing what I said is neither useful or appreciated.


> Nitpicking individual points whilst misconstruing what I said is neither useful or appreciated.

It wasn't my intention, I'm sorry if my comment came off as nit-picky. I wasn't trying to misconstrue your comment, I genuinely did not get your argument (I think I now get it, thanks to your reply).


No problem, I also wasn't as cordial as I could have been.


It rare that I see good Java code, especially that written by junior developers.

I think OO is a hard concept to get right. I know it took me years to master, and one of my epiphanies about OO design is that it's not always appropriate. Yes I can tell you the best OO approach to a problem, but I can also often tell you a better approach that isn't OO.


Functional and OO always go hand-in-hand. I love Swift Protocol, Generic and soon Reflection.


the only difference would be the bad programmers would write a get _global_input_variable_enterprise_factory instead of using $_GET.

this argument is pointless.


I often see people say that Java has pretty much been designed as (or at least evolved into) a way to let large numbers of mediocre programmers to develop acceptable-quality software.


This is the most pernicious and annoying technicality that advocates of low-quality languages invoke. PHP does not actively work against bad or just plain wrong code, and its construction actively encourages bad code. It's missing aspects that we know to be tremendously useful for writing high-quality correct 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.


So, I generally don't wade into this argument. I've been programming for 27 years, 12 of that professionally. In that time I've used a lot of languages for a lot of projects. Every language is capable of being used to shoot yourself in the foot TBH. The hate that PHP gets is, IMHO, mostly from the fact that it's a gateway language and as such often has a higher WTF per minute rate for the code you find than many other languages. Anyway, on to what made me post this.

> its construction actively encourages bad code

That's a statement that needs a reference to back it up.


Let's start with this:

How would you describe the difference between PHP and assembly? Why is one better than the other in certain cases?




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

Search: