

PHP, Perl, Haskell? - netbyte

I want to do simple scripts and be able to make simple blogs and stuff. Which language should I learn next?
======
Lazare
PHP is a bad language; it is ubiquitous due to historical accidents and path
dependencies. If you have the freedom to pick any language you want, and you
don't have some specific urge to write Wordpress plugins or something, then
_DO NOT PICK THIS_. (Also, PHP is likely as popular as it will ever be.
There's not really any room for further growth.)

Perl is similar to PHP. It's not nearly as bad - in fact it's a great language
in many ways - but it's also old. It's about as widely adopted as it's ever
going to be, and it doesn't pick up new features as quickly as it once did.
The syntax is also a bit quirky. :) Unless you want to work on Perl codebases,
I'd recommend staying away, not because it's _bad_ but because it's not really
good enough.

Haskell isn't really suitable for scripts or simple webapps (your listed use
cases). It's a wonderful language, and knowing it will make you a better
programmer and a better person...but it doesn't do what you want. Stay away.
:)

Better choices for you would be:

Python/Ruby: Flip a coin and pick one. Both are awesome, but they also have a
lot of overlap; you won't regret either choice. They're both excellent for
writing short scripts, webapps, etc. They are objectively MUCH better
languages for these purposes than PHP, and at least marginally better than
Perl. They also have very serious market share (which makes it easy to find
tutorials, help, example code, open source projects to contribute to, etc.)

Javascript: With the advent of Node, it's a decent choice for what you want.
And it's still the omnipresent language for client-side programming. Not as
mainstream as Python/Ruby, but still pretty popular and widely adopted - but
it's not completely mature, and new and interesting ideas are still popping
up.

Something else: If those options don't spark any interest - or if you already
know them - you might look farther afield. Lua and Clojure are both
interesting options, in very different ways. As someone who already knows
Python and JS pretty well, Clojure would probably be top of my list of
"languages to learn". (I just wish it wasn't JVM based...oh well.)

~~~
netbyte
Node is terrible on windows

------
adrusi
Well not PHP, that's for certain. A much as people bash on perl, it's actually
quite useful for shell scripts that need a bit more power, so if you write a
lot of shell scripts, I would recommend that. Although be warned, it isn't
just a programming language, it's a way of life and while it's fairly easy to
start with it, it's not as easy to get to the point where perl becomes really
valuable, there are a lot of things to memorize.

Haskell is a different beast entirely. It is great for writing big
applications because they will be very efficient, and have a sound code base
that is easily understandable and extensible. It's also great for smaller
things and can be a lot of fun to write. It's also makes you stand out from
the crowd and look smarter; there's a certain respect for haskellers, whether
it's justified or not.

Of course, haskell isn't that easy to learn. For those with no experience
programming, it's no more difficult than learning with some other language,
but if you know other languages, you will need to unlearn a lot, which is
hard.

I would recommend haskell if you want to take on a big project or want to
learn a lot along the way that you can carry over to other languages.

But I would definitely recommend one of python, ruby or javascript for the
kinds of things you said you wanted to do.

I said no PHP because the only thing going for PHP is it's good documentation.
PHP is bad in terms of language design, there are a lot of inconsistencies
which get confusing. It's standard library is a mess, and a lot of PHP
programmers are just pro copy-pasters.

Ruby, Python and javascript fill a similar niche as PHP and are all relatively
easy to learn, easy to use and have nice communities. If you want to lean more
on the scripting side, I would recommend ruby, if you want to do more of web
programming, javascript, and if you want to do some other programming, python.

------
Rust
PHP is easy to learn and the documentation is extensive. But it is very easy
to do things wrong in PHP, mostly because people learning PHP do a lot of
copy/paste coding without really understanding the domain they're coding for
(in this case, a web browser over the internet).

There are a lot of sites that give information on working with PHP correctly
(including <http://appwithphp.com/> and <http://planet-php.net/>), but expect
to do a lot of reading and experimenting before getting it right.

I personally didn't care much for Perl as a web language, although it's great
for system-level scripting.

I'd add Python to your list of potential languages too. I've been having a lot
of fun with it lately :)

------
geoffsanders
Don't listen to any of the PHP haters here. You said you want to build
_simple_ scripts and blogs - something PHP is far more than adequate for, and
it will be something you can pick up quicker than Python or Ruby. Also popular
blog software like WordPress is all PHP.

While the PHP haters may be right if you're trying to get the best software
engineering gig in Silicon Valley, for your purposes, I think PHP would
probably be the best combination of tons of tutorials and documentation
online, power and capability, and low learning curve.

Just my $0.02 as a PHP, Ruby, and JavaScript developer.

------
debacle
Which languages do you now know?

I would not recommend Haskell as it is a heavy lifting language, not really a
scripting language. Perl is probably the strongest scripting language out
there, and PHP is certainly the most ubiquitous web language out there. I
learned Perl first, which made learning PHP super easy (you just have to
unlearn a few things).

You can write scripts in both Perl and PHP, but web programming is definitely
much easier in PHP. Try out both and see which one you like.

------
TheSmoke
if i had known that there were programming languages like python or ruby in
2005 i'd learn one of them instead of php.

haskell is another giant but i suggest going with either python or ruby. your
taste will decide it.

