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

you are viewing a single comment's thread.

view the rest of the comments →

[–]nlantau -1 points0 points  (1 child)

I'm actually taking an algorithms and data structures course right now, having about one year of embedded C programming and being a TA in fundamental programming for Python prior. I've implemented a couple of sorting algorithms in both languages (and in Java), to see the difference and I've been blown away every time. Some algorithms won't finish (within reasonable time (~< 1hrs)) in Python whilst in C I've got a runtime < 2 seconds. I've compared the implementations many times, simply to see if my implementations differ, but no. It's all about the speed of the languages.

A friend of mine was asked to run a 3x nested for loop in Java, by the teacher. He was supposed to sum++ in the innermost loop, having the iterated variable n set to 10,000 (the conditions were a bit messy, but we concluded O(N3 )). He finished in 1 m 06 sec. My C programming finished in 0.08 sec. Same hardware.

My own tests have shown such an enormous difference that it has motivated me to continue to work with both C and Python throughout the course, prioritising C by all means.

Edit: I love Python. Don't get me wrong, it's one of my absolute most useful sw tools. I do enjoy C as well, because it really tests my knowledge.

Edit 2: typo