Live data from Hacker News

What programming language should I start with?

news.ycombinator.com

81–90 of 117 posts

Re: What programming language should I start with?

#81
post #61

Earlier quoted context omitted.

Agreed - I don't use Perl any more, having grown disillusioned with its messiness a long time ago, but it's certainly much more of a serious language than PHP.

I mean really what made you say such things about PHP? not being a serious language like Perl? This is not an attack mind you, but I'm curious to know what Yahoo, Flickr, Wikipedia, and perhaps to some extent Facebook seemed to have missed when they decided to use PHP for server side stuff. What's with all the PHP hate here in YC anyways?

What's not to hate? It's not very powerful (lacks first-class functions, for example), it's messy (just look through the function reference), it's weakly typed (try performing multiplication on a string), it's fairly insecure by default and it's simply ugly. It may be convenient to be able to start by inserting a few blocks of PHP in to an existing web page, but you can do the same thing just as easily using Ruby and RHTML.

Re: What programming language should I start with?

#82
post #79
post #72

Earlier quoted context omitted.

The reason I can't stand it is because I've had to deal with so much of it that sucks. Also, it just doesn't feel like what I want in a language. The real double edged sword for PHP is that it made it very easy to do web programming. The good side of that is that it let a lot of people write web stuff who otherwise might not have been able to. The bad side of that is that a lot of those people write really bad code t…

How exactly did PHP ever make it "very easy" to do web programming? Was that when register_globals was on? Was it that there was plenty of example code to cut and paste? I hear this "easy" term applied to PHP by many people, but when I look at the language itself, I don't see it. PHP is easy for me because I did C for 12 years, but I look at the comp.lang.php newsgroup and see newbies tripping over all sorts of thing…

Compare to mod_perl circa 1997/8/9, any of the Java stuff... Python didn't have anything that great. ASP was probably fairly easy, but limited to Microsoft. The Tcl guys could have competed, but screwed things up and didn't release much as open source until after I created mod_dtcl, which turned out to be too little, too late.

With PHP, it was and is very easy to get started. I wrote about it here some:

http://www.welton.it/articles/scalable_systems.html

Re: What programming language should I start with?

#84

Re: people around here recommending The Structure and Interpretation of Computer Programs (SICP), I'd warn a newbie that it may be a demanding way to start, and I've had trouble encouraging former coworkers (some with way more experience than me) into reading it. But don't get scared a priori; skim the preface and the 1.1 section to see if it's for you. Even if it's for you, you may want to check out The Little Schem…

I wonder how many people that recommend SICP have actually learned to program from it or even read it. I did way back as in undergrad (with severe MIT envy) and I would not recommend it as a first book for beginner programmers. Also, I wouldn't recommend Lisp or Scheme as first languages to use for beginners wanting a taste of the practice (despite how much better off the world would be if we all programmed in Lisp :). Unless the questioner is a math (or idiot) savant, I would only recommend these as first programming languages to someone if I wanted to scare them out of the profession or didn't really like them.

Today, I would probably recommend JavaScript with the browser DOM.

Re: What programming language should I start with?

#85
post #79
post #72

Earlier quoted context omitted.

The reason I can't stand it is because I've had to deal with so much of it that sucks. Also, it just doesn't feel like what I want in a language. The real double edged sword for PHP is that it made it very easy to do web programming. The good side of that is that it let a lot of people write web stuff who otherwise might not have been able to. The bad side of that is that a lot of those people write really bad code t…

How exactly did PHP ever make it "very easy" to do web programming? Was that when register_globals was on? Was it that there was plenty of example code to cut and paste? I hear this "easy" term applied to PHP by many people, but when I look at the language itself, I don't see it. PHP is easy for me because I did C for 12 years, but I look at the comp.lang.php newsgroup and see newbies tripping over all sorts of thing…

There is a well-worn path for beginners in PHP, with baby steps and encouragement all along the way. You can gradually mix PHP into your HTML site, line by line and file by file, and make your site better with each step. (Look, I've got the date in my Web page and it actually updates!)

There's a tradition of building simple CRUD apps in PHP - a handful of database tables, and a PHP file for each URL that acts as a thin glue layer between raw SQL and HTML presentation. These are some of the easiest Web apps to understand - which is not to say that they are actually easy - and they are a good place to start.

By contrast, learning something like Rails requires a big up-front investment. There are objects. There's a database and an ORM. There's an MVC framework. There's an abstract mapping between URLs and the methods of your controller objects. All of this makes great sense once you can see the big picture, but to a brand-new programmer PHP must look a lot less intimidating.

Re: What programming language should I start with?

#86
If it's for the web only, nothing beats PHP right now in terms of speed and deployment (especially if you're on a budget and need to scale). I'll probably get a lot of flack for this, oh well - but PHP isn't as bad as people say it is provided you take advantage of OOP and separate your logic from presentation.

Re: What programming language should I start with?

#87
post #81

Earlier quoted context omitted.

I mean really what made you say such things about PHP? not being a serious language like Perl? This is not an attack mind you, but I'm curious to know what Yahoo, Flickr, Wikipedia, and perhaps to some extent Facebook seemed to have missed when they decided to use PHP for server side stuff. What's with all the PHP hate here in YC anyways?

What's not to hate? It's not very powerful (lacks first-class functions, for example), it's messy (just look through the function reference), it's weakly typed (try performing multiplication on a string), it's fairly insecure by default and it's simply ugly. It may be convenient to be able to start by inserting a few blocks of PHP in to an existing web page, but you can do the same thing just as easily using Ruby and…

If you sit down at a randomly chosen web server and write two files, one ending in .php and one ending in .rhtml, which file do you think has the better chance of working correctly? Newbies would prefer not to know what CGI means, let alone how to edit an Apache setup file.

But, yeah, PHP is a scary language. In addition to what you've already mentioned, PHP's core "array" datatype appears to have been designed by a committee of drunken camels.

Re: What programming language should I start with?

#88

Python is a great language to start, and even stay with. I've taught a few people to program in python. Very simple syntax, well supported, you'll love it and it will make a lot of sense. Start with python.org to download and learn.

I used to like Python, but now Scala is may favorite:

http://www.scala-lang.org/

Re: What programming language should I start with?

#89
post #81

Earlier quoted context omitted.

What's not to hate? It's not very powerful (lacks first-class functions, for example), it's messy (just look through the function reference), it's weakly typed (try performing multiplication on a string), it's fairly insecure by default and it's simply ugly. It may be convenient to be able to start by inserting a few blocks of PHP in to an existing web page, but you can do the same thing just as easily using Ruby and…

If you sit down at a randomly chosen web server and write two files, one ending in .php and one ending in .rhtml, which file do you think has the better chance of working correctly? Newbies would prefer not to know what CGI means, let alone how to edit an Apache setup file. But, yeah, PHP is a scary language. In addition to what you've already mentioned, PHP's core "array" datatype appears to have been designed by a…

I would not expect someone trying to learn to program to select a web server to test projects on randomly. Installing mod_ruby is as easy as installing mod_php. Finding web hosts that support it isn't hard either.
Post reply on HN