| « Prev | Page 1 | Page 2 | Page 3 | Page 4 | Next » |
|
makeString2 is indeed redundant.
|
|
If you measure software in the number of Pieces Of Software (POS) that's exactly what you get.
|
|
Are you kidding me? WTF!
|
|
You start paying by the line, you're gonna get more lines. What do you expect?
|
|
Are you seriously trying to pass this off as production code? That's first week of first semester of programming class mistakes (for those that have never looked at code prior to taking the class).
|
Re: Units of Software
2011-04-21 09:16
•
by
Some guy
(unregistered)
|
It uses a completely different code path! |
|
The optimist in me says this is fake, no one could possibly do this.
The realist says I have met people capable of this. |
|
Reading this article caused me to make poo.
Clearly the more elegant solution would account for all future needs: Public Function makeTypeObject(Of t)(ByVal arg As t) |
|
Reminds me of the manager whose metric was a ratio of number of defects to lines of code. He offered a bonus to the programming staff if they could get the ratio below a certain threshold.
The programming staff worked one weekend to attack the problem. They inserted blank lines between all lines of code; in effect, they cut the ratio in half. The manager was pleased with the result and convinced himself that he was a management genius. |
|
We can do better guys.
Public Function makeBoolean(ByVal b As Boolean) (I don't actually know VB, so I might have mixed some c# in there, but who cares if it's valid syntax. It's more lines!) |
|
Not paid to argue
Are you not having weekly defect prevent meetings, where you do peer review of code? |
Re: Units of Software
2011-04-21 09:28
•
by
Dan
(unregistered)
|
If the policy resulted in programmers actually commenting their code that would have been genius (provided they were real comments). |
|
Clearly Visual Basic does implicit type casting for such calls, and this is just a weirdly convoluted way of explicit type casting.
|
|
It is possible that the functions listed here are for the explicit purpose of creating new references, though it wouldn't be required for the value types and it would not work properly for the strings (due to interment).
|
|
I don't know, the MakeULong function might be useful. If it really works, that is.
|
Re: Units of Software
2011-04-21 09:33
•
by
anon
(unregistered)
|
If it takes a team of programmers an entire weekend to add blank lines to their code, they're probably not the greatest programmers. Also, I know of nothing that includes blank lines when counting LoC. So basically, I'm pretty sure your story is bullshit. |
|
I get emails advertising that makeULong function every day. It must be good code.
|
Re: Units of Software
2011-04-21 09:35
•
by
Larrik
(unregistered)
|
It took a whole weekend to add line breaks to the source code? Now THAT is a WTF! |
|
Shouldn't those be static functions? I think that's "Shared" in vb.
|
Re: Units of Software
2011-04-21 09:38
•
by
Larrik
(unregistered)
|
That's easy, don't count LoC. Just count line breaks. I'm sure it'd easy to get that past this "manager". |
|
what about this instead of empty lines (added benefit: it makes the program run for longer, so it must be doing mode things, mustn't it!):
system ('echo "$random_string" >/dev/null'); captcha: genitus (genial I knew it..) |
Yes. Yes we are not having those. |
Re: Units of Software
2011-04-21 09:44
•
by
anonymouser
(unregistered)
|
I work with a bunch of Indian contractors; so, I have no peers. |
Re: Units of Software
2011-04-21 09:46
•
by
Option Strict, Please
(unregistered)
|
Except that the return from all of these functions is of type Object |
|
Public Function makeFristComment(ByVal u As Comment)
Return frist End Function Public Function makeRegularComment(ByVal u As Comment) Return embededSystem End Function |
Re: Units of Software
2011-04-21 09:47
•
by
pussywhipped
(unregistered)
|
I think I'm going to cry. |
|
Assert#1: in C, LoC is measured by ";".
Rule #2: ";" by itself is a no-op. Silly Target: double number of LoC. Solution: 1. duplicate each ";" which ends a LoC (beware of actual ";" in text) 2. ... 3. Profit |
Re: Units of Software
2011-04-21 09:49
•
by
gogol
(unregistered)
|
|
fixed
|
|
These would get more effective (or possibly break everything forever if) you moved the right parenthesis a bit leftward.
|
Re: Units of Software
2011-04-21 09:49
•
by
pussywhipped
(unregistered)
|
As a peer reviewer, I am a peer. I will prove it by peeing all over it. |
Re: Units of Software
2011-04-21 09:50
•
by
blarg
(unregistered)
|
It took them a whole weekend to do something which a s/\n/\n\n/ style regex could have done in seconds? Regardless.. the issue you highlight is exactly why people start using function point counts rather than line counts for their metrics, and this in turn is what drives people to do things such as this particular WTF |
No wonder poor quality of code. |
|
In VB 6 this was the only way of doing casts, apart from creating another variable in the body of the code.
|
|
It's a bit like a piece of serial music.
It goes: "diddle-diddle-diddle-diddle-diddle-diddle-diddle-diddle-diddle ..." for ages, then suddenly does: "diddle-diddle-doodle-diddle ..." and then goes back to "diddle-diddle-diddle-diddle ..." Utter genius. |
If you do it in seconds, the manager will get suspicious of the huge improvement in the metric and start digging for details. If you bring the whole department in to work on it for the weekend, the 50% reduction in errors per line looks at least plausible. The manager doesn't need to know that the 60 hours of overtime he paid out was 2 minutes of writing replace scripts and 59 hours and 58 minutes of playing Quake. |
The real WTF is that there are known defects in the code which are not being addressed. You can drastically reduce the number of defects in the code by fixing them when they come to light. Call me boring and old-fashioned but if (as that manager) I were to find what had been done (and if it were me, I would) then heads would roll. Granted, I would not use this metric in the first place, but that's not the point. |
|
I love makeString2 :)
|
|
Someone told me this WTF had a cast of thousands.....I had no idea.
|
Re: Units of Software
2011-04-21 10:22
•
by
just me
(unregistered)
|
There, I Pink Floyded that for you... |
Re: Units of Software
2011-04-21 10:22
•
by
Your Name
(unregistered)
|
No, that is the point. If you are the sort of manager that uses useless metrics of the "defects per KSLOC" sort, you are likely also the sort of manager who won't look too closely (or even know how to look) at what your reports did to meet your useless metric. |
Certainly you can't expect Marcus to point out the obvious asininity of this code in a formal peer review. He's sure to be labeled "that guy who hates on everyone else's code", and then he won't get invited to parties. Yep, better to keep his mouth shut. |
|
DirectCast()
Frist time I've been hit by Akismet. Am I now "one of the guys"? |
marcus should do job with complete and total dedication. maybe he rise up and above in organization. |
|
Everyone knows that more lines of code makes the software better, more stable and faster and more maintainable and ... well it is just better, Okay!
|
Akismet love to hit me daily. In every post I make, I offer a small sacrificial post to Akismet. |
Love sarcasm comment here. |
|
This reminds me of a story from a former boss. In his days working for a large defense contractor, management followed the well trodden, broad path (and we all remember where that path paved with good intentions leads, right? :-) ) to counting lines of code. However, they wanted to add a level of sophistication to the count. Since:
and
are equivalent modulo formatting, they wanted to find a LOC metric that considered those equivalent. The method they hit on was counting semicolons (since this was C). Subsequently, the development team's productivity soared... until the first external code review, which revealed that statements like the above had been replaced by the syntactically correct:
So much for that metric. |
What you do is, you put your criticism in a sh*t sandwich. Nice tasty complimentary (and ultimately non-nourishing) piece-of-bread comment to start with "What wonderfully neatly laid out code this is! I approve!" Then give the sh*t: "... but surely we can accomplish this in an even more streamlined and enterprise-friendly manner by deleting the entire module." Then the nice tasty complimentary (and ultimately non-nourishing) piece-of-bread comment to end with: "And how wonderfully bug-free it seems to be - no doubt it passed all its unit tests? Can we see the unit tests?" You'll be rocketing up the promotion chain so fast you'll achieve escape velocity. |
|
I know very little about VB / VB.NET, so could someone explain how this isn't largely equivalent to a) casting (e.g. (unsigned long) x); or b) forcing a type for an integer literal (e.g. 42lu); in C?
|
Re: Units of Software
2011-04-21 10:39
•
by
cheap nfl trolls
(unregistered)
|
For this comment, inspired me, feeling this author words into my heart. |
| « Prev | Page 1 | Page 2 | Page 3 | Page 4 | Next » |