Hacker News new | past | comments | ask | show | jobs | submit login
PHP is a good second programming language (but never a first) (rubayeet.wordpress.com)
15 points by nreece on Oct 6, 2008 | hide | past | favorite | 16 comments



Here's I think a better way of saying his point:

It's best to learn programming metaphors in languages that are idiomatic. Multi-paradigm languages are often more confusing, because when you're new to programming learning the paradigm is as important as learning the language.

Thus I'd say that languages like Pascal, Java, Lisp, Smalltalk, etc. are relatively good beginners languages, while languages like Perl, C++, Ruby, Python, PHP, etc. are not.


Although I wouldn't say python is bad for teaching - whilst you can do lots of stuff in different styles in python, it seems to be encouraged not to go nuts in the python community (from what little I have seen).

In ruby at least, people do like to experiment and have fun more it seems.


I think that the best first programming language is one which makes programming fun. For many students, this is the TI graphing calculator programming language! For others, PHP is certainly exciting because the effects of your code are often easy to see.


The first useful program I wrote was in TI-BASIC. Not the greatest language in the world, but it made my physics homework easier.


Same here, good ol' Mortal Kombat on the ti-83 was a blast. Then of course there was my own version of "Drug Dealer" Ah memories of high school math class.


While these "first programming language" articles seem to be perennial favorites, we've reason to be skeptical on many grounds.

First, the authors never seem to be someone qualified to design a curriculum. No doubt they are all qualified coders with a reasonable amount of work behind them and a good understanding of machine fundamentals. However, curriculum design is a specialty, with it's own pitfalls and peculiarities. We may as well ask these authors what a good technique is for thoracic surgery is. They're equally qualified.

Second, while the authors are not qualified to design a pedagogy, they certainly seem to feel that they are, based on their own idiosyncratic experiences. This borders on egomania. "I learned C/C++/Java/QBasic/Lisp first and look how awesome I am. Therefore, everyone should take my obviously optimum path to learning the One True Way of coding." Is there no room for others to learn differently? To take a path different from one's own and still come to the same fundamental understanding and skill level?

Third, and finally, the various authors' lack of imagination considering curriculum design is staggering. Can they not imagine a gentle introduction to algorithmic science via any of the Turing-complete languages out there other than their first language of choice? Is there no room for variety? For example, can any of them answer definitively whether it is better, for any describable subset of students, for them to (1) "learn the hard way" by having to interrupt their focus on the problem at hand to compile c code into object files, hand them to the linker, and then run the executable or (2) forgo the 'obviously essential' details of x86 architecture so that they can hit Run in their lisp/sheme/python environment and see the immediate results? Clearly, in the first case, those that get through the trial by fire will have an easier time learning other languages. However, couldn't that be an indictment against compiles languages as a first language; that the learning curve is too steep?

In the face of the infinite variety of students, learning styles, teaching styles, learning environments, available hardware, and (most of all) pedagogical goals, I'm reminded in this case of a wonderful proverb taught to me by my high school English teacher: It is better to shut up and be thought a fool than to open one's mouth and remove all doubt.


Decent talking points, but nothing more. Outside of this one statement:

PHP was created to solve the Web problem. It was and still remains the most popular language to build web applications.

The rest of the post is fluff opinion that really doesn't hold water, and says nothing about the core of the language other than broad talking points. It's a very capable language, and the argument is fierce over choice of libraries when you scour the Internet.


The best first programming language is whatever lets you do what your goal is. Whether it be to learn how to code in general or to accomplish a specific task. The best second language is one that lets you fix the mistakes you made when picking your first language.

The trick is to find out what the mistakes are (talking to people is very helpful here) and to find some language that compliments the first one so the mistakes even out. Or at the very least to make you realize how good you have it with whatever language you chose to use if you're still convinced you're a perfect programmer and don't need to learn anymore (though, in this case, there's some other advice that would be more beneficial for you to hear)


Unfortunately, there wasn't a single point in this fellow's article that stands. Frequently the authors of stories criticizing PHP write it from the perspective of a newbie first encountering a language. Maybe its just me, but I don't care about newbies. I've been writing applications with PHP for the better part of 4 years. Its a very strong language, and the parts that are "loose", like weakly typed variables and all of the predefined functions make the process of writing working code much easier. Perhaps its just me, but my definition of a good developer is one that knows what the hell they're doing. I have no problem debugging my code. Other people that read my code have no problem reading/debugging it. Its efficient, OO-style. Sure, maybe something like Ruby is "easier". One day I'll get some time and try figuring that out. Meanwhile, people keep bashing PHP. Why don't you bash Java instead?

I've worked in 2 different companies that are Java shops. Its scared the crap out of me. I've yet to encounter a "java engineer" that has a freaking clue to good development practices. They almost universally insist on using tag libraries instead of writing code. Java and its adherents have been the only group of people I have ever encountered that insist on wrapping a perfectly valid markup language like HTML into A FREAKING TAG LIBRARY, THAT JUST OUTPUTS HTML?!?!?! Every bad web development practice I've ever encountered is epitomized by ever java engineer I've ever encountered.


Your comment reads, "I like PHP. I've seen bad Java code."

Congratulations, you just used 250 words to say nothing.


And you've used 20 words to do the same. Me: 11


Me: 2



" Java and its adherents have been the only group of people I have ever encountered that insist on wrapping a perfectly valid markup language like HTML into A FREAKING TAG LIBRARY, THAT JUST OUTPUTS HTML?!?!?! "

http://www.haskell.org/ghc/docs/latest/html/libraries/xhtml/...

I don't know if the Java tag library you mentioned is as good as the one in GHC, but it sure is useful to be able to combine pieces of html while maintaining type safety.


I haven't used PHP, but is this somewhat like how Perl has regular expressions embedded in the syntax, while Python (for example) uses them via a library? PHP is a DSL for web programming and Perl is (arguably) a DSL for Unix system administration, so it is probably worth including those in the core language. If so, it also means that complaining that Java (or Haskell, etc.) doesn't have HTML embedded in it is like complaining that C can't have embedded makefiles.


So he's saying: a good language teaches you to think as rigidly as the language requires, and doesn't let you just do what you want.

I quite disagree that that is a useful thing in a language - it might be necessary, but that's not what makes a language good or bad.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: