[NTLUG:Discuss] Linux Programming Classes??

Greg Edwards greg at nas-inet.com
Tue Jul 1 13:10:41 CDT 2003


Vaidya, Harshal (Cognizant) wrote:
> Hi Wilson,
> 
>    I really don't think that there is a need of formal training for C
> over Linux. All I did was just picked up a C programming book and
> started off writing programs with vi and compiling them through gcc. 
> 
>   I have always observed that one learns more in depth through
> struggling at each step and trying to sort out the problem by himself
> rather than having a user guide to help out at each of those steps. You
> might or might not agree to this.
> 
>  So, the only thing I would suggest you is to get a good book on C
> programming (preferably one from Orielly publications) and start off
> writing programs on Linux. 
> 
> I've always found this method of learning by the own more satisfying.
> 
> Thanks and Regards,
> Harshal Vaidya.
> 

I would have to qualify this approach as to whether or not you're 
already a programmer.  If your a developer and you've got a very good 
understanding of structured programming and procedural languages then 
yes I agree that this approach can work.

However, if you are new to programming, only written scripts, basic, or 
OO programs, please don't go this route.  C is not a walk in the park to 
learn or understand.  Yes a "Hello World" program is simple and easy to 
learn.  But pointers, indirect references, types & structures, dynamic 
memory, linked lists, trees, queues, stacks, type casting, etc. are not 
simple concepts and can be a nightmare if done wrong in production code.

I've been writing in C for 20 years and I still learn new ways of doing 
things all the time.  C is extremely versital and dangerous all at the 
same time.  C is not so much a language as it is a toolbox.  Unlike C++, 
Java, basic, Python, Perl and most other languages, C only provides a 
basic set of primatives that you use to build everything else.  The 
great advantage that C has is that it will let you do most anything you 
want, that's also it's achellies heal.  Where C++ will babysit you on 
releasing dynamic memory C won't.  If you forget then that's just your 
tough luck, well your user's tough luck that is.

I'm a Software Engineer with a degree in Computer Science and over 20 
years experience.  I've worked as a contractor for over 15 years and I 
cannot tell you the number of places that I've found C code that was 
written by someone that just didn't understand C.  C is more than a 
language, you need to understand the concept to do it right.  I have 
written software in 15 different languages and with the exception of 
assembler and Forth, C is the toughest to get a real handle on.  Like I 
said, writing a "Hello World" program is easy, but writing a dynamic 
memory manager that does it's own garbage collection and heap management 
isn't.

I personally recommend that new programers learn Pascal first then C. 
Pascal will teach you disapline, structured programming, and procedural 
programming concepts all at the same time.  Pascal will force these 
things on you where C won't.  You'll learn the importance of bounds 
checking and pre-qualifing data before using it.  One of the biggest 
mistakes that self tought C programmers make is that they trust their 
data.  A golden rule is to never trust the data that comes from an 
outside source, that is from outside of your current object module. 
Once you've learned Pascal then go on to C where ALL of the handcuffs 
and babysitting that Pascal imposed is removed.

Which ever route you decide to take I wish you luck.  Be patient because 
you won't be writing serious programs over night.  Learning C can be 
frustrating but once your there you'll be amazed at the things that you 
can do with it.  It may take longer to write programs in C than with 
other languages, but you can do so much more with it.

ok, I'll get off the soap box now ;)

-- 
Greg Edwards
New Age Software, Inc. - http://www.nas-inet.com
======================================================
Galactic Outlaw        - http://goutlaw.nas-inet.com
   The ultimate cyberspace adventure!




More information about the Discuss mailing list