CodeX

Everything connected with Tech & Code. Follow to join our 1M+ monthly readers

Follow publication

Member-only story

Simple Ways to Reduce the Total Number of Lines of Code

Small things that tend to add up.

Joshua Reingold
CodeX
Published in
9 min readFeb 6, 2023

Photo by Fotis Fotopoulos on Unsplash

If one were asked to describe what makes a Programmer “good”, they might come up with a plethora of answers including:

  • The ability to write code that is Self Documenting (I.E. Another programmer doesn’t have to look at the Documentation).
  • The ability to write algorithmically efficient code (I.E. They can keep Big O efficiency to a minimum).
  • The ability to keep used memory to a minimum (E.G. To not put too much memory on the Stack Frame).
  • And at least a few other skills.

I would say that one skill nice to have is being able to write functions (or even classes) that are short and concise. There are at least a few ways that one could do this, and this story will attempt to explore them.

Opening (and possibly closing) Brackets on the Same Line

Photo by Markus Spiske on Unsplash

If a programmer were to consider all the things that they do (from a syntactical perspective) while programming a class or file, they could probably come up with a lengthy list…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

CodeX

Published in CodeX

Everything connected with Tech & Code. Follow to join our 1M+ monthly readers

Joshua Reingold

Written by Joshua Reingold

I am a Computer Science graduate with decent knowledge in different STEM fields and some non STEM fields. I also have some knowledge in Martial Arts.

No responses yet

Write a response