4 ms·
Interesting that he uses Python to teach the examples. Python is what I learned first. Does anyone have an opinion on whether Ruby or another language is bette
by jwallaceparker 15y ago
Interesting that he uses Python to teach the examples. Python is what I learned first.
Does anyone have an opinion on whether Ruby or another language is better suited for teaching basic programming concepts?
- cube13 15y agoFor starting out programmers, I think it really doesn't matter which language that's used, as long as the language supports strong type safety, the ability to create data structures, and, ideally, also has garbage collection. Java, Python, and Ruby all work for this. In a perfect world, the language would also support C-style pointers, but GC is more important feature for a brand new programmer. Initially, the goal should be to learn primitive data structure concepts and usage(i.e. ints, char, strings, pointers, etc.). After that, they should learn more complex structures, like linked lists. These should be taught without referencing the built-in standard library structures. After that, simple sorting algorithms can be taught(including recursion), as well as OO concepts. Teaching all of that in a GC language is nice, because it removes a lot of the memory management that starting out programmers always get caught up with. It lets the student concentrate more on the concepts than on tricky memory issues. That can be taught latter.
- biaxident 15y agoActually research has shown that it does make a difference: [Why complicate things?: introducing programming in high school using Python](http://dl.acm.org/citation.cfm?id=1151880 http://dl.acm.org/citation.cfm?id=1151880) They found that students who were taught Python instead of Java scored higher on their tests. Languages like Python and Ruby make it far easier for people to jump straight into the code. If I'm learning about linked lists why do I need this main method? Ruby and Python have lots of abstractions which make it easier for someone learning to be able to focus on the problem at hand.
- jmlane 15y agoIndeed. As someone taking a data structures course in post-secondary school where the facilitation language is Java, I've struggled more with the Java development environment than I have with actually understanding the data structures and the implementations. Even the Java specific implementations are simple once you can get your package and classes playing nice and compiled to bytecode. This is not a slam on Java, just an observation from personal experience that some interpreted languages like Ruby and Python tend to make it easier to do casual programming exercises or tasks than those needing any compiling prior to execution, such as C, C++, and Java.
- jmlane 15y agoI agree with your short list of goals for students new to programming. Language should not matter for learning the basics of programming and Computer Science concepts. That being said, certain languages do make exploratory programming much easier than others: The biggest issue I've faced with my courses where Java is used to teach the material is having to deal with Java IDEs and boilerplate code required to test tiny bits of code and the resulting behaviour. Interpreted languages or those with REPLs tend to not have this problem from what I've observed. Note: I know about BeanShell, but I've had poor results with it. Maybe my environment is at fault, but it seems to miss functionality as basic as command history, which makes editing commands very tedious.
- cube13 15y ago>I agree with your short list of goals for students new to programming. Language should not matter for learning the basics of programming and Computer Science concepts. That being said, certain languages do make exploratory programming much easier than others: Pretty much. What really needs to be taught is that programming languages are tools. There are pros and cons to every language, so the best language for the concepts being taught should be used. A student that's come out of a good CS curriculum won't be a great programmer immediately after graduating. However, they'll have all the tools that they need to learn how to become a great programmer.
- ig1 15y agoEven though my main language is Ruby these days, I'd still prefer to teach Python, it's much more readable to non-programmers. Ruby has lots of weird short-cut syntax which just confuses newbies.
- tommi 15y agoFor the nth time, it's not about the language. What ever gets you started is fine. Then you learn some more.
- tikhonj 15y agoI think Scheme is a much better option than Python for complete beginners, in the context of a class. However, if I was just hacking around on my own, I'd probably go with JavaScript just because of how easy it is to make something cool and show it off.