html Alice's Code Review Nightmares

Alice's Code Review Nightmares

Here be the list of code review nightmares that Alice has endured:

Example of the Bug-Ridden Monstrosity:

				if ($x > 5) {
					print("x is too big");
				} else {
					print("x is too small");
				}
			

This monstrosity has a bug where it will only print "x is too big" when x is greater than 5, but will only print "x is too small" when x is equal to 5. It will never print "x is too big" when x is equal to 5.

See the Bug Fix

Example of the Overly Complex Solution:

				def overly_complex_solution(n):
					if n > 10:
						return n * n + 5
					elif n < 5:
						return n * n - 5
					else:
						return 10
				

This solution will only return the correct result for n greater than 10, but will return an incorrect result for n less than 5. It is overly complex and will only work in certain circumstances.

See the Complexity Reduction

Example of the Infinitely Looping Nightmare:

				while True:
					print("I will loop forever")
				

This will print "I will loop forever" forever and ever.

See the Loop Termination

Example of the Dependency Hell Abyss:

				import random
				import math
				from random import random as r
				from math import pi
				from random import random as r
				from math import pi
			

This abyss has no dependencies, but it's still a nightmare to manage.

See the Dependency Reduction