Jump to content

How often do you write your own libraries?

In my data structures 1 course I have learned about linked lists, doubly threaded linked listed, hast tables, stacks, queues, and now binary trees. 

Everything seemed great until 2-3 trees, 2-3-4 trees, and then red-black trees. I get the idea, the purpose, and overall I get different tree types.

Honestly if I had to write my own library for something like reb-black binary tree then I would probably drop out and change major. Surely I understand the concept and the procedures, but holy shit I hope I never have to write my own code for that. Which kinda brings me to the question. How often do you write your own libraries? Let's not include wrappers or re-implementations.

 

For example I don't see how my code for stack can be better than one provided with ide/compiler/etc. And maybe the provided implementations are already optimized and maybe written in low language?

 

 

Link to comment
https://linustechtips.com/topic/18649-how-often-do-you-write-your-own-libraries/
Share on other sites

Link to post
Share on other sites

First off - you'll survive. Don't change majors. ;)

 

Learning to write your own library, even if it isn't as good as existing ones, teaches you so much about how things work in the background. It's not going to be easy, but it's going to help you a lot.

Link to post
Share on other sites

To be honest for production you don't need to write your own data type libraries. Because there are many good and reliable libraries. But on the other hand writing your own data structure can really help to understand and get  grasp of that data structure.

Link to post
Share on other sites

The way I see it is there are +100 programming languages under the sun and most of them are modifications of another for ease of one function or another.
When it comes to libraries its mostly key algorithms which would differ, it might be 0.5 seconds on retrieval but 100x0.5 is still 50 seconds better than the 1 second retrieval time of the 'other one'.
We only automate things which are gonna happen a lot of times after all;
And like doweeez said you will probably just use the built in ones for the next 5 years after graduating but you get a big job and you move into some super specific application and all of a sudden your understanding of the data structure gets you a raise because you saved that half a second!

Link to post
Share on other sites

The way I see it is there are +100 programming languages under the sun and most of them are modifications of another for ease of one function or another.

When it comes to libraries its mostly key algorithms which would differ, it might be 0.5 seconds on retrieval but 100x0.5 is still 50 seconds better than the 1 second retrieval time of the 'other one'.

We only automate things which are gonna happen a lot of times after all;

And like doweeez said you will probably just use the built in ones for the next 5 years after graduating but you get a big job and you move into some super specific application and all of a sudden your understanding of the data structure gets you a raise because you saved that half a second!

Interesting. Wouldn't company hire a developer who works strictly with data structures. My college offers a set of courses dedicated to data structures, yet they are not required for the major.

 

 

Link to post
Share on other sites

Interesting. Wouldn't company hire a developer who works strictly with data structures. My college offers a set of courses dedicated to data structures, yet they are not required for the major.

well it entirely possible to make a living in IT without knowing how anything works past the IDE(that and pass rates if it were compulsory would probably be cut significantly) but you can get into serious dollars when you move into and beyond the language which is where C++/C/assembly comes in. HOWEVER you need to know exactly what you are doing with those.

C++ is the only one I've heard anecdotally about but imagine being able to build a giant cargo ship but one small hole is made in the hull, so everyone dies :P

 

With regards to weather a company would hire a developer primarily to make and work with data structures, I cannot comment. I'm still doing my degree too; Although my educated guess is you're job requirements will probably be 'make the thing' and you have to extrapolate the significance of optimising a data structure, more often than not with a team considering how big things need to be before you'd consider that valuable use of time.

Link to post
Share on other sites

Companies are far more reliant on making use of libraries than they are on demanding you reimplement them. It's like the number one rule of software development; do not reinvent the wheel. If libraries exist (particularly open-source libraries that can be modified) then the company would be happier with the higher productivity than forcing you to reimplement such data structures. I think knowledge of data structures is purely for either implementing your own libraries for context-specific applications, modifying existing data structures, or simply because you need to know what is the most appropriate choice between a set of data structures for implementing your idea.

 

If you know that in your project you need some functionality and there are several methods that may achieve this then it is wholly dependent on your knowledge of the data structures and their varying performance for you to decide which one will perform best for the suited purpose.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×