LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices


Closed Thread
  Search this Thread
Old 02-16-2010, 03:40 PM   #301
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864
Blog Entries: 31

Rep: Reputation: 148Reputation: 148

@MTK358

The one with the guy talking about using Knoppix at his university isn't complete, but I'll post the rest of it:

Quote:
Originally Posted by Computer Stupidities
My instructor saw me and said, "What are you doing? That's not Windows! That's a VIRUS, isn't it? I'm going to report you for malicious use of school computers!" My advisor, who is a Linux proponent and also the sysadmin at the time, apparently laughed him out of his office when he went to complain.
Yes, if it's not Windows, it must be a VIRUS!

At least the sysadmin knew better

And 3 comments per line?? Ack!

Last edited by MrCode; 02-16-2010 at 03:43 PM.
 
Old 02-16-2010, 04:17 PM   #302
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by MrCode View Post
And 3 comments per line?? Ack!
Yeah, I find that code with alot of comments between lines of code (and most code I find is commented that way) is almost unreadable for me, because it's hard to tell apart comments and code for me that way.

I like it when every block of code is preceeded by a block of comments, and/or for every few lines to have a comment on the same line after the code.
 
Old 02-16-2010, 05:41 PM   #303
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Hi,

I remember when coding 1-2 solid code lines per day was the norm. That would be debugging and testing to insure the code was valid.

As for commenting code: I like to comment enough to refresh whenever I re-look at a piece days or even years later then I don't have to familiarize conditions or status within a code block. Even with good commenting I would sometimes need to work/look the code over again therefore good hinting does save time.

Old school coders still document and cannot understand why someone else doesn't. As for myself, I will document but only within the block not always by line unless the line has merit.

We used to have too write code tight. Today most coders don't, memory is cheap and the process is a lot faster. Most high level languages have made a lot of lazy programmers who don't care that much about tight efficient code. Some waste a lot of resource to details that could be addressed via a good coders toolbox. Which a lot of the coders today don't really maintain like older coders do or did.

 
Old 02-16-2010, 06:50 PM   #304
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
Quote:
Originally Posted by MTK358
Yeah, I find that code with alot of comments between lines of code (and most code I find is commented that way) is almost unreadable for me
Man, I hate that! It's done all too often with "example" code in tutorials (and/or example code with programs/APIs), probably so as to "explain each line as it's written".

Just give me the raw, uncommented code (or at least with very concise comments, no longer than about 4-5 words) and let me get the rest of the info from the tutorial text itself.

If that happens to me, either a) I'll delete the comments (assuming that's not where most of the tutorial text resides, ugh), or b) I'll just tune them out as best I can. I have blue italics for comments in gedit's syntax highlighting, which is easily tune-outable on a black background.

In fact, usually I'll re-type the code myself, manually, without the comments (if necessary).

Last edited by MrCode; 02-16-2010 at 06:52 PM.
 
Old 02-16-2010, 07:07 PM   #305
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Hi,

Quote:
Originally Posted by MrCode View Post
<snip>
In fact, usually I'll re-type the code myself, manually, without the comments (if necessary).
Ever heard of OCR & editor?

 
Old 02-16-2010, 07:25 PM   #306
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

Rep: Reputation: 203Reputation: 203Reputation: 203
blah

Last edited by damgar; 02-16-2010 at 07:26 PM.
 
Old 02-16-2010, 07:37 PM   #307
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
I like spare comments also.
1 + CPL make the code confusing.
 
Old 02-16-2010, 07:40 PM   #308
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by MrCode View Post
Man, I hate that! It's done all too often with "example" code in tutorials (and/or example code with programs/APIs), probably so as to "explain each line as it's written".
I agree 100%. Whenever I come across code like that in a tutorial and can't find a better tutorial, I copy the code into an editor and manually delete every single comment. Suddenly the code is very easy to understand! A great example of this is the GTK+ tutorial.

I really wonder what the hell people are thinking when they write those.

I also hate it when every second line of code is a comment explaining what the next line does. I see this in some "real" programs, not just tutorials.

Code:
Good:

/*
This is what
the following
block of code does.
*/

foo(); // explain what foo and bar do
bar();

Bad:

// foo does this
foo();
// bar does this
bar();
 
Old 02-16-2010, 07:46 PM   #309
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
I just remembered that a C example program that comes with Turbo C++
has a 400 line comment on top and atleast a comment evrey 3 lines.
 
Old 02-16-2010, 08:28 PM   #310
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Original Poster
Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
Quote:
Originally Posted by onebuck View Post
Hi,



Ever heard of OCR & editor?

No, what is it?? Otomatic Comment Remover?
 
Old 02-17-2010, 10:48 AM   #311
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Hi,

No, 'Optical Comment Remover'.
 
Old 02-17-2010, 01:47 PM   #312
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by onebuck View Post
Hi,

No, 'Optical Comment Remover'.
What's an "Optical Comment Remover"?
 
Old 02-17-2010, 03:27 PM   #313
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
@onebuck

The reason I tend to re-type the code is that sometimes I find I get a better understanding of what the code does if I simply type it out by hand; kind of like how when you write out your ideas, you tend to remember them better.

Plus which, I also get a slight feeling of guilt from just doing Ctrl-C Ctrl-V, so I also kind of change the variable/class/function names sometimes (while keeping the code consistent, of course). It helps me to learn the concepts behind the code, rather than just the code itself.
 
Old 02-17-2010, 06:46 PM   #314
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

Rep: Reputation: 203Reputation: 203Reputation: 203
Testing quick reply in newest chrome on slack

And now testing the edit.

Last edited by damgar; 02-17-2010 at 06:46 PM. Reason: testing edit on chrome
 
Old 02-17-2010, 07:02 PM   #315
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by MrCode View Post
@onebuck

The reason I tend to re-type the code is that sometimes I find I get a better understanding of what the code does if I simply type it out by hand; kind of like how when you write out your ideas, you tend to remember them better.

Plus which, I also get a slight feeling of guilt from just doing Ctrl-C Ctrl-V, so I also kind of change the variable/class/function names sometimes (while keeping the code consistent, of course). It helps me to learn the concepts behind the code, rather than just the code itself.
I tend to practice tutorials like that, too.
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gawk related issue scbops Programming 6 08-17-2007 10:45 AM
Help me diagnose this internet problem (DNS related) WebGraphics Linux - Networking 9 06-01-2007 11:33 AM
NFS related issue push19180 Linux - Networking 1 05-19-2006 07:36 AM
process related issue LinuxRam Linux - Networking 1 09-12-2004 04:24 PM
configure qt thread issue (just compiled qt w/ -thread option) cleff Linux - Software 8 05-07-2004 11:11 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > General

All times are GMT -5. The time now is 01:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration