programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

MonkderZweite, in Bill is a pro grammer

Bill does not work with other people.

MystikIncarnate,

More like, other people won’t work with Bill.

Smoogs,

“Nobody wants to work anymore” -bad manager mating call.

ILikeBoobies, in Bill is a pro grammer

Bill is not replaceable

Static_Rocket,
@Static_Rocket@lemmy.world avatar

I strive to replace bill. I only work on undocumented code from 3rd parties.

Sweetpeaches69,

I salute you.

thtroyer,

Bill is a liability.

docAvid,

But an irreplaceable liability.

docAvid,

But an irreplaceable liability.

javi,

hello

pewpew, in Bill is a pro grammer
@pewpew@feddit.it avatar

Code looks better without comments

BaardFigur, (edited )

Comment smart, don’t comment every line like this

int i = 5; // Assigns the value 5 into the variable i.

Maalus,

Comment only in extraordinary situations, when something you read can confuse someone. And by that I mean the business logic, not that you used a method that’s confusing to people since they only know the basics of the language.

Sylvartas, (edited )

Honestly, after a few years of working with juniors (and being one myself before that), I have to disagree with the last part. Sure, it’s fine for solo projects but people’s programming skills can vary heavily. I know people who will pull the wildest C++ compile time tricks you’ve ever seen, but a pointer to a pointer would somehow break their brain.

stebo02,
@stebo02@sopuli.xyz avatar

I usually comment on whole groups of lines of code, so the goal of each part of the code is clear

RagingRobot, (edited )

I would disagree. I love to use comments to format my code and separate the sections. I think it’s so beautiful. Also I love when libraries have ASCII art in the comments at the top of the main file lol. It makes the code more fun in my opinion.

I went to college with a guy who would treat the code as art when presenting projects. His code was always beautiful. Not super functional but always beautiful. It always stuck with me. I want my code to always be functional and beautiful. Easy to read and a pleasure to work with. That’s my goal at least. Comments help with that.

Also it depends on what the code is for haha

takeda, in 10 months later bill revisits his spaghetti code. forgets absolutely everything and refuses to elaborate. this wouldn't have happened if Bill forgot to comment on his code

I’m Bill I don’t comment my code (except complex parts), instead I try to make code clear, including using proper variable and function names and try to keep functions short. I don’t think I ever got lost in my own code in my 20+ years of experience. Even got complements about it.

The programming language is meant for humans to read/write, if you need to put comments to understand your code then your code sucks.

robdor,

I think that makes you Phil, not Bill. Thanks for the good work you do Phil.

krellor,

When writing basic business code, structuring the code well and having good naming standards means you shouldn't need a ton of comments, but you should still have some. Plus, using structured function content blocks gives you intellisense in some languages and IDEs, which is important for code reuse in teams.

However, when I was doing scientific programming I'd have comments for almost every line at times where I put the mathematical formula and operations the line represents. Implementing a convolution neutral network with parameters to dynamically scale the layers or MPI stochastic simulations is much different than writing CRUD functions or basic business logic.

ILikeBoobies,

Comments are there to make your ctrl + f’s faster

suodrazah,

Use comments to describe the philisophy of the code, the why. And any non obvious extended relationships. Risk. Etc.

Comments on function are typically a waste of space.

NuXCOM_90Percent,

Commenting is an art. Too much and it is outright misleading after the first hotfix. Too little and only the original developer can maintain it

But uncommented code is a dick move. And, more importantly, it means you can’t punt bug fixes to the intern

wit, in Bill is a pro grammer

Code should be self documenting.

Sylvartas,

But then you write code in the real world and find out that you have to write some ass backwards code every other day because of deadlines, backwards compatibility or whatever, and suddenly you realize that despite your best efforts, code cannot always be self documenting.

Source: me.

executivechimp,
@executivechimp@discuss.tchncs.de avatar

should

Sylvartas, (edited )

In a vacuum, sure. On a real project of substantial size with more than one programmer, I’m afraid it quickly becomes a “cannot”

JohnDClay,

But you should also comment it, things obvious to you aren’t obvious to even future you.

gornius,

General rule of thumb: Comments say why is it here, not what it does. Code itself should describe what it does.

drolex, in 10 months later bill revisits his spaghetti code. forgets absolutely everything and refuses to elaborate. this wouldn't have happened if Bill forgot to comment on his code

Wow this job has massive amounts of unnecessary stress, I wonder what the cause can be.

The cause is me, 6 months ago.

(Written for comedic purposes only. Managers are my single source of stress)

agent_flounder,
@agent_flounder@lemmy.world avatar

Me: writes code^1, doesn’t comment

Me, six months later: what idiot wrote this shit?!

  1. Only developer on project
drolex,

Time to plan a 3-day workshop with yourself at the pub to get it together

PunnyName, in 10 months later bill revisits his spaghetti code. forgets absolutely everything and refuses to elaborate. this wouldn't have happened if Bill forgot to comment on his code

Remembered*

Bill DID forget.

towerful,

Classic comments.

Code is spaghetti.
Comments describe what it used to do.
Comments are no longer relevant.

Comments should be about how/what a code block does something.
Not what a line of code does

EnderMB, in Bill is a pro grammer

Comments don’t describe the code. They describe the decision to use this business logic.

If you stick to good engineering practices, like small methods/functions, decoupling, and having testable code, you don’t often need many comments to show what your code does. I always recommend a method signature, though, because you can save a few seconds by just saying that a block of code does, rather than me needing to read exactly how you turned one dict into another dict…

MrSqueezles,

I agree for inline code comments, like, “# Save the sprocket”, right above the line that saves the sprocket. Does this include documentation? Because when I see a prepareForSave function that references 10 other functions and I just want to know, “Is this mutating and how is it preparing for save and when should I call it?”, having the author spend 15 seconds telling me is less time consuming than me spending 5 minutes reading code to find out. Anyone who has read API docs has benefited from documentation.

EnderMB,

No, commenting a function should be commonplace, if not only so that your IDE/editor can use the documentation when the signature is found elsewhere in your code.

Within a function, though, basically means that something gnarly is happening that wouldn’t be obvious, or that the function is doing more than it (probably) should.

Prunebutt, in 10 months later bill revisits his spaghetti code. forgets absolutely everything and refuses to elaborate. this wouldn't have happened if Bill forgot to comment on his code

Comments are lies that will happen sometime in the future

Comments are always overlooked if gode gets refactored. Language servers can’t/won’t parse them and they’re easy to overlook.

If you name your functions/variables clearly, put complex logic into clearly named functions and keep the same level of abstraction in every function (which never exceeds roughly 50 lines), you hardly need any comments, if any.

Comments are for behavior that’s not possible to convey clearly through code.

Archive,

If a block of code needs a comment, then you can easily move that block into a function and summarise the comment into a name for that function. If you can not easily move a block of code into a function, then you may need to rethink your design.

This isn’t always true of course, but it’s a good mindset to have.

graycube, in 10 months later bill revisits his spaghetti code. forgets absolutely everything and refuses to elaborate. this wouldn't have happened if Bill forgot to comment on his code

I hate fixing other people's code. It is one of the reasons I don't like letting an AI write my code first draft either.

killeronthecorner, in 10 months later bill revisits his spaghetti code. forgets absolutely everything and refuses to elaborate. this wouldn't have happened if Bill forgot to comment on his code
@killeronthecorner@lemmy.world avatar

Bill never revisits his code.

Bill is a contractor smart.

Socsa,

Bill changes jobs every two years to outrun the crushing weight of institutional responsibility.

mp3,
@mp3@lemmy.ca avatar

A technical debt escapist.

Potatos_are_not_friends,

NGL that is one of the best parts about being a contractor.

So many hackjobs. Sorry maintainers.

killeronthecorner,
@killeronthecorner@lemmy.world avatar

We all envy you more than we hate you

drew_belloc, in Programposting
@drew_belloc@programming.dev avatar
magic_lobster_party, in 10 months later bill revisits his spaghetti code. forgets absolutely everything and refuses to elaborate. this wouldn't have happened if Bill forgot to comment on his code

Bill writes spaghetti code.

Bill is not smart.

Don’t be like Bill.

Smoogs, in Bill is a pro grammer

Wow the comments here sounds like you’re all a bunch of antisocial nightmares to deal with in rL.

frezik,

That would be the type of people attracted to programming, yes.

nailbar,

I consider myself social. I’m a programmer because I love making things, and because I’m lazy, and I hate doing repetitive tasks.

DontTreadOnBigfoot,
@DontTreadOnBigfoot@lemmy.world avatar

Welcome to Lemmy

kubica, in Walking Desk Is More Annoying Than A Standing Desk
@kubica@kbin.social avatar

The kind of walker I want for when I'm older.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • programmer_humor@programming.dev
  • localhost
  • All magazines
  • Loading…
    Loading the web debug toolbar…
    Attempt #