Naming is the most challenging part of programming

520 points · 27 comments · view on lemmy.world

27 Comments

Borovicka@lemm.ee · 55 pts · 2y (1 reply)

My friends, please stop writing "something"s that do 1001 different things.

With regards,
Devs cleaning up old projects

marcos@lemmy.world · 15 pts · 2y

Yeah, that won't happen.

And if you propose a separable set of functionality that you can mix as you like, you'll get shut down on the base that it's not viable (doesn't matter if you had written it already), it's too complex to understand (doesn't matter that everybody keeps doing everything wrong because nobody can understand the current one) and YAGNI (doesn't matter that keeping the current one running takes most of the time from everybody).

MrPoopyButthole@lemmy.world · 33 pts · 2y (9 replies)

You see, that's why you divide all the smaller distinct batches of logic into their own functions and then give the wrapper function a name like blahBlahOrchestrator or blahBlahManager waves hands mysteriously

MajorHavoc@lemmy.world · 18 pts · 2y (5 replies)

I prefer to have a blahBlahManagerFactory, with an incredibly brittle undocumented XML configuration file. /s

I find that it makes everyone's work day simpler, because they simply cannot do their jobs. /s

PoolloverNathan@programming.dev · 9 pts · 2y

If you don't have your config in .txt files with incredibly confusing implicit syntax, you're doing it wrong.

agressivelyPassive@feddit.de · 5 pts · 2y (1 reply)

That's a bit too constraining for my taste. What if I want to orchestrate something like blahBlah, but in a flexible way? Something like an AbstractBlahBlahableFactoryBuilder?

MajorHavoc@lemmy.world · 2 pts · 2y

Lordy. That's even worse than I was willing to take it. You win. Shudder Lol.

lukas@lemmy.haigner.me · 3 pts · 2y (1 reply)
[ removed ]
MooseBoys@lemmy.world · 5 pts · 2y

I think you meant IAbstractBlahBlahManagerFactoryControlBeansHandlerFactoryFactory6ProxyHandlerAsync_Compat3, and of course its test counterpart, IAbstractBlahBlahManagerFactoryControlBeansHandlerFactoryFactory6ProxyHandlerAsync_Compat3::FakeMockVirtualDeviceTestManagerBeansFactory2_HACK_DO_NOT_USE

dan@upvote.au · 6 pts · 2y (1 reply)

I wrote a bunch of if statements to work out how to handle various types of errors, and called it ErrorClassifier. Can I add "AI engineer" to my resume now?

fsr1967@lemmy.world · 3 pts · 2y

Only if you name it ErrorClassifierGPT

Potatos_are_not_friends@lemmy.world · 3 pts · 2y

blahBlahBlahDoesAllTheThings

negativenull@lemm.ee · 28 pts · 2y

There are 2 hard problems in computer science: cache invalidation, naming things, and off-by-1 errors

Anticorp@lemmy.ml · 28 pts · 2y (3 replies)

It is with great pride that we present you with the Patriot Children initiative. It provides funding for schools to have fireworks shows on July 4th.

*^(It also extends the Patriot Act for 900 years, makes it legal for corporations to own slaves, and revokes the 4th amendment.)

darcy@sh.itjust.works · 3 pts · 2y (2 replies)

why would you be against 4th of July and children?

Anticorp@lemmy.ml · 3 pts · 2y (1 reply)

Must be some sort of communiss.

darcy@sh.itjust.works · 3 pts · 2y

destroying america!!!!!!

atetulo@lemm.ee · 14 pts · 2y

It really is.

I've learned a lot about language by coming up with names and seeing other people's.

I think we are blessed with things like set/get. Such wonderful, simple, short concepts that compliment each other so well.

And they rhyme.

Gentoo1337@sh.itjust.works · 10 pts · 2y

OP, I really hope you mean project names and not variable or function names

gregorum@lemm.ee · 8 pts · 2y (1 reply)

FreedomGloryActOf2023.exe

MajorHavoc@lemmy.world · 2 pts · 2y

Well played. I threw up in my mouth a little reading that.

LetterboxPancake@sh.itjust.works · 5 pts · 2y (2 replies)

Nah, I'm gonna KISS

PoolloverNathan@programming.dev · 5 pts · 2y

Keep it staggeringly substantial.

GigglyBobble@kbin.social · 3 pts · 2y

Yes. Keep it simple and stupid.

Lmaydev@programming.dev · 3 pts · 2y (1 reply)

SRP all the way

loutr@sh.itjust.works · 5 pts · 2y

If it does 1001 different things, naming it is the least of your problems.

some_guy@lemmy.sdf.org · 1 pts · 2y

When writing a small, throwaway project, I stick with theIP, theDir, theVar, etc. More fun that way. This is with shell scripts, btw. I’m sure compiled code would be far more of a mess far quicker doing this.

ETA: also someVar, someDir, etc

Lemmling@lemm.ee · 1 pts · 2y

I agree also organization of your code