Benjamin Jeeves wrote:

> Hi all
>
> This is what I have been work on over the weekend and a bit more and now it
> works so here it is. Please comment on it. As you might see I my develop a
> simple Intrusion Detection System I will be adding more signatures in time
> and there is a sensor for it that collects packets of the wire by using
> TCPDUMP Develop in Linux Mandrake and is for my dissertation for my degree in
> Computer Sceince from Brunel Uni.
>

Hi Benjamin,

If you are doing this for a dissertation, presentation will be important.  So also 
will be commenting.
It is not a bad idea to add a short comment for each variable you declare to indicate 
what role it
plays in terms of the whole.  You also should precede each function definition with 
comments
describing:
=> What input parameters the function takes
=> What, if anything, the function returns
=> What processing the function offers--what is its purpose
and describing each in precise terms

I was not really able to follow the flow of the code sufficiently to do
close checking on the logic.  You should read John's comments with some care.

Another thing that will help your presentation show up well on a wide variety of 
machines is to use spaces instead of tabs for indentation.  There are many good, free 
code editors available for both Windows and Linux  that will auto-indent with a 
specified number of spaces.  Since different viewers handle tabs differently, using 
tabs can look pretty wierd:

sub table
{
        # Connect to the database
        $dbh = DBI->connect ($dsn, $db_user, $db_password, { RaiseError => 1 });

                $createcode[0] =
                        "CREATE TABLE connect (" .
sort of scrolls off the sreen on my mail reader.

You also will absolutely need to exercise more care in your prose, particularly 
capitalizing the first
letter of a sentence, and placing a period at the end,  Without this, it is highly 
unlikely that your code
will ever be seen.  Without clear written expression, dissertations tend to be 
rejected out of hand.
This may seem off-topic in a programming discussion, but it is not.

A programming language is just that--a language.  Like written prose, it requires some 
precision.
Also like written prose it has rules concerning what constitutes a statement.  Unlike 
written prose,
there is no human intuition on the other end to fill in the blanks for you.  Your 
professors will look
not just at whther your code can get a certain job done.  They will look even more 
closely at
whether you can articulate how and why the code works.

Joseph




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to