Live data from Hacker News

A Very Quick Comparison of Popular Languages for Teaching Computer Programming

ariel.com.au

11–20 of 35 posts

Re: A Very Quick Comparison of Popular Languages for Teaching Computer Programming

#11

I used to think: C is a horrible language for beginners, they should learn python due to its simplicity. This will allow them to learn about control structures and program flow in a simple and easy to read environment . But the more I think about it, the more I like C. It gives you the best understanding of what computations are actually being done by your processor; the mental exercises involved with fulling underst…

> But the more I think about it, the more I like C. It gives you the best understanding of what computations are actually being done by your processor

Yes, because C is exactly how computers work inside! SO CLOSE TO THE METAL

> the mental exercises involved with fulling understanding pointers is valuable at the collegiate level

I have learnt about mappings in mathematics in kindergarten. Literally. Then in university we have had exactly one sentence to flesh out the idea in ZFC. You really think C is so mind bending?

Re: A Very Quick Comparison of Popular Languages for Teaching Computer Programming

#12

I used to think: C is a horrible language for beginners, they should learn python due to its simplicity. This will allow them to learn about control structures and program flow in a simple and easy to read environment . But the more I think about it, the more I like C. It gives you the best understanding of what computations are actually being done by your processor; the mental exercises involved with fulling underst…

But do we really need to submit beginners to things like segmentation faults, arrays without bound checks and the lack of a reasonable string datatype?

There is no reason to use C as a first language when you can just as well teach all the basic ideas in a more friendly environment and then go through all of K&R in 2 weeks or so.

Re: A Very Quick Comparison of Popular Languages for Teaching Computer Programming

#13
In the Java example there is a ton of error checking that is not being done in the other examples. Not really a fair comparison. The author said the programs should complete the task of "reading two numbers from the user, adding them together and printing out the result." The Java program does more than that, so of course it looks more verbose.

Re: A Very Quick Comparison of Popular Languages for Teaching Computer Programming

#14

I used to think: C is a horrible language for beginners, they should learn python due to its simplicity. This will allow them to learn about control structures and program flow in a simple and easy to read environment . But the more I think about it, the more I like C. It gives you the best understanding of what computations are actually being done by your processor; the mental exercises involved with fulling underst…

> But the more I think about it, the more I like C. It gives you the best understanding of what computations are actually being done by your processor Yes, because C is exactly how computers work inside! SO CLOSE TO THE METAL > the mental exercises involved with fulling understanding pointers is valuable at the collegiate level I have learnt about mappings in mathematics in kindergarten. Literally. Then in university…

And at the same time we have a whole generation of people that don't know what a tail call is. C might be closer to the metal then most languages but it still is a leaky abstraction in some places.

And anyway, the real problem is not C being complicated. Its that the other alternatives are also perfectly reasonable while also being simpler.

Re: A Very Quick Comparison of Popular Languages for Teaching Computer Programming

#15

> I spent about 15 minutes, failed, then searched Google for an example. It is understandable that Java can be verbose, but 15 minutes followed by failure, make the author seem almost clueless about Java.

I think it's fairly reasonable to not remember how to deal with user input in java when you need to remember what combination of streams and readers and buffers and scanners you need to put together to do it.

Re: A Very Quick Comparison of Popular Languages for Teaching Computer Programming

#16

I used to think: C is a horrible language for beginners, they should learn python due to its simplicity. This will allow them to learn about control structures and program flow in a simple and easy to read environment . But the more I think about it, the more I like C. It gives you the best understanding of what computations are actually being done by your processor; the mental exercises involved with fulling underst…

> But the more I think about it, the more I like C. It gives you the best understanding of what computations are actually being done by your processor Yes, because C is exactly how computers work inside! SO CLOSE TO THE METAL > the mental exercises involved with fulling understanding pointers is valuable at the collegiate level I have learnt about mappings in mathematics in kindergarten. Literally. Then in university…

I believe it is quite close to the metal. When I had my Systems Programming course in first year of college we started with C, and then continued with x86 assembly. One of interesting parts was, when we compiled our C code to assembly and then compared with our hand-written assembly code. Was fun :)

Re: A Very Quick Comparison of Popular Languages for Teaching Computer Programming

#17
post #7

His postscript is a debatable improvement, as input() in Python 2.x (which was what the article was written using) actually evaluates the input as a Python expression before storing it. It's equivalent to wrapping the input functions that the other languages use in eval(), which is (imo) a very, very bad practice to teach unless you're asking your students to write a REPL.

Yes, he should have been using raw_input().

Re: A Very Quick Comparison of Popular Languages for Teaching Computer Programming

#18
post #13

In the Java example there is a ton of error checking that is not being done in the other examples. Not really a fair comparison. The author said the programs should complete the task of "reading two numbers from the user, adding them together and printing out the result." The Java program does more than that, so of course it looks more verbose.

I think it is a fair example: both NumberFormatException and IOException are checked exceptions, so the code will fail to compile if they're not caught.
Post reply on HN