[Asterisk-Dev] [Rant] [long] - code style and quality

Steve Underwood steveu at coppice.org
Mon May 9 05:41:09 MST 2005


Derek Smithies wrote:

>Steve,
> the quote was not out of context. I supplied the entire paragraph it came 
>from, and the individual sentence that I replied with it.
>You may disagree - that is your right.
>  
>
Real code gets messy. It only ends up not being messy if you fight hard 
against the natural trend. You cut away the paragraph where I considered 
the trade offs, leaving a very different impression than my full message.

>Now, to the statement about the nature of real code.
>
>real code may get messy as time goes on - that depends on the developer.
>
>I count openh323 as real code - which is not messy.
>  (sure, openh323 is hard to read if you don't know C++, threads and h323.)
>  
>
People have mixed feelings about that one. It looks pretty, but some 
consider its beauty only skin deep. If it was so good its developers 
wouldn't be telling people that Asterisk is rather most useful right 
now, would they? (Yes that happened at a conference in Europe).

>I count the linux kernel as real code  - which is not messy.
>  the linux kernel is complex - it does some weird things in places.
>  there are flaws in the design, but the overall coding style is good.
>  
>
Linux is far less messy than openh323, and its underlying design much 
sounder. It took a lot of effort to make that so, and in a kernel that 
is completely unavoidable.

>I count the alsa project as real code - which is not messy.
>  
>
I really don't know about that one.

>I count the asterisk project as real code - which is messy.
>  
>
Do you have the slightest idea how it came to be? In 1999 there were a 
number of free telephony projects getting off the ground. Most were pure 
VoIP. A number were PSTN oriented. Surprisingly few were trying to make 
a bridge between the two. Asterisk was basically PSTN oriented at that 
time, and only later became more bridge oriented. Mark knew very little 
about telephony, and was learning as he went. He was prepared to 
experiment, and out of that grew both knowledge of telephony and the 
Asterisk software. Most of the other PSTN oriented projects grew out of 
religious cults. The "pure Java is the way, the truth and the light" 
cult. The "design is everything" cult. The "polish is paramount" cult. 
There was a project to do soft modems for FAX that for a couple of years 
was supposed to be "developing ways to interconnect DSP modules", but 
never produced a module. It seemed to be run by people who hadn't the 
slightest idea about DSP. Almost all these project turned into zombies. 
You could still find their corpses a year or two ago, but a lot have 
been cleaned away now - probably when their domains expired. A couple of 
projects survived - for example, there is an ISDN PABX still around. 
Only Asterisk thrived.

So, all the nice tidy projects proved worthless, and the one you 
criticise is usefully serving the needs of thousands of people. Everyone 
knows its messy. Anyone who points out that obvious fact in a two page 
tome is being a PITA. However, where do your priorities lie? Style or 
content?

>Conclusion::
> real code code can get messy as time goes on 
>          - and that depends on the developer(s).
>  
>
Which is pretty much what I said, before you hacked up my message.

Regards,
Steve




More information about the asterisk-dev mailing list