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

He's not making that argument!

From the article: "You can learn PHP in a day or two if you're familiar with any other language. You can write PHP code in any editor or environment you want. Emacs? Vim? Notepad? nano? Who cares? Whatever floats your boat. Being a stupid language also means that everyone knows it. "

The author didn't spend a lot of time talking about learning PHP because there's not much to learn. There's nothing surprising in the components in the PHP stack. If you know HTML, adding PHP has low overhead. DB reads and writes are simple. If you can program in another language, you know all of the logic statements you need to write an application. If you need an example, there are probably tens of thousands of bad PHP tutorials online with bad sample code that still manages to work.

I've learned PHP and Common Lisp from scratch at different points in my life, and PHP had a much lower barrier to entry. I installed and configured PHP on my local machine and made a stats-tracking webpage all on the same day. This was my first server-side web application ever, plus my first database program ever.

Fast forward 4 years, and I worked through "ANSI Common Lisp" for a month before I felt comfortable writing regular applications in Lisp. Then I installed Hunchentoot and stumbled around for a while, but was able to figure out how to generate static content. Most of the Hunchentoot tutorials online were for older versions, but I found one that proved invaluable. I then ended up patching S-XML, because it was only written to support 5 or 6 of the 250+ "&" style HTML character codes. I sent that patch to the mailing list, but I bet nobody ever got it. I tried to hook up a database, and found Postmodern, which was nice. Thank God I already knew Emacs, but I wasted more than a day fighting with upgrading SLIME and SBCL at the same time.

The Common Lisp path doesn't sound so bad, but compare it to my PHP experience - I wrote an application on the same day I first looked at PHP. By the time I was integrating Database code, I was well over a month into learning Common Lisp.




Please don't say familiarity with "any other language" prepares you for PHP. Not every language teaches you that when you get an error with a line number, you need to look at previous lines for a missing semicolon. Not every language teaches you that = is not for comparison. Not every language teaches you the difference between && and &. Having seen PHP newbies struggle with issues like this, I am confident that the list of languages where prior experience makes PHP "easy" is short and specific.


As someone with a lot of experience with teaching new people PHP, you're missing something. The other language portion generally refers to another programming language. Most people with those problems suffer from not knowing another programming language, or fundamentals in programming.

People with the problems you mentioned are one of two types of people:

1. No prior programming experience. 2. Do not understand fundamentals of programming.

These are the people that use $var1, $var2, and $var3 instead of arrays.

Beyond that, if you can't be bother to learn the difference between =, ==, and === in PHP, you aren't bothering to learn, and have no reason to complain.


I totally meant programming languages. C syntax and conventions are not "fundamentals of programming"; they're C syntax and conventions. We agree that effort is required to learn them. That's my point. It's easy iff you know something similar already.


OK, basically the argument boils down to "if you have to write a webapp and don't know how to program in Lisp or PHP, you'd be better choosing PHP".

It's very close to trite. Yes, PHP is easier to learn. But if you're already proficient with Lisp, would you still be faster learning PHP? And if you are not up to speed with lisp, why the hell would you even be considering it for a time-sensitive quick-n-dirty job?

The question he set out with was "why is PHP more popular"? His answer is "because it's easier to learn and more popular".


Well, it's more than trite, because a lot of very smart people run off distracted by shiny things like Lisp. I remember writing Scheme in Scheme in under 500 lines in college! It was so elegant!

I still have a Clojure book on my shelf, read almost the whole thing, got emacs off the ground with SLIME a few times, and haven't actually solved a business problem with it. I have existing code bases in Python and Java, and I can create way bigger wins by fixing the obviously wrong things with them than by bolting on some component in Clojure and creating a new area of "nobody knows what happens here".

Mayyyyyybe if you have specific needs then a lisp is a good idea -- if you're in a green field situation, have sufficiently complex application logic to justify an unusual web setup (this is much more rare than people think), and either know what you're doing with lisp and/or have a long timeline to figure out what you're doing. But it's pretty uncommon, and as awesome and elegant as LISP is, it's refreshing to see someone writing from everyday experience rather than "this is cool!" once in a while.


Learning bad PHP may be easy. But from my exposure to PHP I find learning to write good PHP code to be fairly hard. Because you have to work around all the limitations of the language.

Common Lisp may not be a paragon of elegance, but it's not nearly as awful as PHP. And Common Lisp is a fairly conventional, mostly imperative language. Nothing as scary as Haskell or Prolog, or even Scheme.


It's not an argument over which language helps a programmer produce better code. It's an argument over which language helps a programmer generate an almost-correct solution faster.

It's the same as Worse Is Better: http://www.dreamsongs.com/WorseIsBetter.html


Yes. I buy your argument, if you say "small-scale good-enough solution".


To be clear, it's not my argument. I'm just trying to clarify what argument the author is making.


Understood.


Well, that's the problem, it's possible to be somewhat productive in PHP, even as a bad programmer. Sure, such people code notorious SQL injection flaws, but... well, I can't think of a but.




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

Search: