Hacker News new | ask | show | jobs
by sixtofour 5416 days ago
Python is an excellent first programming language, and has enough legs to support or launch a career if there's an inclination that way.

I would, however, still recommend Python 2 rather than Python 3. Although the world is slowly walking toward Python 3, it's still unclear when the majority of libraries and frameworks will support it. Starting with 2 will in no way inhibit someone from eventually moving to 3 when that's appropriate. Virtually everything (including 3rd party packages) in the Python world is available in 2, and a big chunk is not available in 3.

One of Python's deserved claims to fame is "batteries included." It comes with just about every facility you could ever want, and they're all generally easy to use. For example, to get input editing in a console program, "import readline" and you're done. Astounding.

But another benefit of Python is 3rd party library and framework support; "extra batteries available." Everything that can be done in and outside of Python can be done with Python 2, but a substantial portion of the 3rd party world has not yet converted over, and it's difficult to say when that will happen. The only people, IMO, who should use 3 are people who already know Python and who have a specific need for something provided in Python 3 or a 3rd party package.

I'd go with Python's excellent online tutorial to see how it goes, and then look at other resources if interest remains.

http://docs.python.org/tutorial/index.html

You'll note that python.org still defaults to Python 2 in their doc URLs.

Here's Python on the 2 vs 3 question:

http://wiki.python.org/moin/Python2orPython3

I wouldn't go with PHP as a new programmer, unless there's a specific desire to work on WordPress or Drupal sites. PHP is fundamentally a web language, whereas Python is widely used in all areas of programming. You can still do web work in Python if you want, so there's no advantage with PHP except with specific frameworks that use PHP; there's every advantage with Python because of the huge number of domains covered by it, including the web.

C and C++ are going to be very difficult first languages for someone learning on their own. Lots of system programming is done in C, and C++, and they have their advantages. I would wait until at least one language is learned, and an appreciation for programming in general is attained, before learning C/C++.

http://www.google.com/search?q=learn+c+programming

I'd make the same comment for Java as I made for C/C++, for someone learning their first language on their own: wait. Learn Python first.

2 comments

I agree almost with everything you said, except I forgot to mention in my comment that the order I listed the languages would be good way to learn them.

Though about PHP. I don't see it as useless language if you learn Python first. One thing I have noticed is that PHP hosting services are offered more than for Python, which makes it kinda easy in my perspective to use PHP for web development. PHP does offer everything you need for web development in the standard libraries, I have never had need for using any of the existing frameworks even though they make MVC easier.

You can always write desktop applications with PHP if your really want. Look at something like PHP-GTK.

"I forgot to mention in my comment that the order I listed the languages would be good way to learn them."

Ah. I kind of agree with you now. I personally might still shy away from PHP, but I have nothing against it (I didn't mean to imply that it's useless). It would depend on the conversation I'd have with the hypothetical student, but by that time (after learning Python), the student could probably decide for themselves.

EDIT: changed parenthesized comment from "after learning a more general language like Python" to "after learning Python"

Yeah, I agree that learning Python would be a good first step. Thanks for taking the time to reply.
Wow, thank you for putting so much effort into your response, I will pass it along to my brother.