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

The languages are similar enough that it does not really matter. Just pick any, but make sure you balance it out by also knowing a low level language or a functional language.

Remember this: Every language you learn is a big investment in time and energy, and I don't think many people can be really proficient in more than 2 or 3 languages. Some can, but not most.

So, choose wisely, because you will likely be using that language for a long time to come. I personally prefer python because it's more widespread and right now, you have more available to you when you know it than with ruby.




I couldn't disagree more.

Even if you spend a month learning Ruby and never use it again, it will still irrevocably change the way you approach writing code.


I definitely did not have this effect on me. Usually when I hear comments like this it's from Java programmers. But coming from a background of already knowing several expressive dynamic languages (Python, Perl) and having a strong functional background in Lisp. I didn't really find Ruby that mind blowing.

Very cool? YES! worth learning? Absolutely! "changing the way I write code irrevocably? Not a chance!


Yeah, if you already know Python, Ruby just isn't that big a leap. You've got to jump further to find something that will be useful/mind altering.


I've found OCaml to be quite complementary to Python: It's excellent for functional programming and has one of the most sophisticated compile-time error checking systems I've ever used (two things relatively weak in Python). Both are very pragmatic and portable languages, as well. The OCaml community is tiny and rather quiet compared to Python's, though.


I didn't say that it would change the way you write code, I said it would change the way you approach writing code.

I'm fairly confident that it did. Once you've really learned it, Ruby creates paths in your brain that you will try to follow forever, even if you're not coding in Ruby anymore.

If it didn't, then you never gave Ruby a real chance.


I think the point your missing is aconbere already traversed those paths in his brain with other languages. Ruby, as far as I know, hasn't introduced any new programming language concepts.


It's cool that it changed the way you approach writing code, but it's more than a little presumptuous to go and apply that experience beyond yourself. I'm sorry if I didn't see much in ruby that I hadn't already seen, it's not as though ruby is pushing through a new paradigm.

Certainly the "ah-ha" moment for ruby was much less intense than my ah-ha moment of Lisp, Python, SmallTalk and Erlang. And it's definitely more straight forward to me than Haskell, Prolog, OCAML or Forth.

That's just the reality of it.


I'll join the peanut gallery and suggest that if "irrevocably changing the way you approach writing code" is the goal, you spend a month with Lisp or C before you do Ruby.


I agree that Lisp would have as much of an impact, if not more. I never said it was mutually exclusive with anything else in this benefit.


You mean that ruby has a greater learning effect than python on a C++ programmer?


If we are talking a month of involvement, you may as well learn both.

I would also throw Lisp in. And Forth. And Haskell. And Smalltalk...

But then, we are not talking about a month anymore...


maybe i'm an incredible genius or something, but give me a week or two and i'm writing code at an advanced level in any language. it's pretty easy. it more or less involves making an actual project in that language, which cold turky sink or swimly requires that you know the language at least decently

i think it's mostly mentality. if you think languages are hard to learn, then they will probably seem that way because you will allow yourself too much time to play around with mere details, whereas if you recognize there isn't much to them, you can accomplish a lot in no time at all


I think it is more likely that you do not recognize your own flaws. It takes a real genius to be able to learn the little things about C++ in a week or two.

A language is not just the syntax of the language itself, it's also the code style, the convention, the best practise, the language specific stuff, the API of the libraries available, the best way of doing things with libraries.

If you use python to write simple number crunching console applications, then switch to ruby, that is an easy switch.

But if you're writing a Web application using Python and Django and you switch to writing DirectSound using C++, and you tell me you can do this in a week, then you are a genius.

The syntax of languages are trivial, but that's like saying you can discover the colors used in a painting. That's the easy part. The difficult part is knowing how it works. Let me list a few examples of technologies that I think differ strongly from each other that make it difficult to switch

- MFC with C++

- Django with Python

- DirectShow with C++

- VHDL

- ASM

- Javascript with JQuery

- CSS with HTML

- Helix Framework with C++

- Quicktime API with C++

- OpenGL with .NET

- LISP

Have you ever had to switch between things on that level? Or are you talking more of a python to ruby switch?


I've done apps in Java/Swing, Java/Netbeans, Java/JSF, PHP4/MySQL/PEAR, Python/(web.py|Pylons|Django), Flash/MTASC, JavaScript/JQuery, raw JavaScript, and Haskell/Happy/Alex, plus several others where I don't feel I really learned the technology in-depth.

I agree with your general point though. It takes me about 6 months to feel proficient in a language. It's not just the syntax - it's the idioms, packaging infrastructure, unit testing tools, code organization principles, code conventions, etc.


To go one step further, to be at an "advanced level" in a language also means to be idiomatic in it.

I have a hard time believing that's achievable in a "couple of weeks", regardless of the level of someone's "genius".

(Also, just because something compiles doesn't mean you're good at it.)


when programming, if you keep your mind on the structures and on the problems themselves instead of on the language, you'll naturally reach points where you will demand that the language do X. sometimes the language will be able to, and it will seem "advanced." sometimes the language won't be able and you'll sob quietly for a moment because you have to implement it in another less elegant way

but if you worry about the details of the language, it will prematurely affect the structures that you create. in this mode it's harder to write "advanced" things because you are respecting the language too much, and are more confined to its syntax/semantics

if you stay above/outside the language, you will naturally pull it up


Well, you prove the point. You are incapable of seeing your own weaknesses in a language.

One can write every language the same way, but that's not programming. You can't learn python and then write C the python way. You can't write Python as you would Java.

Syntactically, it's possible, but that's a different language you are using then.

Don't confuse syntax or knowing when to use particular constructs with knowing a language. Call me slow, but it took me 3 years before I felt confident that I really knew most of C++. I know when to use Boost, when to use STD, What AtlArray is, how to write an IDL file, what extern 'C' does, what an stdcall is, how my variables are layed on my stack, what Gui toolkits are available, how Borland C++ makes properties appear in C++ classes, when one should use an int64, etc.

It takes time to learn that stuff, but to be really good at a language, you need to know it.

We're like doctors, you don't need to apply your knowledge all the time, but when you need it, you need to be aware of what exists and where to look it up.

If they ask me - write a webserver under Windows, I need to instantly be able to think of 3-4 libraries I could use for the low level stuff, and then decide which is best. All that takes time.

The syntax is nothing. A language is a whole lot more than that. You can't stay above a language. You need to delve into the language, you need to have a feeling for the language, you need to feel inside you how to express things in a particular programming language.

When you describe a problem to me, I can see the C++ structure in my minds eye. I can mentally walk through the code, see where I would use templates, where I would use an interface class, where I would subclass and so on.

I can't do the same with python, because even though I know the syntax, I've not used it long enough to get an extreme feel for the language. And the python folks like to reduce stuff down to short lines, and that's something you don't do in C++.

Learning a programming language is learning a new way to think. Not a new way to string sentences together.


> If they ask me - write a webserver under Windows...I can't do the same with python

I'd use BaseHTTPServer. Batteries included and all that. ;-)


note the word "prematurely." of course you have to follow the rules of the language, but being inside the box of the language from beginning to end will limit your creations


I'm not sure if you're being serious here or not... It's tough to tell on the interwebs... But I'll play devil's advocate and pretend that you aren't joking.

Writing Java in Lisp doesn't mean you've mastered Lisp. There is a difference between understanding the logic and creating the implementation in the best way possible, given the language.

As a very simplistic example, C and Python have two different ways to iterate. You could write a loop in Python in a C-like way, but there are much better ways to do it (list comprehensions).

On the flip side, just because C doesn't have list comprehensions doesn't mean it's less powerful as a language. It just does things in a different way. Knowing those sorts of things is why being idiomatic in a language is part of mastering it.


yes, and there is the implicit APL way of iterating. the point is to recognize that they are all instances of the same thing

i'm not talking about java. i'm talking about structures -- problems, their domains, and the machinations that can be used to solve them, independent of any language or implementation


my final project for electronics engineering required a large assembly program. that was incredibly discipline-demanding. though nothing countless macros and subroutines couldn't solve. also met VHDL in that major

all the web things, CSS HTML, JS, PHP etc. XML things like XSLT and XQuery (both of which btw are strict functional languages), etc. both JVM and .NET runtimes. API's can be their own sorts of languages. matlab, mathematica and so on

funnily, i grew up on Java. but everything changed once i met languages with first-class functions

my current favorite languages are Lua and Arc. if Arc had a solid implementation i would use it a lot


Assembler is one of the easiest languages to learn, the difficulty lies in understanding your machine.


Hah! Spoken like someone that has never had the pleasure of coding assembler for the %*$!#@@ ST20


Hmm, should that not have terminated at the $?


the difficulty with a large assembly project is that you have to write a lot of well-named and well-designed macros and subroutines and otherwise create your own modularizations, otherwise it will be completely unmanageable. the main difficulty in my case though was having to interface to multiple devices, one of which was designed to be networkable (ie pain in the ass protocol,) something with which the language didn't help


That's where you fail. The first thing we learnt about assembler was this - write in assembler, do not invent your own language and write in that language. If you do so, nobody will be able to read your program but you.

It sounds like you went and implemented your DSL on top of assembler, which is really bad practise.


i love you too


I'm nice like that :) Don't worry, pg doesn't like me too, you're in good company ;)


"Give me a week or two and i'm writing code at an advanced level in any language."

Whereas the Peter Norvigs of the world need ten years.

Sigh.


It's kinda funny how that works...

When I was in college and looking for internships, I put about 20 languages on my resume - Basic, Pascal, DCL, C, C++, Java, JavaScript, Perl, Assembler, PHP, HTML, SQL, CSS, InstallShield, Common Lisp, Scheme, Dylan, Haskell, Ocaml, and Erlang. After all, I'd written code in all of them, even if "code" was just a small 100-line program.

By the time I was looking for my first job, I'd pruned that to the C, C++, Java, PHP, JavaScript, Lisp, Haskell, and Erlang.

Now, I don't even list skills any more, just what I've done and what technologies I used to do it. But the list of languages that I consider myself proficient in is Java, PHP, Python, and JavaScript.

I used to wonder why it was that adults got so stupid between graduating from college and their mid-30s. Now I know - it's not that they're getting stupider, it's that their world and the difficulty of problems they face is expanding faster than their abilities. I feel much, much dumber than I did when I started college - but the program that took me a month then, I can whip off in a weekend now.


Obviously you've never met Haskell.

And if you hit the reply button and say that you have, then I demand to see code samples.


nay, not Haskell. F# though (using it right now on a small app that i plan on selling, hopefully it makes me enough money to support my starbucks addiction.) actually i've been meaning to play around with Haskell because it has a lot of succinct thingies with currying and whatnot, and i plan on making an experimental language or two eventually. generally though, strongly typed languages are painful for me. that is, painful to use, not painful to learn :)

one paradigm i've yet to try out is the "goal-oriented" languages a la Prolog. i'll get to them

my point isn't about me though, despite how great i am. i just think that thinking about languages as if they were huge monoliths isn't the best way of thinking about them, because it will hurt your ability to try out new languages and perspectives. they are things that you should revel in, not keep away from because they seem daunting


> maybe i'm an incredible genius or something, [...] which cold turky sink or swimly requires that you know the language at least decently

If you're such a language whiz you might want to master basic English.




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

Search: