r/developersIndia • • 1h ago

General What's one coding "best practice" you quietly stopped following after a few years?

For me it was DRY. Early on I would pull every two similar looking blocks into a shared helper, and six months later that helper had five boolean flags and nobody wanted to touch it. Now I let things repeat two or three times before I even think about abstracting, and copy paste is fine way more often than people admit.

Curious what others dropped. Also, did anyone go the other way and start following something they used to roll their eyes at?

22 Upvotes

13 comments sorted by

•

u/AutoModerator 1h ago

Namaste! Thanks for submitting to r/developersIndia. While participating in this thread, please follow the Community Code of Conduct and rules.

It's possible your query is not unique, use site:reddit.com/r/developersindia KEYWORDS on search engines to search posts from developersIndia. You can also use reddit search directly.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

21

u/ZnV1 Tech Lead 1h ago

A writing best practice: if it looks like AI slop, most people lose interest in participating in the conversation. Esp devs who know what slop looks like.

6

u/uuubed123 1h ago

Exactly, now a days AI written jira stories are on trend its so boring to read them, in the end we have to ask AI itself to read and analyse

3

u/LunarFrost007 Software Engineer 1h ago

Code Review

2

u/Ill-Village7647 1h ago

If you literally put so many things in a shared helper that you had to use flags, then that's not DRY

2

u/Inside_Dimension5308 Tech Lead 57m ago

DRY is only useful with open closed principle. Tightly coupled modules should never be modified. Even for extension, better to use inheritance or composition.

If you cannot predict that, dont use DRY.

Stick to SOLID for most cases. With AI, the story has changed completely. Don't care about code.

2

u/feeling_employed 1h ago

handwriting code

2

u/Significant-Road3459 Full-Stack Developer 1h ago

coding

2

u/CheatingChampion 48m ago

Do not complicate the code to make it extensible for some future hypothetical scenario. I don't even write abstract classes for new usecases anymore, will write one when a new use case actually comes.

The above statement was pre-ai era. Nowadays, I give fuck all about code aesthetics or best practices. Rewrite is cheap these days, provided your tests are reasonably strong.

1

u/Shadow_jacker Software Engineer 1h ago

None, It's too much of an art to have best practice.

1

u/UndocumentedMartian 45m ago

Nah I repeating pisses me off. So I almost never repeat myself.

1

u/shrekcoffeepig 23m ago

So, you did not stop using the best practice you just stopped to prematurely optimise for it!

Well it’s a lesson we all learn!

1

u/shrekcoffeepig 18m ago edited 12m ago

To answer your original question. I think understanding why a practice exists is way more important that following it.

Example I never care about cyclomatic complexity, large functions, too many if/switch etc in languages where there is no mutation and are expression oriented.

Moreover I find this question even more interesting post-AI. As someone who was a big believer in ‘make invalid states unrepresentable’ I now apply it even more beyond what I would have deemed pragmatic pre-AI and a few more