Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×

Comment Re:Not surprising... (Score 1) 78

Just an addition a book is typically on the order of tens of thousands of sentences why on earth would I remember a single sentence? Hell to remember the specific sentence that they chose to use would be a 1/10000 chance without perfect eidetic memory. So many things wrong with even thinking of this study it makes my brain want to explode.

Comment Re:Different subjects (Score 1) 78

Well I was going to post almost exactly this but I couldn't have worded it as well. I have hundreds of books in my brain but I don't remember a single sentence from most of them but I could usually give you a meaningful summary just from the name of the book (series excluded they tend to blend into a single summary to me).

Comment Re:Tell him to write goddamn login page himself? (Score 1) 507

As for "Save data ... set...", that's an excellent example of what I could consider a bad comment, even if the code still agreed with it. If the saving process involves several lines then sure "Save data..." might make a good section header, but "set..." is going into exactly the wrong kind of detail - it's the sort of thing that's hopefully apparent from reading the code, is prone to change with the implementation details, and tells you absolutely nothing about *why* it is being marked dirty in the first place, which depending on context may be non-obvious information.

I might have a better impression of comments if I had ever seen a good one but the code base I work in now is clean enough that they're often unnecessary but conspicuously absent when needed.

Comment Re:Tell him to write goddamn login page himself? (Score 1) 507

You go ahead and just read the code then - I can read five words a LOT faster than five lines of code, and the code only tells you *what* is being done, not *why*. A brief statement of intent can save you a lot of work reverse-engineering the code to extract it's purpose.

I find about 20-30 lines of code per function/method to be about right with descriptive naming you can gather the why from the context and the how from the code. It also allows you to skim the code for function names which if properly descriptive can be guessed at least approximately without prior knowledge. If your code goes above that 20-30 lines (for a good reason they do exist) then comments become more useful as delimiters. I am quite sure there are times my advice is not applicable but for most cases (50% + some epsilon > 0) refactoring would be the better option.

Ugly code is still obviously where most of the comments live, precisely because you (err, I mean the *next* guy, obviously) probably will need help understanding *what* is being done. For the same reason those comments tend to be the least helpful over time unless everyone who modifies the code is really anal about updating the comments to reflect their code changes.

Sad fact is that every time I've wanted to see a comment in code there wasn't one and almost every comment I've ever seen in code referred to code that was no longer there or was in fact wrong (Save data to database set isDirty flag to true WTF???).

Comment Re:Arsehole (Score 1) 1051

"Negative Reinforcement >> Positive Reinforcement" Two issues with this. 1) They are both instances of Negative Reinforcement. 2) Negative Reinforcement is less stable than Positive Reinforcement in that Negative Reinforcement gets the receiver to avoid the Negative Reinforcement while not necessarily moving towards the desired goal while Positive Reinforcement leads the receiver to seek more of it which means accomplishing the desired goal. Since Linus' goal was to avoid userland bugs then his response was indeed on the correct side whether or not one agrees with his wording. TL;DR If you want someone to do something use Positive Reinforcement if you want someone not to do something use Negative Reinforcement.

Slashdot Top Deals

Chemist who falls in acid is absorbed in work.

Working...