Hacker News new | ask | show | jobs
by kyllo 4813 days ago
How are you going to teach pointers or recursion in Java, though?

More on that from Joel Spolsky here: http://www.joelonsoftware.com/articles/ThePerilsofJavaSchool...

There is a lot to learn in a CS program, and it really requires a single language from start to finish.

There is really no single language that you can use to teach everything that a CS student needs to learn. A computer science education should teach concepts that transcend languages, and use whichever language is best suited to demonstrate the concept at hand.

1 comments

> How are you going to teach pointers or recursion in Java, though?

Pointers, okay sure, but what's the problem with teaching recursion in Java? See, e.g., http://danzig.jct.ac.il/java_class/recursion.html

Sure, recursion is possible in Java, but it's rarely used because of the inevitability of hitting a StackOverflowError given a sufficiently large value of n.

Teaching recursion doesn't make a whole lot of sense unless you're using a functional language where loop iteration is not the paradigm.

> Sure, recursion is possible in Java, but it's rarely used because of the inevitability of hitting a StackOverflowError given a sufficiently large value of n.

That's a good reason for not using recursive algorithms in production Java code, but it doesn't make Java unsuitable for teaching CS including recursion (Python, which IMO is a much better general purpose teaching language than Java, faces the same problem; plenty of intro CS classes that cover recursion well use Python.)

> Teaching recursion doesn't make a whole lot of sense unless you're using a functional language where loop iteration is not the paradigm.

It makes perfect sense independently of what is idiomatic in the language: teaching CS using a language isn't teaching the idioms of the language. Teaching iteration and recursion in the same language is useful, particularly because doing so is useful in underlining that recursion and iteration are different approaches for the same problems, even though in most languages one of the two options will tend to be more idiomatic.