DEV Community

Cover image for Paradox of Perfectionist Programmers
Naman Thanki
Naman Thanki

Posted on

Paradox of Perfectionist Programmers

“Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.” ― Robert Heinlein

Okay but how much of this applies to real world and practical day to day life of a programmer where he is supposed to make progress on particular tasks or progress? What is the worth of the progress that we make? is it worth making progress if the progress made itself is not efficient or long term reusable for the team?

These are some of the questions I had arose while writing a simple program which generates all the Armstrong Numbers (Narcissistic Numbers) in a range, as being a lazy programmer I started writing off the programmer without thinking much or making any algorithm or drawing charts for the logical representation...

def is_armstrong(val, degree): 
  sum = 0
  for i in val: 
    sum += pow(int(i), degree)
  val = int(("").join(val))
  if val == sum: 
    return True
  return False

n = int(input("Enter Limit: "))

for i in range(n): 
  if is_armstrong(list(str(i)), len(list(str(i)))):
    print(i)
Enter fullscreen mode Exit fullscreen mode

Like I expected it was very inefficient and slow solution to the Problem, But the Thoughts I had after writing it were bothering me, such as if it is time worthy to make brute force easy to go solution approaches towards a problem or should we not begin until we have hypothesis of efficient solution?

“Laziness is the first step towards efficiency.” ― Patrick Bennett

Later on I realized if I had never written lazy solutions to each problem I had faced in the past I would have not started first step at least 80 % of times... this led me to realize that perfection always grows parallelly with imperfection, There are so many times I don't write any code or any practical working solution of a problem just because I couldn't think of best way of doing that problem, I believe there is no better way of writing perfect code without writing imperfect code at first glance because then you know what are the pros and cons of solution that you have created and then there's always room for making it better, Problem is not starting with a dumb approach and then gradually making it better

Top comments (0)