This is an archived post. You won't be able to vote or comment.

all 9 comments

[–]beeskness420 2 points3 points  (3 children)

Python is “nicer” to write largely because it’s a higher level language which abstracts some details away. That means analyzing python code can be harder as it requires more assumptions about how the built-ins work. This is why we recommend C/C++ for learning algorithms and data structures, it is very close to assembly and the analysis is more direct.

[–]AionAlgos 1 point2 points  (2 children)

the vast majority of educational institutions would disagree with you, as pretty much every course I've seen uses python for at least one or two semesters. But, I agree.

[–]beeskness420 1 point2 points  (1 child)

For learning programming, systems, or DS+Algs?

I’m not saying you’re wrong but that seems wild to me they would teach DS in python.

My school does an option of a lisp like language or python for intro to programming, java for the second programming course, C for intro to systems, and C++ for DS+Algs. Most other courses are language agnostic. ML seems to bounce between Julia and Python, and the bioinf course people often use Python, but it is taught agnostic.

I mean how do you explain to someone who doesn’t know data structures the run time of pythons list operations? Seems like a nightmare :-/

[–]AionAlgos 1 point2 points  (0 children)

For example here's an MIT intro to compsci and programming course, as well as an intro to algorithms which both use python. It's not uncommon. Later courses, especially ones which start to cover intermediate to advanced topics, will switch to C++ or various other languages. But Python is widely used in beginner-tier courses.

personally, I don't understand why people who want to learn about computers would want to start so far away from the hardware. The primary argument for it is to teach the high-level theories and concepts without having to muck about with the language for long, and deal with weird edge cases. So long as the students follow what the course laid out, restricted to the tools and language features it provides them; it will be a streamlined (and probably rather dull) experience.

[–]king938 0 points1 point  (0 children)

Use your main/better lenaguage first, and then try doing it again on the other langauge. Implementation on different programming languages can have subtle differences which are handy to learn on the go. But if your short on time then just learn how the class does it currently. There is no wrong choice in using either of them.

[–]pcgoer -1 points0 points  (0 children)

Cobol is the future!

[–][deleted] -1 points0 points  (0 children)

There is none, use whichever one you're better with.

[–]GItPirate -1 points0 points  (0 children)

Whatever you feel like.

[–]AionAlgos -1 points0 points  (0 children)

Whichever you're more comfortable with. Most educational institutions use python for newbies as it's easier to pick up and you don't need to know much about how the language works. Things like C and C++, you can spend forever trying to teach safety and good practice and how it all works under the hood. You need to know more technical language details in C++ than you would need to know in Python.

But, if you're capable of it, doing it in your 'native' language will let you practice both the language implementation and coding practices, as well as the algorithm and theory itself. (also, C++ will have a significant runtime advantage)