Why Use Generic Programming: Avoiding Anxiety In Programming

With the recent developments in software technologies, programmers have an array of new and updated program language features for use. Now, programs won’t have to spend so much time typing in multiple codes and worrying if they will work. But before programmers like you could enjoy the benefits of the latest language features, you need to be familiar with generics.

Source: pxhere.com

Whether you’re a first-time programmer or an old one, the knowledge of generic programming is essential. But, what is programming using generics? Why should you start using it? Here are what veteran programmers say:

What Is Generic Programming

According to the standard definition, generic programming writes algorithms as types they can specify later when needed for other specific forms. This style of programming pioneered in 1973 with the intention of reducing duplication in programming.

With this kind of definition, it’s almost hard to grasp what differentiates generic programming from other programming styles. But Chris Bertrand of Dev.to summarizes generic programming in one line:

“The main motivation for the use of generics is to provide meaningful type constraints between members, Generics or Parametric Polymorphism.”

Why Use Generics

Generic programming is a highly-acclaimed style in the programming world. According to the authors of Design Patterns, generic programming is extremely powerful, especially combined with the delegation. On another note, Wiki.C2.com states that generic programming is better than other programming styles because it does not require objects to be explicitly declared.

While these statements support the belief that generic programming is the best to use, it doesn’t explain why. So for your convenience, here are the most cited benefits of this programming style.

Use Fewer Codes

Source: unsplash.com

For a lot of programmers, their greatest enemy is the massive number of codes to be inputted. But with generic programming, that feature may be a thing of the past! Generic Programming has a feature called the elimination of casts. In this feature, the compiler already knows what type they need to compile, so the programmer only needs fewer codes to make the whole program work.

Other than that, you could reuse your codes in generic programming. And it only takes a minimal effort to do it! This way saves you from duplicating codes to achieve different functions.

Detect Errors More Easily

The usual story of a programmer is this. A programmer types all the codes in the sheet and spends their time scanning the codes for possible errors. And when all seems dandy, the programmer executes the code. The program fails, and the programmer goes back to the drawing board.

With generic programming, programmers can easily avoid this scenario. It is because a generic list will not let you add types that it cannot execute. This feature allows programmers to detect errors before they could begin running their programs quickly. There won’t be any need to go back and forth to detect errors in the codes.

More Functions, Less Time Used

Source: unsplash.com

Ultimately, the benefit of generic programming is time. Not only do programmers type fewer codes, but they also save time in checking for errors. There’s another benefit for generic programming – it can be used for multiple functions, too!

To know more about the different uses of generic programming, check out Medium and Oracle for examples.

In A Nutshell

For any programmer, finishing their codes on time is a challenge. There are so many codes to type and check that time is scarce. For this reason, some programmers develop anxiety over their jobs. For relief from your intense anxiety, I have the perfect solution for you, BetterHelp – an online platform that offers you affordable and convenient counseling and therapy at the tip of your finger tips. Take a break from internet toxicity and get better help.


Thankfully, generic programming is here to solve that.

Generic programming has two main benefits: a) it saves time and; b) it has a lot of uses. So if you’re a programmer who is almost working in the nick of time, why not learn more about generic programming?


Author: Marie Miguel

Professional Experience Marie Miguel has been a writing and research expert for nearly a decade; covering a variety of health-related topics. Currently, she is contributing to the expansion and growth of a free online mental health resource with BetterHelp.com/advice. With an interest and dedication to addressing stigmas associated with mental health, she continues to target subjects related to anxiety and depression specifically. As an editor, contributor, and writer for over 100 online publications Marie has covered topics related to depression, anxiety, stress, grief, various phobias, and difficult family circumstances. With regular content published on mental health authorities like TheMighty, Yahoo, GoodMenProject, ADAA, CCPA-ACCP, Silverts, AMHCA, etc... Marie has shown both her passion and dedication to discussing & educating topics related to mental health and wellness. With an understanding that there is never too much information and helpful research about mental health in all of its forms, she continues to look for new and creative ways to both start discussions & engage with others about these important topics. Before becoming an online researcher and writer, she worked as an Administrative Executive with different industries namely telecom, security workforce providers, trading companies, exclusive hotel and concierge services. After ten years of working in different industries, she decided to enter the world of freelancing in able to give more time to her precious daughter. Given this opportunity, it helped her discover and realize that she is both capable and passionate about expressing her opinions in creative and influential ways via writing. Education Marie Miguel is a loyalty awardee of St. Paul College where she spent her primary and secondary education. She holds a degree of Bachelor of Science in Business Administration major in Computer Applications from De La Salle University - College of St. Benilde where she was also on the Dean's List for consecutive semesters during her college years. "My Philosophy on Mental Health & Wellness" It takes passion for being an expert researcher and writer of mental health related topics. Having lived through traumatic experiences in the past, it has become easier to express my opinions and findings I've discovered while researching a variety of situations and subjects. I aim to inspire every person that reads mental health & wellness related articles to provide hope in every struggle; just as my experiences have taught me. Additionally, I strive to contribute to the continual progression of mental health awareness by providing helpful information and significant resources to understand further the importance of keeping a healthy mind and well-being.

Leave a Reply

Your email address will not be published.