Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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.

In reply to Re^3: Rewriting some code by tadman
in thread Rewriting some code by Fingo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-04-23 18:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found