Our Philosophy - Manifesto - Appendix 2: Ugly Code Snippets

For the sake of artistry, we've deliberately crafted some of the most atrocious code we could muster

Here's a collection of our most... interesting, shall we say, coding endeavors

More of Our Greatest Hits

About Us

Snippet 1: The Infinite Loop of Despair

                while (true) {
                    console.log("We're stuck in this loop and we can't escape");
                    break;
                }
            

A classic. We've been trying to get out of this loop for hours, but it just keeps going.

Snippet 2: The Unnecessary Use of Regex

                var str = "Hello, world!";
                str = str.replace(/h/i, 'H');
                str = str.replace(/o/i, 'O');
                str = str.replace(/, /, ', ');
                console.log(str);
            

We're not even sure what this code does, but it looks nice and fancy.

Snippet 3: The Overly Complex Function

                function addTwoNumbers(a, b) {
                    if (typeof a === "number" && typeof b === "number") {
                        if (a === 1 || b === 1) {
                            if (a === 1 && b === 1) {
                                return 2;
                            } else if (a === 1) {
                                return a;
                            } else if (b === 1) {
                                return b;
                            }
                        } else {
                            return a + b;
                        }
                    } else {
                        return "Invalid input";
                    }
                }
            

It's like trying to solve a puzzle while blindfolded.