From: Jonathan Gardner on 27 Jan 2010 18:31 On Jan 27, 6:56 am, Roald de Vries <r...(a)roalddevries.nl> wrote: > On Jan 27, 2010, at 2:01 PM, Jean Guillaume Pyraksos wrote: > > > What are the arguments for choosing Python against Ruby > > for introductory programming? > > I think the main difference is in culture, especially for > *introductory* programming. To add to that, Python is the type of language where experienced programmers can pick it up by reading code, and newbies won't get hopelessly lost. I've taught less-than-formal introductory programming classes to people who are new to programming. Python gets out of the way, and allows you to focus on the programming concepts, such as variable, functions, parameters, classes, and algorithms.
From: rantingrick on 27 Jan 2010 21:41 On Jan 27, 5:31 pm, Jonathan Gardner <jgard...(a)jonathangardner.net> wrote: > To add to that, Python is the type of language where experienced > programmers can pick it up by reading code, and newbies won't get > hopelessly lost. I've taught less-than-formal introductory programming > classes to people who are new to programming. Python gets out of the > way, and allows you to focus on the programming concepts, such as > variable, functions, parameters, classes, and algorithms. Well said Jonathan!! Well said!! (both posts)
From: Nobody on 30 Jan 2010 11:43 On Wed, 27 Jan 2010 15:29:05 -0800, Jonathan Gardner wrote: > There's a lot of "magic" in Ruby as well. For instance, function calls are > made without parentheses. That's also true for most functional languages, e.g. Haskell and ML, as well as e.g. Tcl and most shells. Why require "f(x)" or "(f x)" if "f x" will suffice? > Python is much, much cleaner. I don't know how anyone can honestly say > Ruby is cleaner than Python. I'm not familiar with Ruby, but most languages are cleaner than Python once you get beyond the "10-minute introduction" stage.
From: tanix on 30 Jan 2010 11:58 In article <pan.2010.01.30.16.43.18.172000(a)nowhere.com>, Nobody <nobody(a)nowhere.com> wrote: >On Wed, 27 Jan 2010 15:29:05 -0800, Jonathan Gardner wrote: > >> There's a lot of "magic" in Ruby as well. For instance, function calls are >> made without parentheses. > >That's also true for most functional languages, e.g. Haskell and ML, as >well as e.g. Tcl and most shells. Why require "f(x)" or "(f x)" if "f x" >will suffice? > >> Python is much, much cleaner. I don't know how anyone can honestly say >> Ruby is cleaner than Python. > >I'm not familiar with Ruby, but most languages are cleaner than Python >once you get beyond the "10-minute introduction" stage. I'd have to agree. The only ones that beat Python in that department are Javascript and PHP. Plus CSS and HTML if you can call those languages. The very idea of using a number of blanks to identify your block level is as insane as it gets. First of all, combinations of blanks and tabs, depending on how your ide is setup to expand tabs, may get you bugs, you'd never imagine in your wild dreams. Braces is the most reliable way to identify blocks. Sane compilers ignore blanks altogether. -- Programmer's Goldmine collections: http://preciseinfo.org Tens of thousands of code examples and expert discussions on C++, MFC, VC, ATL, STL, templates, Java, Python, Javascript, PHP, organized by major topics of language, tools, methods, techniques. All collections are fully searchable down to specific chapter.
From: Steven D'Aprano on 30 Jan 2010 14:16
On Sat, 30 Jan 2010 16:58:34 +0000, tanix wrote: > In article <pan.2010.01.30.16.43.18.172000(a)nowhere.com>, Nobody > <nobody(a)nowhere.com> wrote: >>On Wed, 27 Jan 2010 15:29:05 -0800, Jonathan Gardner wrote: >> >>> There's a lot of "magic" in Ruby as well. For instance, function calls >>> are made without parentheses. >> >>That's also true for most functional languages, e.g. Haskell and ML, as >>well as e.g. Tcl and most shells. Why require "f(x)" or "(f x)" if "f x" >>will suffice? >> >>> Python is much, much cleaner. I don't know how anyone can honestly say >>> Ruby is cleaner than Python. >> >>I'm not familiar with Ruby, but most languages are cleaner than Python >>once you get beyond the "10-minute introduction" stage. > > I'd have to agree. The only ones that beat Python in that department are > Javascript and PHP. Plus CSS and HTML if you can call those languages. Your sentence makes no sense. You agree that "most" languages are cleaner than Python, and then in the very next sentence, out of the hundreds if not thousands of languages invented, you can only list TWO that are better than Python -- and those are Javascript and PHP!!! That's like saying "most things are harder than diamond -- the only things that beat diamond are jelly and talc". > The very idea of using a number of blanks to identify your block level > is as insane as it gets. Not at all. People do it all the time. The very idea of expecting people to count nested braces to identify block level is what is crazy, which is why in languages with braces people still indent the blocks. > First of all, combinations of blanks and tabs, > depending on how your ide is setup to expand tabs, may get you bugs, > you'd never imagine in your wild dreams. Not really. The bugs are quite simple, and generally easy to fix. To describe them as unimaginable is stupid. >>> for x in [1, 2, 3]: .... print x .... print x+1 File "<stdin>", line 3 print x+1 ^ IndentationError: unexpected indent If you can't imagine getting an IndentationError from making an indentation error, there's something wrong with you. In any case, if your IDE mixes tabs and spaces, your IDE is broken and you should fix your tools rather than blame the language. > Braces is the most reliable way to identify blocks. Nonsense. For the compiler, both are equally reliable, and for the human reader, indents beat braces easily. > Sane compilers ignore blanks altogether. Really? So a "sane compiler" sees no difference between: for x in mylist: and forxinmylist: I'm glad I don't have to program using a compiler you consider "sane". -- Steven |