5 ms·
Yes, Python is an excellent language for beginners, but so is Ruby in my opinion. Not trolling: why nobody is using Ruby in introductory courses?
by enrmarc 12y ago
Yes, Python is an excellent language for beginners, but so is Ruby in my opinion. Not trolling: why nobody is using Ruby in introductory courses?
- atiffany 12y agoWe learned Ruby in our 2nd year of CS at the University of Maryland.
- jqm 12y agoMaybe many of the people who take these intro course are not CS professionals. With the numpy and scipy modules there are a number of uses for Python for science/other majors that don't involve building web pages. This is my best guess as why Python VS Ruby.
- jiggy2011 12y agoRuby has become almost synonymous with rails, Python is used in more diverse areas.
- maxerickson 12y agoIt's probably some combination of happenstance and various numerical libraries making Python relatively popular in scientific computing before Ruby became well known in the U.S.
- rectangletangle 12y agoMany people prefer the English-like syntax (including myself).
- agumonkey 12y agoCoursera proglang used ruby for the OOP paradigm. enjoyed it a lot. Python OOP really feels like a bag of bolts, both semantically and syntactically.
- ufo 12y agoBiggest reason is that Python has been around for longer (at least in terms of popularity in the west)
- eru 12y agoAlso absolutely. Python was an influence on Ruby. (See https://en.wikipedia.org/wiki/Ruby_(programming_language)#Early_concept https://en.wikipedia.org/wiki/Ruby_(programming_language)#Ea...)
- artlogic 12y agoI've taught both, and IMHO, the Ruby is less suited for the job of an introductory language because a block (i.e. an anonymous function) is a hard concept for a beginner to grasp and a core part of idiomatic Ruby. Python's syntax simply has "less magic" and is more regular. Ruby's syntax seems to be suited for either folks who don't really want to know what's going on (just give me a DSL and leave me alone) or students who have one language under their belt and are looking for to branch out. That said, Ruby includes a lot of interesting concepts, and while I don't believe it's an ideal first language, those concepts certainly belong in a CS program.
- Rapzid 12y agoThat's why I think the best introductory is the usual C/C++ classes that build on a foundation of memory addresses, the stack, function calls, etc. If you spent just a few days talking about how an actual program runs, blocks are very easy to place on that foundation(haha, see what I did there?).
- epsylon 12y agoThe "Programming Language" course at coursera [1], which is directly adapted from a course at U. Washington by Dan Grossman [2] features SML, Racket and Ruby as three languages exhibiting different properties (FP, OO and static typing). (I have to say that it was extremely good !) [1] https://www.coursera.org/course/proglang https://www.coursera.org/course/proglang [2] http://courses.cs.washington.edu/courses/cse341/13sp/ http://courses.cs.washington.edu/courses/cse341/13sp/
- marcandre 12y agoA block is not an anonymous function. Try using `return`, `next`, etc... in an anonymous functions. Ruby has anonymous functions, they are called lambdas. I'd say that blocks might be easier to grasp for a true beginner that hasn't been "contaminated" by the notion of anonymous functions as fundamental objects.
- artlogic 12y agoYou are, of course, technically correct. However, I'd argue that at the level of a CS1 course, it's all just semantics. True beginners don't even understand the concept of a function, let alone an anonymous function. For a student that's struggling to understand what's happening (not just type and have faith), blocks turn into one of those 'down the rabbit hole' pieces of syntax that requires a bunch of hand waving and earnest assertions of eventual understanding. If you've got an explanation that would work in week 2 or 3 of a CS1 course, I'd love to hear it. I never found one better than "It's shorthand for a function."
- okaram 12y agomainly the fact that python was designed to teach programming and its community has pushed that aspect of it; ruby's community, IMHO, tends to be more for cool, shiny things, and faster changes, which makes it less suitable as a teaching language
- Igglyboo 12y agoPython has a way larger community/ecosystem outside of web development. Ruby pretty much only has Rails.
- klodolph 12y agoYou can say that about lots of languages. Scheme is good for beginners for reasons X and Y, C or C++ is good for reason Z, and Haskell is good for reason W. But at the end of the day, if you teach someone Python, they can turn around and write Python code to solve problems in their science classes with minimal friction, or they can go on to be software engineers, or write web scrapers, video games, whatever. Python's arguably not the best at any of those things, but it's good enough at all of them.
- sigzero 12y agoPython has a much cleaner syntax.
- baddox 12y ago"Cleaner" is an extremely subjective concept.
- msutherl 12y agoPython is syntactically more similar to C, C++, Java, and JavaScript, and that's what most people know and use. Ruby is "weird".