[CVALE] Question about structured programming... (C Programming Specifically)

Craig Van Degrift craig at yosemitefoothills.com
Fri May 18 10:30:27 PDT 2007


Landon,

Googling "object-oriented programming in C" will show lots of books and 
advice.  Since C++ is written in C, everything can be done in C, but the 
practical answer may be to decide what aspects of OOP you really want and 
only try to get those (like smart pointers and constructors/destructors).

If I'm not mistaken, the kernel is all about efficiency, not clarity or reuse, 
so even the C programming in the kernel is quite convoluted in places.

Craig

On Friday 18 May 2007 09:13, Landon Blake wrote:
> I've got a question about structured programming, and C Programming in
> particular.
>
>
>
> I do most of my programming in Java, which is an object oriented
> language with lots of "syntax sugar". :] I wanted to try my hand at
> writing a couple of little C programs, in part so I can gain some
> experience programming in C that will help me understand how the Linux
> kernel works.
>
>
>
> It seems that every time I try to sit down and design a C program I end
> up trying to emulate an object oriented programming language. I guess
> that my brain has been hard wired to program with objects. All the other
> languages I've dabbled in have been object-oriented. (Python, C#, Visual
> Basic .Net, C++...) I know that this is done to some extent with systems
> like GNOME, which imitate object oriented programming using the C
> programming language. I know that it is possible to do this, but is it
> really practical? Should I fight the urge to create a system that mimics
> object oriented programming when working with the C programming
> language? Or should I embrace this technique and just use something like
> GNOME in my own C programs?
>
>
>
> They don't mimic an object oriented programming technique in the Linux
> kernel, do they? Should I force myself to write programs in C that
> adhere to the principles of structured programming?
>
>
>
> Thanks for the advice.
>
>
>
> Landon
>
>
>
>
>
>
>
> Warning:
> Information provided via electronic media is not guaranteed against defects
> including translation and transmission errors. If the reader is not the
> intended recipient, you are hereby notified that any dissemination,
> distribution or copying of this communication is strictly prohibited. If
> you have received this information in error, please notify the sender
> immediately.



More information about the cvale mailing list