|
Oh, yes. These types of things happen far too often in 'real' code bases. And I don't think there's any way you could 'rename your variables' to get around it. People just need to let people write comments. Without comment.
TTFN - Kent
|
|
|
|
|
Kent Sharkey wrote: People just need to let people write comments. Without comment.
It is easy:
// No comment
Geek code v 3.12
GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- r++>+++ y+++*
Weapons extension: ma- k++ F+2 X
I use 1TBS
|
|
|
|
|
I didn't really read the whole article yet. But already the first refactoring suggestion is already completely wrong.
The author suggests renaming path to validatedFullPath but if you have to check if the value is null, then it is NOT validated and therefore the name is wrong.
To be fair, the code itself isn't great in that regard either, as the comment itself says that the value inside the string should already be a valid value and then still checks for null . It would have been easier to understand to if they'd throw an ArgumentNullException when checking the value for null , as it clearly shouldn't be null it the first place. I, however, don't know how this method is used, and therefore can't really tell if that's a valid assumption. Of course, refactoring it this way would change the behaviour of the code ...
|
|
|
|
|
Kent Sharkey wrote: Comments aren't stupid, people are stupid
Comments don't kill people. People with comments kill people
How do you know so much about swallows? Well, you have to know these things when you're a king, you know.
modified 31-Aug-21 21:01pm.
|
|
|
|
|
Also a very good example of how not to apply refactoring.
He actually makes the code more complex and less efficient just to avoid comments. Not a great lesson.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
Yes, because it's soooo much easier to find a "pertinent word" (which might not be so informative as the coder thinks) that's hidden in one of the 83,000 25-character, camel-case identifiers than it is to spot a highlighted comment.
Typing five to ten words is not hard, guys!
Just do it!
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
As long as it's the why, not the what or how.
#SupportHeForShe If your actions inspire others to dream more, learn more, do more and become more, you are a leader.-John Q. Adams
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
Only 2 things are infinite, the universe and human stupidity, and I'm not sure about the former.-Albert Einstein
|
|
|
|
|
It can certainly be the "what you need to do before using this" or the "how to use it", just not the "what it is" or "how it works".
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Sure, absolutely, that's valid. I always cringe when I see:
int i;
i = 5;
#SupportHeForShe If your actions inspire others to dream more, learn more, do more and become more, you are a leader.-John Q. Adams
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
Only 2 things are infinite, the universe and human stupidity, and I'm not sure about the former.-Albert Einstein
|
|
|
|
|
Not half.
If I had a penny for every time I've seen things like:
init;
I'd have a lot of pennies.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
yep, that too. grr...
#SupportHeForShe If your actions inspire others to dream more, learn more, do more and become more, you are a leader.-John Q. Adams
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
Only 2 things are infinite, the universe and human stupidity, and I'm not sure about the former.-Albert Einstein
|
|
|
|
|
Have you ever used JavaDoc (for Java, obviously) or Doxygen (for C*)?
Anyone who has, and has therefore seen what an incredibly valuable resource they are, would never suggest that commenting is stupid.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
True. But that's not the sort of comments that are being complained about.
#SupportHeForShe If your actions inspire others to dream more, learn more, do more and become more, you are a leader.-John Q. Adams
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
Only 2 things are infinite, the universe and human stupidity, and I'm not sure about the former.-Albert Einstein
|
|
|
|
|
I think I'll just start spamming* "don't throw the baby out with the bathwater", every time I see a discussion about it.
* "Spamming" in the gaming sense, not the e-mail one
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
I always comment like this:
[100K lines of code here]
|
|
|
|
|
Ah!
Now I understand what "functional programming" is!
... Because that'd sure work!
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
I will not be baited...I will not be baited...
cheers
Chris Maunder
|
|
|
|
|
We are happy to announce the release of ReSharper C++ — a new product specifically targeted at modern C++ developers. Now the ++ folk can enjoy the magic tool
|
|
|
|
|
I never used ReSharper (I'm not a C# developer).
It looks like a souped up Visual Assist.
What would be the selling point of ReSharper ?
I'd rather be phishing!
|
|
|
|
|
Historically Resharper and Visual Assist offered the same sort of make VS better capabilities; differing only in that one did .net the other c++. Re#er is now trying to muscle into VA's territory. I suspect the main advantage would be that it would have more or less the same set of menus/options/configuration dialogs in supporting both languages. That's probably more beneficial for a polygot developer trying to reduce the number of tools he has to use or a .net developer moving into C++. Since the latter describes my current status (I've got ~800 hours updating an ancient MFC app scheduled to start midyear) I'm going to try and pry a copy of it out of corporate IT.
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
For its price of $229, I could just chip in $40 more to get visual assist which include C++ and C#.
|
|
|
|
|
That's the enterprise license cost. For an individual developer license (which gives you the right to install it on your home machine and your work machine), you can get ReSharper Ultimate for $249. That includes C#, C++, (God Forbid) VB, along with dotCover (.net unit test coverage), dotMemory (.net memory profiler), and dotTrace (.net performance profiler). If you're a .net dev, it's a decent little package.
|
|
|
|
|
"OK Google" voice commands can get authorization from the sound of your voice. "Hello, computer?"
|
|
|
|
|
Kent Sharkey wrote: "Hello, computer?" Dave, this conversation can serve no purpose anymore. Goodbye.
|
|
|
|
|
Kent Sharkey wrote: "Hello, computer?"
A favorite scene of mine.
Marc
|
|
|
|