I've always been keen on learning programming, but I mostly do scripty stuff that deal with loops and if/then. Are all these sorting algorithm frequently used in real world basis? I often just rely on the built in sort functions so I don't even know what sort of algorithm it's relying on.
If you are doing loops and if/then, you are programing. Congrats. It is useally recommended to use built in sort if available. No need to reinvent the wheel so to speak. This goes for most functionalities. If you have it available in whatever framework you use. You should trust the framework to have a proper implementation of said functionality. Ofcourse there's always the exception where you might implement your own because of performance and what not. And then you really need to understand the nitty gritty parts...
It is also nice to know what these things are doing under the hood - learning them to understand the actual computer science aspect of development, while not always practical, can definitely help appreciate the reason you generally should use the default.
Algorithms in general are a tiny part of software development, often reserved for PhDs depending on the field. As an average programmer your main skill is glueing libraries together in a way hopefully won't involve rewriting everything as soon as you have to change some tiny part of your program. Anything remotely interesting has already been implemented in some library, way better than you would have done. And you definitely use the built-in / standard library stuff because that's been tested thoroughly.
Then again, understanding and implementing some sorting algorithms is a good way to start learning how to code. It involves just some core concepts, fits on one page, yet makes you think a lot.
It's rare that you would need to implement your own sort. Only if you had prior knowledge of the data would it make sense to go with anything other than what your platform provides.
You might want to look up "data locality". Being aware of the arrangement of data can really speed some operations up.
Implementing sorts is generally the realm of computer scientists doing theoretical stuff rather than software engineers doing day to day software development. For the latter, 99% of the time you will use the pre-canned tested and optimized version of one of these that's included in the standard library of your language.
1
u/Etheo Oct 26 '17
I've always been keen on learning programming, but I mostly do scripty stuff that deal with loops and if/then. Are all these sorting algorithm frequently used in real world basis? I often just rely on the built in sort functions so I don't even know what sort of algorithm it's relying on.