Comment On Should Be Enough

“It seems every other week,” Samuel writes, “there’s a story about outsourcing gone bad. Maybe we’ve been lucky, but for the past decade or so, we simply couldn’t have survived without our friendly team of offsite developers.” [expand full text]
« PrevPage 1 | Page 2 | Page 3 | Page 4 | Page 5Next »

Re: Should Be Enough

2010-03-15 09:03 • by Brian (unregistered)
This looks like my old company...Big Yellow?

Re: Should Be Enough

2010-03-15 09:06 • by a programmer (unregistered)
did you nobulate your probeility properly?

Re: Should Be Enough

2010-03-15 09:08 • by Keloran (unregistered)
for (comments as comment):
for (comment as commen):
for (commen as comme):
for (comme as comm):
for (comm as com):
for (com as co):
for (co as c):
if (c == 1):
return frist;
else:
return not enough obviouslly;
endif;
endfor;
endfor;
endfor;
endfor;
endfor;
endfor;

Re: Should Be Enough

2010-03-15 09:09 • by frits
Certainly their best developer must know about recursion--


or Directory.Delete().

Re: Should Be Enough

2010-03-15 09:11 • by Raedwald
Everyone knows recursion is dangerous. Ask a FORTRAN programmer, they have to attach "warning, contains recursion!" signs to every function that directly or indirectly calls itself.

Re: Should Be Enough

2010-03-15 09:12 • by Alex (unregistered)
on the other hand, these developers should try "developing" for embedded systems- no filesystem, no directories, no need for deletes...


Alex

Re: Should Be Enough

2010-03-15 09:13 • by So Easy A Caveman Could Do It (unregistered)
The usual joke is that early man counted "one, two, many". After much education, many of us could count indefinitely and not tire. It's interesting to imagine whether that actually works against us: there's something for developers who know that, after two or more levels, you may as well generalize to "many".

Re: Should Be Enough

2010-03-15 09:18 • by ClaudeSuck.de (unregistered)
Not everybody knows recursion

Re: Should Be Enough

2010-03-15 09:18 • by Steve the Cynic (unregistered)
302220 in reply to 302218
So Easy A Caveman Could Do It:
The usual joke is that early man counted "one, two, many". After much education, many of us could count indefinitely and not tire. It's interesting to imagine whether that actually works against us: there's something for developers who know that, after two or more levels, you may as well generalize to "many".

I guess that makes our interesting number sequence: zero, one, many.

Re: Should Be Enough

2010-03-15 09:25 • by Resuna (unregistered)
302221 in reply to 302219
ClaudeSuck.de:
Not everybody knows recursion

1. If you don't know recursion you shouldn't be working as a software developer.

2. This doesn't actually need recursion, you can maintain a directory stack manually.

Re: Should Be Enough

2010-03-15 09:26 • by Bosshog (unregistered)
302222 in reply to 302220
Steve the Cynic:
So Easy A Caveman Could Do It:
The usual joke is that early man counted "one, two, many". After much education, many of us could count indefinitely and not tire. It's interesting to imagine whether that actually works against us: there's something for developers who know that, after two or more levels, you may as well generalize to "many".

I guess that makes our interesting number sequence: zero, one, many.

FILE_NOT_FOUND

Re: Should Be Enough

2010-03-15 09:27 • by kjordan (unregistered)
Interesting in the "// should be enough; if not, I can add more here" that if there are directories there he didn't even do anything with those.

Re: Should Be Enough

2010-03-15 09:27 • by mike5 (unregistered)
302224 in reply to 302220
Steve the Cynic:
So Easy A Caveman Could Do It:
The usual joke is that early man counted "one, two, many". After much education, many of us could count indefinitely and not tire. It's interesting to imagine whether that actually works against us: there's something for developers who know that, after two or more levels, you may as well generalize to "many".
I guess that makes our interesting number sequence: zero, one, many.
No, no, no! Zero came much, much later...

Re: Should Be Enough

2010-03-15 09:27 • by Peanut (unregistered)
WOW!

Thats amazing. Someone actually paid for this code?

Recursion is where this task should be.

Re: Should Be Enough

2010-03-15 09:28 • by Cad Delworth
302226 in reply to 302218
So Easy A Caveman Could Do It:
The usual joke is that early man counted "one, two, many".

Actually, there is still a VERY remote tribe somewhere in the world (I forget exactly where, without looking it up) who still do count in that way.

Re: Should Be Enough

2010-03-15 09:30 • by Anon (unregistered)
Recursion

re.curs.ion

Definition:

See recursion

Re: Should Be Enough

2010-03-15 09:31 • by True that (unregistered)
Two words...

Code reviews.

Trot that pony out in front of the whole development team (in fact, the whole team should be trotting their ponies out at a regularly scheduled meeting) as a change to redirect, refactor and (sadly enough) educate even your best developer.

Captcha: delenit (timely that)

Re: Should Be Enough

2010-03-15 09:31 • by mk (unregistered)
302229 in reply to 302220
Steve the Cynic :
I guess that makes our interesting number sequence: zero, one, many.


I don't know if you are joking, but I was taught, and believe, that "zero, one, many" is a very good design principle.

Re: Should Be Enough

2010-03-15 09:33 • by Spudley (unregistered)
302230 in reply to 302219
ClaudeSuck.de:
Not everybody knows recursion


Yes. That's because not everyone knows about recursion. (see above)

Re: Should Be Enough

2010-03-15 09:33 • by True that (unregistered)
302231 in reply to 302228
True that:
Two words...

Code reviews.

Trot that pony out in front of the whole development team (in fact, the whole team should be trotting their ponies out at a regularly scheduled meeting) as a change to redirect, refactor and (sadly enough) educate even your best developer.

Captcha: delenit (timely that)


Oh bugger... make that chance, not change. More coffee!!

Re: Should Be Enough

2010-03-15 09:33 • by t3knomanser (unregistered)
302232 in reply to 302226
Not technically true. That's how they talk in regular conversation, but they actually do have a real counting system. It's just the anthropologists trying to learn their language didn't ask the right questions.

Re: Should Be Enough

2010-03-15 09:33 • by toth
Good for him. Recursion is for pussies.

Re: Should Be Enough

2010-03-15 09:34 • by t3knomanser (unregistered)
Also, I should point out:

To properly understand recursion, one must properly understand recursion.

Re: Should Be Enough

2010-03-15 09:34 • by TheRealWTF (unregistered)
302235 in reply to 302232
The real wtf is that the company apparently doesn't know the difference between outsourcing and offshore outsourcing.

Re: Should Be Enough

2010-03-15 09:35 • by arnemart (unregistered)
302236 in reply to 302226
Actually, there are several tribes that still count like this, and one, the Pirahã, don't even have words for "one" and "two" (just for "small amount", "slightly larger amount" and "large amount"). (Source)

Re: Should Be Enough

2010-03-15 09:36 • by Pot-ah-to Pot-ay-to (unregistered)
302237 in reply to 302221
Recursion is using an implicit stack. You can always maintain a stack manually instead of using recursion. What's the difference?

Re: Should Be Enough

2010-03-15 09:37 • by frits
302238 in reply to 302233
toth:
Good for him. Recursion is for pussies.


Or in this case, recursion is for Java.

Same thing.

Re: Should Be Enough

2010-03-15 09:37 • by arnemart (unregistered)
302239 in reply to 302236
arnemart:
Actually, there are several tribes that still count like this, and one, the Pirahã, don't even have words for "one" and "two" (just for "small amount", "slightly larger amount" and "large amount"). (Source)

Talking about "one, two, many" -- I hit "reply" instead of "quote".

Re: Should Be Enough

2010-03-15 09:38 • by zedhex
302240 in reply to 302219
ClaudeSuck.de:
Not everybody knows recursion


They do in places where your Aunt is your sister. But maybe small town hicks have trouble applying it to abstract concepts.

Re: Should Be Enough

2010-03-15 09:38 • by recursive ClaudeSuck (unregistered)
302241 in reply to 302219
ClaudeSuck.de:
Not everybody knows recursion


Not everybody knows recursion

Re: Should Be Enough

2010-03-15 09:38 • by t3knomanser (unregistered)
302242 in reply to 302237
Well, he was maintaining his stack in static code instead of a data structure. That's a problem if the depth of the environment ever changes.

Re: Should Be Enough

2010-03-15 09:38 • by Steve the Cynic (unregistered)
302243 in reply to 302229
mk:
Steve the Cynic :
I guess that makes our interesting number sequence: zero, one, many.


I don't know if you are joking, but I was taught, and believe, that "zero, one, many" is a very good design principle.

I *was* joking, but I agree completely with you.

Well, on this point, anyway.

Re: Should Be Enough

2010-03-15 09:44 • by David (unregistered)
The real WTF is ditching outsourcing because it has a 'bad rep'. If it works for you, don't change it.

Re: Should Be Enough

2010-03-15 09:45 • by topcat_arg
If that is your best programmer I can send you a Resume!!!

This hurts on a monday morning...

Re: Should Be Enough

2010-03-15 09:46 • by anon (unregistered)
Every business is owned or subsidized by the company? Where does he live, Naples?

Re: Should Be Enough

2010-03-15 09:46 • by Ray Stevens (unregistered)
302247 in reply to 302240
zedhex:
ClaudeSuck.de:
Not everybody knows recursion


They do in places where your Aunt is your sister. But maybe small town hicks have trouble applying it to abstract concepts.


I'm my own Grandpa!

Captcha: sagaciter

Indeed.

Re: Should Be Enough

2010-03-15 09:48 • by Ikkonoishi (unregistered)
Recursion isn't even needed here.

FileInfo[] files = dir.GetFiles("*", SearchOption.AllDirectories);
foreach(FileInfo file in files)
{
file.Delete();
}
DirectoryInfo[] subDirs = dir.GetDirectories("*", SearchOption.AllDirectories);
foreach(DirectoryInfo subDir in subDirs)
{
subDir.Delete();
}

Re: Should Be Enough

2010-03-15 09:52 • by frits
302249 in reply to 302248
Ikkonoishi:
Recursion isn't even needed here.

FileInfo[] files = dir.GetFiles("*", SearchOption.AllDirectories);
foreach(FileInfo file in files)
{
file.Delete();
}
DirectoryInfo[] subDirs = dir.GetDirectories("*", SearchOption.AllDirectories);
foreach(DirectoryInfo subDir in subDirs)
{
subDir.Delete();
}


Indeed:
Directory.Delete(Path, true);




(BTW- Both of these solutions use recursion at the library level)

Re: Should Be Enough

2010-03-15 09:59 • by HurrDurr (unregistered)
Holy crap. All the people who say "recursion" in this thread need to get fiiiiiired. Or their own WTF entry.

FRAMEWORK.

Directory.Delete (like the few have mentioned) or more properly create a random directory in the system provided TEMP directory and let the system delete it.

RE: Should be Enough

2010-03-15 10:03 • by Consultuning (unregistered)
Actually, this is the kind of situation that worries me when the latest generation of programmers get to work under the new "agile" methodologies. YAGNI (you're not going to need it) advocates them just to solve the problem at hand and don't bother with abstractions or generalizations.

In this case, the programmer could have been working with a specification that called for no more than, say, three nested folders. Who can blame him/her for not implementing a more general solution? He runs into the risk of someone pointing at the beatiful, generic solution and yell "YAGNI"

On the other hand, a solution that specifices that this has to work for an undefined number of nested folders is not going to be understood by business folks anyway. Recursion is hard enough to understand for the average programmer, let's not even talk about explaining it outside the programming world.

I'm not saying that "agile" is bad whatsoever, just that it does have its own drawbacks, and this is one of them. Too much focus on pragmatism can potentially lead to these kind of ridiculous situations.

Oh, and by the way, any type of recursion can be implemented iteratively by crafting a stack data structure. It is just much more messy and un-functional programming to do so. Sometimes is more efficient, and sometimes there is no performance gain to justify the loss of readability. See, this is what worries me about the newer generations, they don't have good enough grasp of the fundamentals.

Re: Should Be Enough

2010-03-15 10:14 • by tovarich (unregistered)
302253 in reply to 302218
Smart early men counted "one, two, many... many-one, many-two, many-many..." etc.

Re: Should Be Enough

2010-03-15 10:15 • by Luca (unregistered)
The real question here is: Why did you hire him?

Re: Should Be Enough

2010-03-15 10:16 • by TopCod3r
So it is a tail recursive routine and has been unrolled.

But I'm not a big fan of tail recursion because it has some serious performance problems in C#. I once ran a benchmark of using tail recursion versus inline and inline kicked a$$ versus recursion. I haven't run the same test in VB.NET, but I plan to do that and write a white paper with the results (probably to be published internally within my company at least initially).

I have always thought of recursion as being one of those "ivory tower" things that live in the realms of theory and academia and was never meant to be used in a production system like this.

Re: Should Be Enough

2010-03-15 10:20 • by Tag (unregistered)
302256 in reply to 302245
This.

Re: Should Be Enough

2010-03-15 10:20 • by Brent (unregistered)
302257 in reply to 302229
mk:
I don't know if you are joking, but I was taught, and believe, that "zero, one, many" is a very good design principle.


Yep, the correct number for a limit on something is almost always zero (disallow), one (singleton), or many (no limit).

Re: Should Be Enough

2010-03-15 10:21 • by FIA (unregistered)
302258 in reply to 302214
Keloran:
for (comments as comment):
for (comment as commen):
for (commen as comme):
for (comme as comm):
for (comm as com):
for (com as co):
for (co as c):
if (c == 1):
return frist;
else:
return not enough obviouslly;
<snip>


The first thing I though when seeing this was 'Oh shit, PXELinux can't find it's config file again.'

I need to get out more.

Re: Should Be Enough

2010-03-15 10:21 • by John (unregistered)
To iterate is human
To recurse, divine.

Re: Should Be Enough

2010-03-15 10:21 • by nB (unregistered)
302260 in reply to 302226
Cad Delworth:
So Easy A Caveman Could Do It:
The usual joke is that early man counted "one, two, many".

Actually, there is still a VERY remote tribe somewhere in the world (I forget exactly where, without looking it up) who still do count in that way.
1, 2, 3, many.
It is the Hotentot tribe sub Sahara Africa. (book is: one two three infinity).

Re: Should Be Enough

2010-03-15 10:22 • by Jan (unregistered)
302261 in reply to 302255
Welcome back TopCod3r. Good luck.

Re: Should Be Enough

2010-03-15 10:28 • by Roy T. (unregistered)
I hope by strongest he meant physically...
« PrevPage 1 | Page 2 | Page 3 | Page 4 | Page 5Next »

Add Comment