14
umnikos
7y

!rant

I figured out a way to make your code readable!

The main idea: make everything into a function. Each function should be small and you should gradually use past functions to build future functions.

Depending on the language and the size of your code you should make your functions with different sizes, but always keep them small.

This function splitting allows for debugging small parts of your code, avoids repetition and abstracts your code, each making it more readable.

Comments
  • 3
    My programming teacher has been preaching this from the start
  • 5
    Sorry, this isn't a new idea but certainly a good philosophy. Think about the libraries you use...
  • 2
    Isn't that common sense though?
  • 5
    Its almost like some may have implemented this in a language...
  • 0
    Just like if I'm using a functional language😰😰
  • 0
    That is what I used to do waaay back in my C days. It made moving to OOP and C++ a natural.
  • 3
    That's called clean coding.
  • 1
    When translated to OOP this is called Single Responsibility Principle. Google for SOLID principles. I think it's a must read for any developer.
  • 0
    @Krokoklemme If it was, then why so many people are complaining that they don't understand their own code??
  • 0
    @umnikos because people don't study their craft.
  • 0
    Maybe not everyone does it, but this is called OOP
  • 0
    @soolkiki I know, I've coded in java before...
  • 0
    @umnikos
    Was the post sarcastic?
Add Comment