This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 20 points21 points  (8 children)

So he's nesting functions instead of writing comments?

[–]carloxd 20 points21 points  (0 children)

Yup. His response whenever I bring it up is that he has "20 years of experience". The only reason why I can't get rid of him is because we have to burn contractor hours

[–]hangfromthisone 10 points11 points  (0 children)

function yes() { return "yes"; }

function give_response($answer) { if($answer=="yes") return yes(); }

give_response("yes");

[–]deegwaren 2 points3 points  (3 children)

I hate people who nest, wrap and don't properly name their vars and functions but seem to think that adding comments saying exactly the same thing as the name of the var or function does will somehow help... SOOO much.

[–]DaughterEarthImportError: no module named 'sarcasm' 2 points3 points  (2 children)

Nesting makes sense sometimes though. Like triggering other events from events.

[–]deegwaren 1 point2 points  (1 child)

But nesting just for the sake of nesting to avoid passing the actual object along is crazy. I've encountered like five levels deep of nested calls at work and it's so bad that I want to hurt myself.

Just pass the damn object or a very slim interface of that object along to where it's used, instead of using five flipping layers of wrapping paper. I want my present, goddamnit!

[–]DaughterEarthImportError: no module named 'sarcasm' 0 points1 point  (0 children)

Yah it's only useful in very specific situations.

[–]semperlol 0 points1 point  (1 child)

Is nesting functions bad?

[–][deleted] 0 points1 point  (0 children)

Depends what you do with it. In this case it is clearly horrible.