Become a fan of Slashdot on Facebook

 



Forgot your password?
typodupeerror
×

Comment Re:Terrible, Terrible, Headline (Score 1) 154

You cannot prove that parallel lines do not intersect purely by using geometry. You cannot prove 1+1=2 using math. The former is treated as an axiom, a statement that is intuitively assumed to be true in further proofs. The latter is a definition of terms - given what 1, 2, addition and equality are defined as, the statement is true.

The former is not treated as an axiom it is an axiom and as such it cannot be proven in any system. The latter can indeed be proven if you step outside of the bounds of algebra (which is a field of mathematics that covers addition) and into the bounds of set theory where we have a definition for 1 and a definition for 2 and a definition for the process of addition and using those three definitions we can indeed prove that 1 + 1 = 2. In algebra we would define the addition of our system such that 1 + 1 = 2 at which point it is treated as an axiom. To be clear there are systems where 1 + 1 != 2 (boolean algebra) but we can assume you knew that and were specifically discussing integer arithmetic.

Comment Re:Remember (Score 1) 633

At least in the USA utility companies while often technically not public are basically public entities and denying citizens a right to electricity (in the USA it's actually mandatory for the most part) would probably violate their charter. Now I understand that the GP may be from a different country with different laws but here at least that would be a violation of basic liberties.

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

Living on Earth may be expensive, but it includes an annual free trip around the Sun.

Working...