[Klug-general] Hello and an Introduction

Karl Lattimer karl at nncc.info
Thu Apr 27 16:06:58 BST 2006


> > Do you use kernel/doc/CodingStyle only the truly elite C programmer
> > does ;)
> >   
> Looked at it once and then thought. Oh hell, I'm the only one who's
> going to look at my code. :-)

Ah but, it has some incredibly good tips on making your code easy for
YOU to maintain, regardless of the other eyes.

> > How about structures pointing at pointers to structures of the same type
> > which contain arrays of pointers pointing to pointers of structures.
> > 
> > C, its wonderfully suck at times ;)
> > 
> >   
> I've found pointers to pointers and arrays of function pointers to be
> the only pratical use. Any more than that it's not worth it. 

How about linked lists, which operate similar to associative arrays or
variable length arrays. These structures use pointers to structures, you
can have an infinitely long list on the heap if you'd like. Then there
are tree models which are stored as parent child pointers to structures
of a type, using tree models and linked lists you can do some pretty
amazing things quite easily... well as long as you remember to free the
last instance of your pointers and define the space as null correctly. 

I have an example of linked lists which you may wish to take a look
at.  

> > truly C# is the way ahead, well either C# or java, I'm still not sure
> > which is the best for the job looking forward. Java has been around a
> > while and is stable, strong and easy to get to grips with, however Suns
> >   
> We'll see. I didnt think C would be around the length of time it has
> been. Then there are other languages like COBOL still going. 

Cobol is used by three programmers who all live in the same suburban
street! Honestly, I've met them and they're more dull than a delphi
zealot.

> Cost to change old stuff is the key.

Yep, changing from procedural to object oriented is difficult, changing
from oop to procedural is even harder. Most of the time its easier to
rewrite it.

> > Thats probably the best part of OOp, especially when you take an MVC
> > (model view controller) approach, you're model holds the data, objects
> > and all other things which represent your real world entities, your view
> > is purely UI, and your controller mediates between the two. 
> >   
> Yes learnt all that when doing SmallTalk. The proper way to do OO.

Small talk is an interesting language, great for teaching OO principles
to the masses. I still prefer the java OOp model, but I'm starting to
like python and php5 implementations of it.

I wouldn't say that MVC is the proper way however, I find it works to
begin with as a good grouping principle so you don't end up integrating
unrelated code, once you've got to the point where your code is sensibly
separated, then you can begin to change the stuff under the hood,
generally going away from MVC quite a bit. 

Anyway, what a way to welcome a guy to the list, ranting on about
programming concepts like we're K&R ;P

Welcome Matthew, I hope you find your stay a pleasant one.

K,






More information about the Kent mailing list