|
|
|
|
|
by Godel_unicode
3416 days ago
|
|
One thing that I like about Python implementations of algorithms is less thinking about types. When I implement my sort algorithm, I just need to say > or < and assume the caller has given those terms meaning. Not a Java expert, can you do something similar with Java? Maybe with generics? |
|
With python, your algorithm will work with the primitives without specifying either in the algorithm or test code. You only need to specify type, i.e maybe a new class and definitely instantiation, if you want to use something more abstract.
This would be true of Ruby and other dynamically typed languages. For beginner algorithms courses at least, a dynamically typed languages makes more sense since the algorithms taught are only clouded by typing. Complexity theory still applies and what not.
Maybe if learning algorithms that do heavy crunching, a lower level language, probably with static types, may be used but by that point you're not going to mind type info.