Low-Level and High-level ::: C-style And C++ Style

Started by
3 comments, last by kuphryn 22 years, 3 months ago
Hi. I am to the point where I can solve a problem using C++ "low-level" (i.e dynamic memory allocation) and "high-level" (i.e. using the string and STL container). Experienced programmers, even Stroustrup, recommend using library tools like string when possible because them are optimized. First, what is the point of programming if almost everything is done for you and all you have to do is put the pieces together? Under what circumstances do you prefer low-level C++ over high-level C++, and vic versa? Hey, do not get me wrong. Based on my experience, C++ library tools (strings and STL) are unparalleled. I find using C++ library tools speeds up my programs, and they serve as the "missing" pieces to solutions to various programs especially when dealing with istream and ostream. I fear that relying too much on C++ standard library will cause the programmer to lose sight of the big picture and begin to forget the low-level stuff. Does that happen to you? Thus, I try to implement C-Style when possible. Kuphryn
Advertisement
It all depends, for me.
If I have a standard routine that I fear is slow, I will hand-write it.
However, if I need something like a doubly-linked list with a chunk of routines for operating on it, I will probably use the STL, because that way I don`t spend several weeks beating my head against Access Violation.
But if I really need a kick-butt LL with hyper-fast routines, I will(reluctantly) proceed to write and optimize my list(I am pleased that I havn`t had to do this yet)
So the point is- Use them when they will work, otherwise, create your own.


I came, I saw, I got programmers block.
~V''''lion
~V'lionBugle4d
quote:Original post by kuphryn
I fear that relying too much on C++ standard library will cause the programmer to lose sight of the big picture and begin to forget the low-level stuff.

That''s an oxymoron. Big Picture -> Forget low-level stuff.
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
quote:Original post by kuphryn
First, what is the point of programming if almost everything is done for you and all you have to do is put the pieces together?

Nothing application-specific is done for you. The point in programming is to do useful things; what does a very nifty string class do on its own?

quote:Under what circumstances do you prefer low-level C++ over high-level C++, and vic versa?

None. If the question was "under what circumstances do you use low-level C++ over high-level C++?" OTOH, the answer is when speed counts for everything.

quote:I fear that relying too much on C++ standard library will cause the programmer to lose sight of the big picture and begin to forget the low-level stuff.

Focusing on low-level stuff causes you to lose sight of the big picture (it''s called being mired in details). Focusing on the big picture requires that you use whatever low-level components either you or others have implemented as black boxes, ignoring thier inner workings.

quote:Does that happen to you? Thus, I try to implement C-Style when possible.

Unwise, to say the least. Not that there''s anything wrong with C, but doing work that you don''t absolutely have to do is a violation of one of the core tenets of being a good programmer: constructive laziness (aka reusability).

[ GDNet Start Here | GDNet FAQ | MS RTFM | STL | Google ]
Thanks to Kylotan for the idea!
Powerful message!

Thanks,
Kuphryn

This topic is closed to new replies.

Advertisement