this post was submitted on 29 Nov 2023
85 points (92.9% liked)

Programming

17443 readers
175 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS
 

CODEBASE COMPLEXITY: LESSONS LEARNED Dumb, readable code is infinitely better than clever.

Don’t listen to vendors blaming the hardware and recommending expensive server upgrades.

Be aware of the danger of shortcuts and the importance of understanding how code works under the hood.

Opening and closing a database connection is a slow and expensive operation.

Consider the potential risks and implications when installing new npm modules or importing someone else’s code.

Beware of teammates who refactor code based on personal taste without proper documentation or completeness.

Ensure code changes are well-documented.

Be cautious of colleagues who make undocumented changes that create subtle traps for others.

Improve the code review processes to address flaws.

Acknowledge that even big companies like Facebook can make mistakes, as seen in their DNS record issue on October 4, 2021.

Don’t ever be the guy who accidentally breaks something on prod.

Broken code is fixable. People, now, that’s another story.

top 10 comments
sorted by: hot top controversial new old
[–] YurkshireLad@lemmy.ca 19 points 11 months ago (3 children)

A very recent university graduate joined our company many years ago. He was quite the C++ wizard, whereas we were slowly migrating from VAX Pascal to C++. No one could understand the code he wrote as he was using all kinds of jiggery pokery without comments. We had to ask him to simplify and comment his code! 😁

That doesn’t say much about us at the time!!

[–] litchralee@sh.itjust.works 13 points 11 months ago

jiggery pokery

+1 just because I love seeing this phrase in the wild

without comments

Oof

[–] onlinepersona@programming.dev 7 points 11 months ago

Probably enjoyed templates too much.

Bro, did you know that templates are turing complete? You can write the entire program and run it in the compiler itself!

[–] LadyLeeLoosh@programming.dev 0 points 11 months ago

Sounds familiar

[–] Valmond@lemmy.mindoki.com 12 points 11 months ago (1 children)

Some genius programmer made a totally new shine kernel for the scientific app we had, using template metaprogramming. I had to finalise it. I still nightmare about the errors (GCC 4.8).

If you think C++ is easy, then this is a simple trick to bump up the challenge IMO.

Also completely unmaintainable or expandable ofc!

[–] LadyLeeLoosh@programming.dev 8 points 11 months ago (1 children)

“There are only two kinds of programming languages: the ones people complain about and the ones nobody uses.” This is a famous quote attributed to Bjarne Stroustrup, the creator of C++.

[–] Valmond@lemmy.mindoki.com 6 points 11 months ago (1 children)

Well, technically I didn't complain about a programming language, but an abuse of it.

I like C/C++ !

[–] LadyLeeLoosh@programming.dev 1 points 11 months ago (1 children)
[–] leggettc18@programming.dev 1 points 11 months ago

Same here, might just be because I learned with Object Oriented languages but C++ syntax just gels well with how I think. That could just be autism though.

[–] Semi-Hemi-Demigod@kbin.social 10 points 11 months ago

Opening and closing a database connection is a slow and expensive operation.

That depends a lot on your RDBMS and its configuration. For example, MariaDB can use a pool of connection threads so opening one doesn't take a lot of time.