[Asterisk-Dev] readable code /* New subject */

Steve Underwood steveu at coppice.org
Wed Mar 2 09:16:59 MST 2005


Steve Kann wrote:

> Robert Webb wrote:
>
>>
>> On Wed, 02 Mar 2005 16:01:56 +0100
>>  "Olle E. Johansson" <oej at edvina.net> wrote:
>>
>>> Preston Garrison wrote:
>>>
>>>> You know something that is highly overlooked is learning to write 
>>>> understandable code.  Alot of programmers like to write code that 
>>>> is a mess to understand.  Just because you can do something in the 
>>>> C language doesn't mean you should :)  However i have to admit out 
>>>> of all the open source projects, asterisk has some of the easiest 
>>>> to understand code.
>>>>
>>> Great. That statements tells me we are heading in the right direction.
>>>
>>> Let's make it better by adding more comments and developer
>>> documentation. Personally, I've added quite a lot of comments to 
>>> chan_sip in order to understand it better. Also to other modules as 
>>> I explore them. Funny part was, some of my comments that was 
>>> commited to cvs was totally wrong and no one seemed to bother (or 
>>> propably did not understand the code themselves). So I've changed 
>>> them as I have learned
>>> more about the inner workings. :-)
>>>
>>> As I wrote earlier, let's clean up 1.2 and make it easy to 
>>> understand and easy to work with. Join the asteriskdocs project. Fix 
>>> errors in
>>> README files and sample configs. Add comments. Add doxygen 
>>> documentation.
>>>
>>> You will not get customers to pay for this, but it will make it much 
>>> easier the next time your customer wants a customization of some kind.
>>>
>>> /Olle
>>
>>
>>
>> Not intending on hijacking this thread, but since it is talking about 
>> readable code and such...
>>
>> What would you guys/gals out there recommend as a good primer for 
>> learning C that will teach the correct way of coding from the 
>> beginning. I would like to understand more of what the code is about, 
>> how it works, and maybe in a year or so be able to contribute a 
>> little more.
>>
>> I have an IT background in hardware, networks, some database, but no 
>> real programming. Can pick my way through something that is already 
>> written if I have a handy reference available.
>>
> If there are 10,000 books on C available, there's 9,999 too many.  The 
> correct book is:
> *
> C Programming Language (2nd Edition)*
> by Brian W. Kernighan 
> <http://www.amazon.com/exec/obidos/search-handle-url/index=books&field-author=Brian%20W.%20Kernighan/102-7188933-0904141>, 
> Dennis Ritchie 
> <http://www.amazon.com/exec/obidos/search-handle-url/index=books&field-author=Dennis%20Ritchie/102-7188933-0904141>, 
> Dennis M. Ritchie 
> <http://www.amazon.com/exec/obidos/search-handle-url/index=books&field-author=Dennis%20M.%20Ritchie/102-7188933-0904141> 
>
>
> http://www.amazon.com/exec/obidos/tg/detail/-/0131103628/qid=1109779472/sr=8-1/ref=pd_bbs_1/102-7188933-0904141?v=glance&s=books&n=507846 
>

I'm afraid that one it getting a bit out of date. I don't think they 
have produced a newer version which covers C99.

Regards,
Steve




More information about the asterisk-dev mailing list