01-20-2005, 09:26 PM | #1 (permalink) |
Insane
Location: Seattle
|
[C/C++/Java] Confusing Learning To Program With Using Class Libraries
I really am confused about something I've observed.
Whenever I read a message board like this, there's always a novice programmer asking questions about pointers or data structures or the kind of thing that novice programmers are working through. Invariably somebody says, "Why use your own structure - why not use STL". Somebody else says, "You can download some open source code to solve that problem for you". Why? Why don't people seem to see that learning to use class libraries is not the primary goal of novice programmers? Do these people actually write software with 100% code reuse? What's the deal here? Am I crazy...
__________________
"It's a long story," says I, and let him up. |
01-20-2005, 09:31 PM | #2 (permalink) |
Loser
Location: McDonald's Playland
|
i'm right there with you cowlick, people should know that learning to use class libraries is not the primary goal of most novice programmers. You're not crazy, everyone else is, and you're the only sane one.. which means that i'm also crazy, and everything i say is a lie, except for that, and that, and that, and that, and that, etc. and that too
|
01-20-2005, 09:43 PM | #3 (permalink) |
Psycho
Location: sc
|
no, you're not
there are a lot of good reasons to not use an openly available library for a data structure. if you need help i'll give what i can but then again, i'm a primarily c programmer and a computer engineer. i think differently than the CS kids with their OO stuff. |
01-21-2005, 09:26 AM | #4 (permalink) |
Crazy
Location: Salt Town, UT
|
The reasons people try to get you to use a ton of libraries is that this is how it is done in the real world. In 90% of typical programming jobs, nobody cares if you know how to use a linked list, or build a binary tree. You find some library that does what you need it to do and use it. (In the embedded world, you write just about everything from scratch, because you can make a ton of assumptions that the library writers cannot.) This is also the same reason that we would recommend that you use the highest level programming language you can for your particular task, be it PHP, VBScript, Java, Perl or whatever.
Now, for someone that is just learning, reinventing the wheel is a good way to go about it. It is at this stage where you write your own database and everything. So I think the problem is, is that we can't tell if you are a novice programmer in the workplace, or a novice programmer in the learning side of things. (And I tend to assume workplace, because of my irrational hatred of college kids.) |
01-21-2005, 12:47 PM | #5 (permalink) | |
Crazy
|
Quote:
It's that simple.
__________________
I want no escape. |
|
01-23-2005, 05:17 AM | #6 (permalink) |
Crazy
Location: San Diego, CA
|
There seems to be a general learning methodology where you can't use any existing tools until you know how to make the tool yourself. A type of ground-up framework.
So, for an example outside of the CS field, in math I learned how to do derivatives the hard way with limits before I was allowed to use tricks/tools that everyone in the real world uses. But does the same type of thing happen in other fields? I guess it depends on the field - in some it's not applicable. Can anyone think of examples that are outside of the math/science fields?
__________________
"Don't believe everything you read on the internet. Except this. Well, including this, I suppose." -- Douglas Adams |
01-23-2005, 08:01 AM | #7 (permalink) |
Junkie
|
In my field we know of the STL but it is rarely used. Everything in home grown. This is because we need every ounce of performance we can get. Also because of this we use mostly C instead of C++ or technically "better C" which is C++ after you take out most of the OO.
Everyone should know how to write those STL classes because knowing how those datastructures are created helps you know how to use them better. Knowing the big O for their various operations is a must. People who just use STL and don't truely understand the datastructures are severly limiting their ability as a coder. I think the biggest benift of coding these up first on your own is they make sure you know pointers like the back of your hand. |
01-24-2005, 03:37 AM | #8 (permalink) | |
Tilted
Location: Boston
|
Quote:
Implementing your own data structures is good practice while you are in school, but I (for one) have been surprised at how little of that translates into the real world. And if I need to pull out the CLR when this stuff does come, it's really not a big deal. |
|
01-29-2005, 03:55 PM | #10 (permalink) |
Upright
|
Personally, I use STL whenever I can. It's a standard practice, and it's been proven to work. It's honestly saved me a TON of time when coding. There have been some headaches with Microsoft's STL implementation, but I am a good enough coder that I can easily deal with them.
Could I write a linked list, map or string class? Sure. But why do it when something as solid and simple as STL already exists? The bottom linke: when you're learning, you should write as much from scratch as you can. The more you do yourself, the more you will learn and the better you will be. As you learn and know more, you can easily take more liberties with your code. |
01-30-2005, 08:00 PM | #11 (permalink) |
Tilted
|
One of the things I know I ran into long ago about learning to program ("how to use pointers") was that a lot of concepts, like pointers, need the right problem to see how they should be used. You can sit around and work on sample code all you want, but it may not help you really understand the why.
The point regarding shared libraries is that for certain cases, like the STL, there is a LOT of work that has gone into them. Many people can write the tools of the stl, but consider: - The STL is fairly cross platform (I develop on 10+ with the same code) - It is often fairly well optimized, with memory pooling, tight loops, etc - It is far more bug free than things you are going to write, in all likelyhood. - It is a well understood standard. I can write STL code, and other programmers immediately understand it. |
Tags |
c or c, class, confusing, learning, libraries, or java, program |
|
|