Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror

Comment Re:LOGO! (Score 1) 962

Pascal has a lot of advantages as a language for teaching.

First or all, it is very verbal and this makes it very easy to understand and "read" the code. This also forces you to write well formatted code as you have to put the intervals around "AND" and "OR" and so on. This will stay with the kids long after they have switched to other languages.

Also Pascal is not a very high level language (similar to C), so it does not hide the inner workings of the computer. The kids _have_ to learn how the computer works, or they'll never really become programmers. LOGO, Python, Java... they all hide what is going on bellow. Although I'm a Java programmer ATM and generally like it, I find it ridiculous to teach Java as a intro to programming (and a lot of unis do that).

Another thing, I think that one should not use a "production" language for teaching. Counter intuitive, but let me explain. As I see it, a good programmer has to be language-independent. The inevitable change will make them realize that the language just does_not_matter and the main concepts are all the same in any language.

BTW, I have not seen LOGO before, so I just checked it and I personally don't like the syntax, though it's just my opinion.

As for BASIC, well Dijkstra said it best "It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.". He also said somewhere that teaching BASIC should be treated as criminal offence and I completely agree...

Comment Re:28 lines in Prolog :-) (Score 1) 311

Well, I bit the bullet...
This is what I managed to put together after 2 hours (most of the time went for looking for a greedy(er) algorithm)
http://alpha-toxic.hit.bg/Knight.java
About 100 lines of code, and is does 150x150 in less than 50ms (start it with "-Xss10240k" as the recursion is very deep and the default stack fills up at about 50x50)
It's very ugly, not optimized (speed, lines, nothing), JAVA and still waaay faster than what the OP gives. Either he's not a very good programmer or python is not supposed to be used for that, perhaps both...

Slashdot Top Deals

The number of arguments is unimportant unless some of them are correct. -- Ralph Hartley

Working...