Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: Re: Rewriting some code

by Fingo (Monk)
on Feb 18, 2001 at 08:42 UTC ( #59210=note: print w/replies, xml ) Need Help??

in reply to Re: Rewriting some code
in thread Rewriting some code

A book about good code, provided by Micro$soft??!!? I wondered why Hell had ordered all that ice... :)

UPDATE: This was meant as a joke, I do not know how good Code Complete is, it just seemed ironic to me that a company whose software is always crashing, would publish a book on good code design

Replies are listed 'Best First'.
Re^3: Rewriting some code
by tadman (Prior) on Feb 18, 2001 at 09:41 UTC
    Actually, if you open the book and read it, you will find that it contains a lot of good advice. Microsoft, you must admit, does write a lot of software, and if anyone should be able to comment from a position of experience alone, then Microsoft would certainly qualify.

    As for the content, the author apologises if the material is a little too C oriented, but a lot of it applies quite literally to Perl as well, if only because they share a lot of syntax, semantics, and pitfalls, such as:
    if ($my_var = 0) { # Why doesn't this EVER run!?!? DoImportantStuff(); }
    The author is a strong advocate of the "Hungarian" naming system, where in a strictly typed language like C or C++, the name of the variable indicates its type, such as 'nPeople' (int) or 'pszName' (char *). This is not entirely irrelevant for Perl, that while it will readily convert between int and char, it still isn't psychic. You will be punished severely if you switch up $q for $p when $q is a CGI object and $p is a SQL statement handle. Hungarian would have you call them '$cgi' and '$sth', for example, or perhaps '$cgiMain' and '$sthSelectAll'.

    I know, a book about writing good code from Microsoft, the creators of DOS 4.0, Windows NT3 and much, much worse, but when you consider that Windows 2000 actually runs at all, despite being 25 million lines of code, they must be doing something right. It seems that the author wrote the book to try and promote good coding practices within Microsoft, a practice that was strangely absent from one of the world's largest software manufacturers.

    While it may not be as comprehensive as XP, it does promote a better methodology than the ad-hoc approach taken by many, and it uses a lot of code examples to illustrate its points. Have a look through it if you have a chance, and see for yourself.
      I moved my original message here
    A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://59210]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2020-10-26 19:00 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (252 votes). Check out past polls.