Hacker News new | ask | show | jobs
by nickbarnwell 5706 days ago
Ruby's syntax is also far more opaque at first glance than Python's is. Ruby in my experience isn't any more concise than Python, and often falls into the same trap as Perl of having "more than one way to do it"
2 comments

I never said otherwise. I meant both are 'easy' languages, and though I'd fathom beginners being more comfortable with Ruby (because it has a more forgiving syntax IMO) I still think they're not languages you should begin programming with. We might disagree on which language from the bad languages to start with is better, but that doesn't mean they're any good to learn to program anyways!

I started with C when I was 12 years old, and I'm sure that has made me a much better programmer than I could have been had I started with something easier like Php. In that aspect I think VB.net (which is NOT the same as VB6) is a good language for high-school kids to start with and learn the ropes.

and I started with Java at 11. What you learn on is irrelevant as long as the basic concepts are taught well. Neither Python nor Ruby are ideal for teaching pointers, but for explaining assignment, boolean logic, basic control flow, etc the only better candidate I can think of is Scheme, and VB is far down the list of replacements.

I'm also a bit confused about your statement about Ruby having a more forgiving syntax and taking that in a positive light. For an Intro to Programming course rigid syntax is ideal as it helps to avoid atrocities against whitespace and other crimes of legibility.

That's just not correct. What language you learn on does have an influence on what languages come easier to you as a second or third language. Also some languages make programming concepts and paradigms easier to learn than others. Any way, giving an introductory high-school class in Python, Ruby, or Lisp is IMO counter productive because of the whitespace requirement, the flexibility in syntax, and the amount of parenthesis on their respective languages.

I said two things:

1) I think Python is not a good language for high school because of it's syntax which is not directly translatable to the bulk of other programming languages (and I say the same thing about Lisp now that I'm on it). At this point I made a comment that I would find Ruby a little tiny bit better (but not suitable either) because of it's forgiving syntax, not because of the flexibility aspect of it's syntax (as omitting parenthesis and comas would probably lead to confusion). Python is not forgiving in it's whitespace requirements, while Ruby can make use of blocks and curly brackets in a way that translates better to other programming languages.

2) That I learned C at an early age and it had a big impact in the way I developed as a programmer, to which you responded that you learned Java a year earlier than I did C without making a point out of it. What is this a competition now to see who learned to program earlier?

What language you learned on makes no difference 5 years later, but it does have a big impact on the first, maybe second year. As such, it should be a language where the knowledge and workflow is easily transfered to other languages. VB.net (which I actually dislike anyways) is a pretty straightforward language from which you can move to a plethora of other languages easily. Neither Ruby or Python are suitable for this.

I think there are a couple of idioms which are a bit more concise in ruby ( <something> unless <condition>, or some of the stuff with blocks), but it's a matter of personal taste, I think. I do agree on the "opaqueness", Python does tend more towards "runnable pseudocode" :)