Which do you prefer?

  • Thread starter Master Programmer
  • Start date
R

RobinS

Um, I don't name it X or Y, it's just an example. Please don't make
me look through the 50,000 lines of code in the last project I wrote
to find the perfect example.

Robin S.
 
R

RobinS

It *does* help if he has more than average knowledge, but I
don't like to assume that whoever comes along behind me *does*.
Plus, why should the poor guy have to spend extra time figuring
it out, when I can just put in a comment for him?

Also, frequently it's a business-rule kind of thing, that's
not documented anywhere for the programmer. While I *love*
to get written business requirements from my clients, I rarely do.

The specs for the last application I wrote were in the form
of a bunch of fields written on a piece of paper torn out of
a spiral notebook with the instructions "These are in three
different applications that we use, can you please figure out
how to get only *our* data out of those applications, for
only these fields, and put them in a central repository for us?"

I like to leave external documentation behind with my finished
applications (in this case, I documented the database/table/fieldname,
and in most cases, the query used), but that's not always possible.

To each their own, I just like to leave a helping hand to
whoever comes along behind me. It only takes me a few seconds.
(I type 100+ wpm).

Robin S.
 
R

RobinS

All I have to say is this: you must not write anything
very complicated.

Robin S.
--------------------------------------------
 
C

C-Services Holland b.v.

Master said:
No code should EVER need one single comment if it is written properly.
It should be easy to follow without ANY explanation needed. If your
code needs comments to describe it then I suggest you go back to
school.

The Grand Master

I disagree. Complex patterns need comments. In that explain what the
code does and why a certain method is chosen. A comment of 2 or 3 lines
can perfectly explain what code of multiple pages does. It certainly
helps maintaining the app especially if another person needs to go in
and add/change stuff in there. For instance I've used comments to
indicate why I chose a particular way of doing stuff because some quirk
in a programming language made it impossible to do it the obvious way.
That prevents someone going in in the future and changing it only to
find out the obvious way doesn't work.

For small routines consisting of just a few lines I agree it's not
always really nescesarry, but for big complex things not using comments
is just bad for future maintainence
 
R

rowe_newsgroups

I'm fairly new to programing, though I have been in the computer industry
That shows. Go off and spend a few years learning how to program then
come back with some useful comments. In the meantime shut your
cake-hole.

Welcome to the newsgroup Bruce! I'm sure this goes without saying, but
this guy is nothing more than a wannabe programmer who gets a rush out
of flaming others. So believe it or not your opinions are welcome here,
dispite what this "Master Programmer" says. I promise - most of us here
are nice :)

Oh and Master Programming, if you want to prove you're not a wannabe
please provide us with some proof - perhaps posting your real name, and
some projects and companies you've worked on/for would help. As for
right now all you are is talk, and nothing else.
Good code is easy to read - bad code needs comments - end of story

You know, I would love to see how you pull this off when dealing with
complex problems. Again, do you even have any of your source code
published anywhere that we could take a look at? And I don't mean small
"Hello World" programs or database frontends, I want to see something
complex - something that we meager programmers would "need" to use
comments for.

As far as my opinion on the issue, I dislike using comments inside my
routines, and use them only sparingly (like complicated loops or some
API calls). Placing comments inside the procedure itself (imo) makes it
hard to follow whats going on in the code (mainly from switching from
the code reading mindset to the english reading mindset) To me, using
the '''<Summary>...></Summary> tags on any routine that does something
out of the ordinary is a great way to let others (or yourself 6 months
later) know immediately what the purpose is.

Any programmer can figure out any code if he/she is given enough time.
If that same programming is given good comments they will be able to
figure that same code in much less time. This is what comments are for
- they are not excuses for bad code, they are for getting others up to
speed on the code faster. Why would you force someone to read through a
page of code to figure out what is going on when one or two lines of
comments code explain it? The time saved in not reading through the
page of code is more enough reason to include well structured comments.

Thanks,

Seth Rowe
 
A

aaron.kempf

Michael;

I disagree

Master Programmer is always right.. haven't you guys seen the pattern
so far?

We forecasted just a week ago-- this new press release about how VB.net
usage is down 30%

they're going to kill it off soon; C# won the war.. MS officially
killed the worlds most popular language.

I heard it from a friend that works at MSFT

-Aaron
 
T

Tim Patrick

The Top 10 Misconceptions about Commenting and Style (from The Visual Basic
..NET Style Guide)

1. Comments are extraneous since you can always understand the logic by looking
at the code.
2. Indenting just wastes disk space.
3. I don't have time to add comments.
4. What does it matter how sloppy the code is? I'm not selling the source
code.
5. Adding comments doesn't make the code run any better.
6. Hey man, don't bother me. This is my trademark coding style.
7. I comment every line of code. It makes the program so readable.
8. If there's a bug, I'll be able to fix it. It's not like I'm going to forget
what this function does.
9. I'll go back later and add in the comments.
10. It's job security. If others can understand my code, they don't need me.
 
A

aaron.kempf

Tom

if you're a commie ****ing bastard and you like C# then get the ****
out of our newsgroup

-Aaron
 
R

RobinS

It's not your newsgroup. You said you're doing PHP, not VB.Net.
So by your own definition, *you* should leave.

Robin S.
-----------------------------------
 
T

The Grim Reaper

Complicated?!?!
I'd go so far as to say he can't even type and everything you've been
reading here was dictated to his mum.
 
A

aaron.kempf

you can't discredit people-- just because they disagree with you.

VB.net has officially been retired.

why are we still in a newsgroup called VB.net?

VB 2005 is a complete failure in the open market.
THE LANGUAGE IS _STILL_ TOO VERBOSE.

MS needs to go back to the drawing board; VB is neither Visual or
Basic.

They need to either rename the language 'B#' or 'VB#' in order to show
that they still love VB half as much as we do.

-Aaron
 
H

Herfried K. Wagner [MVP]

Master Programmer said:
No code should EVER need one single comment if it is written properly.
It should be easy to follow without ANY explanation needed. If your
code needs comments to describe it then I suggest you go back to
school.

Basically I tend to agree. Code should IMO be readable (which means that
the reader can reconstruct its meaning) without any comments, but comments
should support the reader by making understanding the meaning of the source
code easier.
 
R

RobinS

you can't discredit people-- just because they disagree with you.


And yet, that's what you do every single time you post one of
your caustic messages in this newsgroup.
VB.net has officially been retired.

Only in your tiny little mind.

Robin S.
 
R

RobinS

LOL. Loved #2.

And if you delete some of those files on your computer,
it won't weigh as much. (attribution: Scott Adams)

Robin S.
----------------------------------
 
R

RobinS

Well, yeah, that's a good point. Silly me. Now I'm acting
like Robinson and arguing with a grapefruit.

Robin S.
(*not* to be confused with Robinson or Tim Patrick
or Francesca Balena or Brian Noyes or Bill Gates or
Larry Ellison)
-------------------------
 
R

RobinS

Hmmm. He seemed to be speaking pretty good English.
Are your glasses up-to-date?

Robin S.
--------------------------
comments are unnecessary

speak english or die

-Aaron
 
T

Tim Patrick

I worked with a lady who wrote to Scott Adams the idea about "smaller font
sizes taking up less disk space." She got a "thanks for the idea" letter
back from Adams and a preview copy of the panels for that particular Dilbert
strip, which she prized.
 
R

RobinS

Wow, that's so cool.

My only Scott-Adams-claim-to-fame is I worked across the street
from where he worked (Pacific Bell), and in the middle of layoffs
(at our company), we e-mailed him and asked if we could take him
to lunch (it was before he was *quite* as popular), and he consented.
It was cool. He was really nice; signed all our books. :)

Robin S.
------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top