New Self New Life
No Result
View All Result
  • Home
  • Entertainment
  • Celebrity
  • Cinema
  • Music
  • Digital Lifestyle
  • Social Media
  • Softwares
  • Devices
  • Home
  • Entertainment
  • Celebrity
  • Cinema
  • Music
  • Digital Lifestyle
  • Social Media
  • Softwares
  • Devices
New Self New Life
No Result
View All Result
Home Softwares

5 bad coding practices that make other developers hate your code

by admin
4 years ago
in Softwares
5 bad coding practices that make other developers hate your code
Share on FacebookShare on Twitter


Wait, what? BAD coding practices? Sure, you’ve learn accurately. The web is stuffed with good recommendation and tutorials for builders already. You will discover some even on this weblog. This text will completely be completely different although – sorry. However wait, I’ll present you one thing even higher! It’s 5 cardinal sins you may commit in your code. These unhealthy programming practices are so evil that each developer will hate your work. Are you able to possess this secret information? Come alongside then.

Dangerous coding practices no. 1: Flip naming right into a riddle recreation

bad coding practices

Let’s heat up with one thing straightforward. For a superb begin, add some additional abbreviations to your variable or operate names. 

I do know, I do know – it’s good follow to make all of the names as descriptive as doable, proper? Like handleFormSubmit, getUserConfiguration or parseCustomerInformation. However we’re not right here to do a superb job. 

For unhealthy outcomes, at all times shorten and abbreviate the names as a lot as doable, so the subsequent developer working in your code must guess what you have been fascinated by. 

Names like handleBtnClick, getConfig or parseInfo are good informal examples. They don’t reveal an excessive amount of what the capabilities are doing however you may nonetheless run with it throughout code opinions. And pointless abbreviations like btn, func, config or cb make it even tougher to grasp.

You are able to do a lot extra with variable names! Have a listing of unconfirmed customers? Don’t name it uncofirmedUsers, simply named it customers. The following developer must learn the WHOLE code that returns the variable to grasp what’s in it. No discountedProducts for that poor soul, as a result of the product’s identify continues to be true and sufficient.

So as to add just a little spice to the names you may at all times play with the casing, and I assure the co-workers will hate your guts for that. As an alternative of making eg.: a readXmlDocument as the great practices suggest (abbreviations must be formatted like common phrases) you may make a readXMLDocument methodology that can require the opposite builders to look carefully and skim the identify extra rigorously to totally perceive it.

In fact, all of this insanity will be stopped throughout a code evaluation however your job is to struggle for it. Possibly since you’re too lazy to repair it, or perhaps since you want your troublemaker persona to keep up. A method or one other, bear in mind you may at all times promise to alter it with the subsequent pull request hoping everybody will forgive and overlook your sin (and possibly they’ll do).

Dangerous coding practices no. 2: Write very difficult code

bad coding practices complicated code

Right here you’ll have a chance to show you’re a Rick Sanchez of software program growth. 

You simply want to jot down your code in a bit extra difficult method than it must be. 

Possibly you could find some generalisation that can permit you to reuse three strains of code in two locations by creating a way that accepts 5 parameters? Possibly you may cut back three strains of code into one through the use of a intelligent triple nested ternary operator? Your creativeness is the restrict! 

In fact, it should make the appliance tougher to learn and preserve however that can most likely be your coworkers’ drawback, proper? Wonderful!

So give it a go and write a code that proves you’re an actual hacker. I recommend you employ chained capabilities, nested conditional statements, over-bloat design patterns and intelligent one-liners that use area of interest hipster options of the language you write in. As a result of why write Date.now() if you are able to do the identical factor with a bit extra cryptic +new Date()? I’m positive your colleagues from the venture will thanks for it when they may spend time making an attempt to grasp what the heck is occurring within the code.

And bear in mind: the extra the code is overengineered and early-optimised the extra you’ll make your coworkers battle with it. You get 10 respect factors for utilizing a cut back operate and 100 factors for making a recursion name. By the top of the venture, that can make you an actual professional coder, congrats! 

 

bad code practices dependencies

I perceive that the aforementioned approach will be laborious to push via code evaluation. However should you’re an online developer writing in JS or PHP, you will have many import/use clauses on the highest of virtually each file. Lots of builders don’t test it throughout code evaluation as a result of they scroll on to, what they assume, is the meaty half. 

That’s why the dependencies are an ideal place so that you can invite horrors to make themselves comfy in your code. 

Think about you will have some UserSubscriptions view in React. Create a file with a helper operate calculateTimeToSubscriptionEnd. Nice. Now the place it is best to put this file? In a separate listing that shops all of the area logic associated to subscriptions or funds? Pff, after all not. Higher put it subsequent to the view you simply created! 

It’s considering forward as a result of when you’ll lastly make the admin panel (and the Subscriptions view there), nothing stops you from importing the helper operate from the person views. And possibly nobody will discover it, as a result of virtually nobody checks the imports record. This manner you’ll couple two unrelated modules and make hell for builders who will ever attempt to change one thing or refactor the code. And belief me, nothing makes builders crazier than a really structured venture. 

I hear you say, “This doesn’t appear like an enormous impediment”. Much less skilled builders could not repair this for a very long time. They’ll battle with the mess they’ve discovered, considering it’s essential to maintain it as it’s. It would harm them EVERY SINGLE TIME when a brand new developer tries to grasp the appliance construction. Will probably be much more triggering when the devs replace or delete one thing associated to that operate. A bit of mess that hurts everybody till some hero will repair it. Possibly it may even be you sometime?

bad coding practices functions

Do you think about your self a inventive, inventive soul? Right here’s your new favorite torture methodology. 

The world is unpredictable and nobody’s ever stated that every little thing should work the identical method. Additionally, nobody ever stated that consistency and predictability are the keys to an ideal developer expertise or profitable venture. Effectively, many individuals proclaim that, however we don’t take heed to them at present, OK? 

We’re right here to wreck somebody’s day is by making comparable capabilities within the codebase behave a bit in another way.

For instance, you could have some validation capabilities that return true when the information is legitimate and the string with an error message when one thing isn’t fairly proper. What if the subsequent validator your add will return false or undefined when the handed worth is right? That can break somebody’s plans to jot down a really clear type dealing with. Good… 

You may as well settle for arguments of completely completely different shapes in each operate. Like within the meme above. Let’s a few of them settle for the person ID however others the entire customers object (even when they want the ID solely). Or perhaps you’ll find a approach to settle for the customers’ emails? That will likely be a large killjoy for the subsequent developer that must work on that code.

I wager you may include even higher methods to shock different builders, so why not make every little thing unpredictable. Drop consistency! Lengthy stay the randomness! Additionally, by no means take into consideration the massive image of the venture’s codebase, give attention to including a little bit of enjoyable to each single file individually. In different phrases: don’t be an engineer, be an artist! I assure you that different builders will hate that from the underside of their hearts. However that’s clearly since you’re so forward of your time.

bad programming practices meme squirtle

Pull this off and nobody will ever need to work along with your code ever once more. 

Don’t separate any frequent logic into completely different capabilities, lessons or parts. Simply copy the strains your want between information. 

In any case, your code is ideal and essential, so let’s make everybody see it a number of occasions all through the entire venture. Let it shine!

However you see, that’s not the one good cause for duplicating the code. In case of any updates, it should pressure builders to make modifications in lots of information without delay. What’s higher, somebody could (and possibly will, if there are usually not sufficient exams within the venture) miss a number of occurrences of the copied logic and will likely be pressured to do a second and even third repair. And what’s extra enjoyable than looking out for a similar code in hundred information of the venture’s codebase? I wager your coworkers will adore it.

Do not forget that making a superb abstraction is tough and time-consuming so it is best to at all times skip doing it and replica the code the place it’s wanted. Your code reviewer will perceive this. If not, then you may spend the time you saved explaining why it’s essential to make extra copies of your valuable code. You are able to do it, I imagine in you!

bad programming practices

This text is clearly a joke. Don’t do the issues I described above. For actual, it’s not a “maintain my beer” wager.  

Simply do every little thing the opposite method round:

  • hold naming in your code descriptive and clear, 
  • make your code easy and comprehensible to all people,
  • preserve a clear venture construction, 
  • always remember to jot down constant and predictable interfaces, 
  • separate frequent logic at any time when it’s doable with out shedding the code readability. 

Oh, and by no means be imply to your colleagues. EVER!

There’s a saying within the growth neighborhood that it is best to at all times write your code like the subsequent developer that comes after you is a serial killer. You don’t need a killer to hate you, do you? I don’t like this angle. 

I feel it is best to at all times write your code like the subsequent particular person engaged on it’s… your self. 

Subsequent time you’re actively coding, simply ask your self: “Would I be joyful seeing these strains after I’ve lengthy forgotten what they do”?

Wanna see how I ruined my JavaScript code and nonetheless received the coding problem? ?

As you may see, I’m all about humour in software program growth. For those who’re curious about extra anti-tutorials, be certain to test this madness out!



Source link

Tags: BADcodeCodingDevelopershatePractices
Previous Post

Khloé Kardashian Shares Super-Rare Photo With Beloved Bro Rob Following Birthday Celebration!

Next Post

Fintech Startup Slice Raises $20 Million From Gunosy and Blume Ventures

Related Posts

DeFi Staking Platform Development | DeFi Staking Platforms Company
Softwares

DeFi Staking Platform Development | DeFi Staking Platforms Company

by admin
May 17, 2025
Vivaldi 7.4 RC 3 – Vivaldi Desktop Browser snapshot 3684.34/35
Softwares

Vivaldi 7.4 RC 3 – Vivaldi Desktop Browser snapshot 3684.34/35

by admin
May 16, 2025
User Guide For Recipe App For Wix
Softwares

User Guide For Recipe App For Wix

by admin
May 13, 2025
Software update keeps Newark airport radar online but network concerns and flight limits remain
Softwares

Software update keeps Newark airport radar online but network concerns and flight limits remain

by admin
May 14, 2025
10+ Best Free Hero Scene Mockup Templates for Photoshop in 2025 — Speckyboy
Softwares

10+ Best Free Hero Scene Mockup Templates for Photoshop in 2025 — Speckyboy

by admin
May 15, 2025
Next Post
Fintech Startup Slice Raises $20 Million From Gunosy and Blume Ventures

Fintech Startup Slice Raises $20 Million From Gunosy and Blume Ventures

YouTube Launches 4K Plus and New Features for Sports Fans on YouTube TV

YouTube Launches 4K Plus and New Features for Sports Fans on YouTube TV

  • Trending
  • Comments
  • Latest
Fundamental New Google Photos Features Should Have Been There From The Start

Fundamental New Google Photos Features Should Have Been There From The Start

April 26, 2021
Trends in Mobile App Development

Trends in Mobile App Development

December 1, 2021
New TV & Movie Additions

New TV & Movie Additions

October 1, 2021
The Best Crime Shows on Netflix

The Best Crime Shows on Netflix

May 27, 2023
The Data Lake Security Checklist: IT Leader Essentials

The Data Lake Security Checklist: IT Leader Essentials

August 1, 2022
Most Useful Gadgets in 2021 – Nogentech.org

Most Useful Gadgets in 2021 – Nogentech.org

July 29, 2021
15 Best Movies Like Parasite

15 Best Movies Like Parasite

February 20, 2022
The Comprehensive Multivitamin for Everyday Glow

The Comprehensive Multivitamin for Everyday Glow

April 24, 2022
During the Viking Age, Pregnancies Were Political, Precarious—and Violent

During the Viking Age, Pregnancies Were Political, Precarious—and Violent

May 17, 2025
Score Spring Sneakers & More up to 70% Off

Score Spring Sneakers & More up to 70% Off

May 17, 2025
James Martin ‘mocked’ for surprising hack he does ‘four times a week’

James Martin ‘mocked’ for surprising hack he does ‘four times a week’

May 17, 2025
Bruce Springsteen Biopic Gets Release Date

Bruce Springsteen Biopic Gets Release Date

May 17, 2025
Rihanna Fans Think She Hinted At Rumored Retirement From Music By Saying THIS!

Chrissy Teigen Reveals She’s Drinking Again: ‘I Don’t Know What I’m Doing’

May 17, 2025
Cable giants Cox and Charter agree to $34 billion merger

Cable giants Cox and Charter agree to $34 billion merger

May 16, 2025
DeFi Staking Platform Development | DeFi Staking Platforms Company

DeFi Staking Platform Development | DeFi Staking Platforms Company

May 17, 2025
Frugal Friday’s Workwear Report: Stripe Rib Polo Sweater

Frugal Friday’s Workwear Report: Stripe Rib Polo Sweater

May 16, 2025
New Self New Life

Your source for entertainment news, celebrities, celebrity news, and Music, Cinema, Digital Lifestyle and Social Media and More !

Categories

  • Celebrity
  • Cinema
  • Devices
  • Digital Lifestyle
  • Entertainment
  • Music
  • Social Media
  • Softwares
  • Uncategorized

Recent Posts

  • During the Viking Age, Pregnancies Were Political, Precarious—and Violent
  • Score Spring Sneakers & More up to 70% Off
  • James Martin ‘mocked’ for surprising hack he does ‘four times a week’
  • Home
  • Disclaimer
  • DMCA
  • Privacy Policy
  • Cookie Privacy Policy
  • Terms and Conditions
  • Contact us

Copyright © 2021 New Self New Life.
New Self New Life is not responsible for the content of external sites. slotsfree  creator solana token

No Result
View All Result
  • Home
  • Entertainment
  • Celebrity
  • Cinema
  • Music
  • Digital Lifestyle
  • Social Media
  • Softwares
  • Devices

Copyright © 2021 New Self New Life.
New Self New Life is not responsible for the content of external sites.

slots online best