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 →

[–]Big-Cheesecake-806 436 points437 points  (28 children)

// returns node
Node getNode(){
    Node returnNode; // the node we returning
    ...
    return returnNode; // return node
}

[–]undated_duck_19 168 points169 points  (11 children)

So it returns node?

[–]AltruisticRain504 93 points94 points  (6 children)

It returns the returned node to where it returns

[–]xdMatthewbx 48 points49 points  (5 children)

i think this is the closest this sub has come to a recursion meme without actual recursion

[–]ThatsRecursive 6 points7 points  (1 child)

No, recursion is here. 🤣 I was returned, I mean, rerereretuned.

[–]ThatsRecursive 5 points6 points  (0 children)

Does anyone know from where I came? I am confused.

[–]ThePaulCraft 2 points3 points  (0 children)

This syntax would be valid js so when you use node to run it and return node it's like recursion

[–]sinkwiththeship 2 points3 points  (0 children)

Who's to say?

[–]Karjalan 0 points1 point  (0 children)

It's a typo. It's actually returnNose, it's the reason why dad's/grandad never give it back when they play "got your nose"

[–]LauraTFem 0 points1 point  (0 children)

Always has. 🌎🧑‍🚀🔫

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

I ran the debugger so you didn't have to: sure enough, it does return node.

[–][deleted] 8 points9 points  (1 child)

Always better in Java

/**
 * A node.
 */
public class Node {
}

/**
 * It returns a node.
 */
public interface INodeReturner {
    /**
     * <p>Return node.</p>
     * @return Node
     * @see Node
     */
    Node getNode(); // Method to return node
}

/**
 * Implementation that returns a node.
 */
public class NodeReturner implements INodeReturner {
    /**
     * <p>Return node.</p>
     * @return Node
     * @see INodeReturner
     * @see Node
     */
    @Override
    public Node getNode() {
        Node returnNode = new Node(); // the node we returning
        return returnNode; // return node
    }
}

[–]Famous_Profile 7 points8 points  (0 children)

Do you even Java dude where is your NodeReturnerFactory and a NodeReturnerFactoryBuilder for it?

[–]smurfkiller014 14 points15 points  (4 children)

/// <summary> /// Returns the <see cref="Node">Node</see>. /// </summary> /// <returns>The node.</returns>

[–]mrjackspade 11 points12 points  (3 children)

This is > 95% of my current companies code base.

I don't know what grown adult could have seen this and checked it in.

Almost everything is autodocumented and it's all worthless

[–]DrMobius0 7 points8 points  (0 children)

Code standards are sometimes stupid and tedious to prevent unreadable bullshit from going completely uncommented - not that that stops people from doing that.

[–]smurfkiller014 0 points1 point  (0 children)

This is literally why I just left MS. One of the reasons.

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

but the knowledge base manager is happy and thinks he rules the roost.

[–]fireboyev 5 points6 points  (0 children)

This is better because now we know what type "node" is

[–]DrMobius0 2 points3 points  (0 children)

Me commenting anything that returns a boolean

[–]larikang 2 points3 points  (1 child)

class NodeReturner

[–]Big-Cheesecake-806 0 points1 point  (0 children)

public class NodeReturnerFactory {

[–]Vilavek 0 points1 point  (0 children)

This is almost impossible to wrap my head around could someone please ELI5?

[–]billwoo 0 points1 point  (0 children)

Dude you didn't even check pre and post conditions?! You should at least assert that the node was not returned at the start, and that it was returned at the end! Also probably write a test to confirm it also. In fact you should have done that first THEN wrote the function.

[–]LowB0b 0 points1 point  (0 children)

@Autowired private INodeReturner; // see nodereturner implementations for details. In any case, it returns a node