3 ms·
C would be my first preference as well, but I also appreciate that Scheme (or another functional language) would provide better opportunities than C or Java for
by javanix 17y ago
C would be my first preference as well, but I also appreciate that Scheme (or another functional language) would provide better opportunities than C or Java for students to learn more "advanced" algorithmic techniques such as recursion.
The problem with Java (and C, to a lesser extent) in basic problem solving is that you can almost brute-force-code and get a working solution that will get full credit, but after writing it a more elegant (and efficient) solution isn't always obvious. In functional languages, that "more correct" solution almost always seems to stand out more, at least to me.
- sketerpot 17y agoRecursion is only considered an "advanced" algorithmic technique because people are taught to think of it that way. Recursion is actually pretty straightforward once you have a bit of practice using it.
- javanix 17y agoWell, yes, most things do become easier with a bit of practice. If a functional language was taught in beginner CS classes I think it would be easier for students to see how it works. It certainly "clicked" for me once I'd learned a bit of Scheme in my first AI class.