Couple of sorting algorithms were introduced this week during lectures.
These are:
selection sort,
merge sort,
quick sort
count sort
built-in sort (timsort)
We implemented the first 4 during lectures and evaluated the performance of each to see how efficient they are. It turns out that built-in sort outperforms most of the other sorting algorithms except count sort when the pool of data to be sorted it rather significant.
So I became curious on the algorithms that timsort implemented. And I was directed to the code Tim Peters implemented using C. Wow I always thought nobody uses C since its low level programming language which is considered painful to compose. So I had a brief discussion with my lab TA on the pros and cons of different programming languages. I was genuinely surprised when he told me the reason why IOS is in a way more smooth than Android. The ground difference between them is the programming language they used. IOS is based on C while Android is based on Java. While C is harder to implement, it allows programmer to take more control such that the program can run more smoothly.
I always thought knowing C is less advantageous as opposed to C++/Java...
Oh really? I was not aware of this. In fact, I always thought Java was a pain to use in my high school computer science class and I assumed it was more complicated than C. Well thankfully we don't have to deal with all that right now seeing as Python is very simple.
ReplyDeleteHaha the TA said you would have to deal with the painful languages quite often. In fact I am from engineering, not compsci, and our faculty tends to emphasize a lot on C and C++ than other languages..
DeleteWe're supposed to cover C in CSC209. I remember someone giving the analogy of coding in C to be like "programming without the safety on." There is more control but the programmer has more responsibilities.
ReplyDeleteBased on what I know, I thought Java would be covered instead of C in CSC209. And yeah in C the effort we need to spend just to get the program to compile is considerably higher than Python. It's not an interpreted language which makes the debugging more difficult...
Delete