programmer_humor

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

case_when, in 4 billion if statements

This is poetry.

My favourite part is that he uses the modulo operator in his Python script to generate the C code.

ThrowawayPermanente, in 4 billion if statements

Let’s be real though, everything is IF statements all the way down

Th4tGuyII,
@Th4tGuyII@kbin.social avatar

There's not a single thing in this universe that cannot be accomplished with enough IF statements... as long as you've got infinite time to wait

waz, (edited )

…you mean IF you’ve got infinite time to wait?

Klear,

…you mean if you’ve got IFinite time to wait?

firecat,

The problem with if is the answer comes from user. There’s no mathematical reason or scientific explanation, only programmer who thinks the answer should include the subject.

Th4tGuyII,
@Th4tGuyII@kbin.social avatar

True...

But even on a more metaphorical level, every single thing that has or will happen in this universe, down to even the smallest quantum fluctuations could be encapsulated into IF statements as long as you had enough of them.

idunnololz,
@idunnololz@lemmy.world avatar

What if there was an unintentional infinite loop in your code. You could be waiting for infinite time only to learn the code had a bug. D:

thann, in Let me just move this project to the "unfinished" folder

The third half is always the hardest

Feidry,

The fourth half is pretty easy though.

Opafi,

That’s only because the fifth half usually is as difficult as two halfs at once.

aes, in Manager: This task only takes 30 minutes. Why did it take you the whole day?

Psst,

git add -p

dukk, (edited )

Better yet, git commit -p

sip,

uuuuuuuu. and you could do -m to describe the commit.

next they’ll add --push/-P.

perhaps add -r for fetch/rebase then commit.

one command to rule them all! 😈

Johanno,

What does this?

foxymulder,
@foxymulder@lemmy.ml avatar

“patch mode” - Patch mode allows you to stage parts of a changed file, instead of the entire file. This allows you to make concise, well-crafted commits that make for an easier to read history.

AnarchistArtificer,

Yay, learning!

pomodoro_longbreak,
@pomodoro_longbreak@sh.itjust.works avatar

Highly recommend throwing –patch on any git commands you’re used to using. You will have the prettiest, most atomic fkn commit, I’m serious people will love you for it.

I mean many people won’t care, but the quality folk will notice and approve.

Johanno,

We make a singular commit per feature.

KairuByte,
@KairuByte@lemmy.dbzer0.com avatar

I always find this hard to follow personally.

pomodoro_longbreak,
@pomodoro_longbreak@sh.itjust.works avatar

Trunk based, eh? Yeah, we do that on a couple teams where I’m at, too. I like the philosophy, but force pushing the same commit over and over as you’re incorporating review feedback is antisocial, especially when you’ve got devs trying to test your changes out on their machines.

Omgpwnies,

eh, just squash and merge. Feature branch can be messy as long as main is clean

Johanno,

Yep. You have to make sure your feature branch works.

oce, (edited )
@oce@jlai.lu avatar

Or just use a good IDE that makes doing atomic commits pretty natural.

pomodoro_longbreak,
@pomodoro_longbreak@sh.itjust.works avatar

I’ve only tried the VS code hunk stager thing, and found it cumbersome compared to command line, but if you can make a GUI work for you ya go for it. I’ve never found it worth the trouble personally

dukk,

Shout out to Lazygit for letting me stage individual lines

pomodoro_longbreak,
@pomodoro_longbreak@sh.itjust.works avatar

Looks pretty neat. I like that it shows the commands it’s issuing!

oce,
@oce@jlai.lu avatar

You should try the JetBrains IDEs, as the other said, you can pick changes line by line graphically, when you commit, when you do a diff with another branch or when you fix conflicts. It’s much more convenient than commands and terminal text editors.

Aceticon, in Need a rust version too.

You use Assembly.

You describe each and every leg movement and each and every step to the castle and over the castle bridge and inside the castle.

You somehow end up in the castle kitchen.

sunbeam60, (edited )

Or more precisely. You end up in a dark room. You’re not sure it’s in the castle.

nilloc,

And the only way back is by counting every step you took on the way in, and if you miss one, the castle buries you.

mindbleach,

But if you’re right, you have the princess and return home before the guards are done drawing their swords.

nqgrl, in Not mocking cobol devs but yall are severely underpaid for keeping fintech alive

I think some COBOL consultants are very well paid, especially since they are a rare breed.

tty5,

Friend has a cobol + IBM AIX combo going for him and his on call + at most 1 day/week of work position pays more than my full time very senior dev role.

Unforeseen,

Hmm I have the AIX half of that. Maybe learning COBOL is worth the pain…

tty5,

Idk what the AIX job market is right now, but several years ago banks in central Europe poached employees back and forth just to reach minimum staff required.

Kata1yst,
@Kata1yst@kbin.social avatar

I know a person who does AIX consulting with Cobol. She works about 4-8 weeks a year spread between 3 companies and makes enough to raise a family and fund a massive hobby farm. Helps to be in an area with a large fintech presence I imagine.

Unforeseen,

Very nice, yeah that’s the problem. I broke into AIX in the wholesale industry in early 2000’s so I have very few finance connections, which is where it all seems to be.

I have also been work from home for 7 years now and figured I’d have to go onsite for banks. That may have changed post covid. I will poke around and see what might be out there for me

fibojoly,

The OGs are. The new trainees ain’t.
Which makes sense, but they are still being seriously taken advantage of.

Doug, in every damn time ...

No, but I’m gonna run his code anyway

Fades, in Works on my machine

Every time I hear this from one of my devs under me I get a little more angry. Such a meaningless statement, what are you gonna do, hand your pc to the fucking customer?

1984,
@1984@lemmy.today avatar

“my devs under me”

Lols.

platypode, (edited )
@platypode@sh.itjust.works avatar

doesn’t understand that this is a useful first step in debugging

reacts with anger when devs don’t magically have an instant fix to a vague bug

Yep, that’s a manager

Belzebubulubu,
@Belzebubulubu@mujico.org avatar

You are seeing the next CEO of that company

Baizey,

…yes? I thought we made that clear with containerization

FaceDeer,
@FaceDeer@kbin.social avatar

It's not actually meaningless. It means "I did test this and it did work under certain conditions." So maybe if you can determine what conditions are different on the customer's machine that'll give you a clue as to what happened.

The most obscure bug that I ever created ended up being something that would work just fine on any machine that had at any point had Visual Studio 2013 installed on it, even if it had since had it uninstalled (it left behind the library that my code change had introduced a hidden dependency on). It would only fail on a machine that had never had Visual Studio 2013 installed. This was quite a few years back so the computers we had throughout the company mostly had had 2013 installed at some point, only brand new ones that hadn't been used for much would crash when it happened to touch my code. That was a fun one to figure out and the list of "works on this machine" vs. "doesn't work on that machine" was useful.

lseif, in We've come a long way baby

normalize memes with monospace font

lvxferre, in “It’s not that hard”
@lvxferre@lemmy.ml avatar

Musk being an assumer (note how he’s vomiting certainty on future events) doesn’t surprise me a tiny bit.

UID_Zero, in Client did not pay?
@UID_Zero@infosec.pub avatar

Better option, have a good contract in place.

Obligatory Mike Montiero video “Fuck you, pay me” - youtu.be/jVkLVRt6c1U

aspitzer, in It's that time of the year again!

wait until it hits little bobby tables…

xkcd.com/327/

JohnDClay,
jaybone,

He drops when you are sleeping. He drops when you’re awake.

rufus,

Come they told me, pa rum pum pum pum A new born King to see, pa rum pum pum pum Our finest gifts we bring, pa rum pum pum pum To lay before the King, pa rum pum pum pum, rum pum pum pum, rum pum pum pum,

So to honor Him, pa rum pum pum pum, When we come.

Little Bobby, pa rum pum pum pum I am a poor boy too, pa rum pum pum pum I have no gift to bring, pa rum pum pum pum That’s fit to give the King, pa rum pum pum pum, rum pum pum pum, rum pum pum pum,

Shall I play for you, pa rum pum pum pum, On my unsanitized database inputs?

affiliate, in Not mocking cobol devs but yall are severely underpaid for keeping fintech alive

what i’m gathering from this thread is that i should learn cobol

onlinepersona,

Yeah man, it can’t be worse than JS, right?

CanadaPlus, (edited )

From when this has come up in the past, it’s a lucrative career path, but probably tricky to break in to since nobody’s maintaining a COBOL system they can afford to put into the hands of someone inexperienced.

The dudes earning half a million are able to do so because they’ve been at it since before their boss was born.

Knusper,

Yeah, and from what I understand, learning the language itself isn’t the hard part. It actually has rather few concepts. What’s difficult, is learning how to program a computer correctly without all the abstractions and safety measures that modern languages provide.

Even structured programming had to be added to COBOL in a later revision. That’s if/else, loops and similar.

CanadaPlus,

It seems that back in the day, people effectively ran a simple compiler by hand on paper. It could work pretty well; Roller Coaster Tycoon was famously written in assembly.

rottingleaf,

Well, I only wrote simple exercises in Intel assembly in uni, but there were more of those with AVR assembly.

You can structure things nicely and understandably if you want.

It’s an acquired skill just like many others. Just today writing something big fully in assembly is not in demand, so that skill can usually be encountered among embedded engineers or something like that.

CanadaPlus,

Is there a tutorial you could recommend? I’m actually pretty curious how exactly you would go about that now.

rottingleaf, (edited )

Sorry, I don’t remember what I used then as a tutorial, possibly nothing, and I don’t write assembly often, it was just an opinion based on the experience from the beginning of my comment. That said:

You have call and return, so you can use procedures with return. You have compare and conditional jump instructions. And you have timers and interrupts for scheduling. That allows for basic structure.

You split your program functionally into many files (say, one per procedure) and include those. That allows for basic complexity management.

To use OS syscalls you need to look for the relevant OS ABI reference, but it’s not hard.

So all the usual. Similar to the dumber way of using C.

In general writing (EDIT: whole programs, it’s used all the time in codecs and other DSP, at the very least) in assembly languages is unpopular not because it’s hard, but because it’s very slow.

pomodoro_longbreak,
@pomodoro_longbreak@sh.itjust.works avatar

Once you get into it you’ll wonder how you ever programmed without “divisions”! I mean honestly, just declaring variables anywhere? Who needs that. Give me a nice, defined data division any day 😌

pomodoro_longbreak, (edited ) in I'll just be a quick 3h
@pomodoro_longbreak@sh.itjust.works avatar

Man I don’t regret leaving this behind at my last job. You start out by doing someone a one-off like “sure I can pull the top 5 promotional GICs broken down by region for your blog article - I love supporting my co-workers!”

Then requests become increasingly esoteric and arcane, and insistent.

You try to build a simple FE to expose the data for them, but you can’t get the time approved so you either have to do it with OT or good ol’ time theft, and even then there’s no replacement for just writing SQL, so you’ll always be their silver bullet.

applebusch,

At that point you teach them how to do it themselves. Isn’t there a way to give them an account that only has read access so they can’t inadvertently screw up the database?

lazyslacker,

In Oracle you’d just set up a user that has limited access and give them those credentials. Creating a few views that pulls in the data they want is a bonus.

pomodoro_longbreak,
@pomodoro_longbreak@sh.itjust.works avatar

I like that idea, and it actually did work for our Marketing guy (Salesforce has a kind of SQL). Near the end there, I just had to debug a few of his harder errors, or double check a script that was going to be running on production.

Never thought of it for Postres or Mysql, etc, but I suppose there’s got to be an easy enough way to get someone access

4am,

phpmysqladmin 😆

agent_flounder, in Devotion to duty
@agent_flounder@lemmy.world avatar

Die Hard: Five Nines

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

    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 1191936 bytes) in /var/www/kbin/kbin/vendor/symfony/http-kernel/Profiler/FileProfilerStorage.php on line 174

    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in /var/www/kbin/kbin/vendor/symfony/error-handler/Resources/views/logs.html.php on line 38