Live data from Hacker News

A Very Quick Comparison of Popular Languages for Teaching Computer Programming

ariel.com.au

1–10 of 35 posts

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

#3

> 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.

The author explained that:

I'm actually kind of embarassed I had so much trouble with this - I've been working on a commercial Java package for two years, but because it's GUI based I rarely have to deal with reading from the console. Real Java programmers will probably look down on me with a mixture of pity and disgust. Such is life.

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

#4

> 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'm not sure I could write that code right without Eclipse, or at least not without quite a few runs through the compiler and looks to the docs.. I'm not a Java guru, but I have used it quite a lot.

It's not hard in itself, but it is overly long, with a lot of things to remember.

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

#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.

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

#8

> 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.

yeah, the use of java.util.Scanner would make it much more succinct:

    import java.util.Scanner;
    
    public class Addup {
        public static void main(String args[]) {
            Scanner sc = new Scanner(System.in);
            int i1 = sc.nextInt();
            int i2 = sc.nextInt();
            System.out.println(i1 + i2);
        }
    }

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

#9
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 understanding pointers is valuable at the collegiate level (much less so if your learning to program on your own, I believe college is a time to increase your analytical abilities rather than just learn raw facts); It also has the simplest syntax to learn (for a procedural language).

You dont have to explain argv, argc or the details of scanf to beginners. Thats like saying python is complex because you need to explain iterators and generators. You don't need to dig that deep into the language as a beginner, you just need to be able to understand the structure, control flow and be able to get your programs working.

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

#10
post #8

> 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.

yeah, the use of java.util.Scanner would make it much more succinct: import java.util.Scanner; public class Addup { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int i1 = sc.nextInt(); int i2 = sc.nextInt(); System.out.println(i1 + i2); } }

Very interesting, although he does indeed say:

> The extensive class library is however quite daunting. It appears there's a class for almost everything, and much of "programming in Java" seems to consist of "searching for the right class". Even after two years I find I cannot do much in Java without constant reference to the documentation.

Post reply on HN