There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

programmer_humor

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

dependencyinjection , in I don't believe Auto Save feature in any software

When you do this using Word online it be like “chill dude we autosave here, we got you” and I’m like “brother I do not trust you”.

Anticorp ,

You are wise beyond your years.

QuazarOmega , in I don't believe Auto Save feature in any software

We can optimize this further:


<span style="color:#323232;">unsatisfied = true
</span><span style="color:#323232;">while(unsatisfied) {
</span><span style="color:#323232;">    key.dispatch(
</span><span style="color:#323232;">        Keyboard::Ctrl,
</span><span style="color:#323232;">        Keyboard::s
</span><span style="color:#323232;">    )
</span><span style="color:#323232;">}
</span>

…No, there is no instance where unsatisfied changes state

backhdlp ,
@backhdlp@iusearchlinux.fyi avatar

You should just be able to while(true)

Octopus1348 ,
@Octopus1348@lemy.lol avatar

It’s a joke.

Tja ,

That sounds like an excuse.

halfway_neko ,
@halfway_neko@lemmy.dbzer0.com avatar

Don’t worry, most modern brains have a builtin jit compiler, so when a habit starts to form, the check will be optimised out. (It saves excess neurons from being generated.)

Bronco1676 , in dereferencing movies

Can anyone explain the funny for me?

DumbAceDragon ,
@DumbAceDragon@sh.itjust.works avatar

Pointers are variables that don’t hold data themselves but instead hold a reference to it. It’s really common to redirect pointers to reference something other than what they originally referenced, which is the joke in this comic. He is changing the conversation so that Star Wars actually refers to Jaws.

Bronco1676 ,

Mhm yes that’s what I understood, but I didn’t understans whats funny about this? What does “I’m your father” mean if the movie is jaws?

Mirodir ,

I think the humor is meant to be in the juxtaposition between “reference” in media contexts (e.g. “I am your father”) and “reference” in programming contexts and applying the latter context to the former one.

What does “I’m your father” mean if the movie is jaws?

I think the absurdity of that question is part of said humor. That being said, I didn’t find it funny either.

Bronco1676 ,

Okay got it, thank you.

Kidplayer_666 ,

I think it’s also the fact that people are sick of the “ummm achsfhrually they never said Luke I am your father, they said No, I am your father”

survivalmachine ,

To reference a movie in common vocabulary is to bring it up in conversation.

Referencing in programming terms like C refers to assigning a value to a variable. You can re-assign those variables to new values and then de-reference (read) the new value.

They are conflating the common meaning of reference with the much more obscure programming definition (obscure at least among non-programmers).

Star wars = “no, I am your father” (reference) Jaws = movie about hunting killer shark (reference) Star wars = movie about hunting killer shark (OP is pretending we can treat movie references like variable references and re-assigns the star wars variable to mean something else) “Hey, have you seen star wars? The movie about hunting a killer shark?” (De-referencing your newly re-assigned variable)

gianni ,
@gianni@lemmy.ca avatar

I personally don’t find it funny because these types of jokes essentially boil down to “I used a concept outside of its context, and for that reason alone it is funny”. However, with a lot of these jokes the context is so narrow (i.e. programming) that they are almost universally not understood by wider audiences.

Luvon ,

I mean programmers is a pretty big audience. Sure this probably would pan at a comedy open mike night but it’s literally on programmer humor.

And using concept outside its normal concept or conflating two concepts is pretty standard humor.

gianni ,
@gianni@lemmy.ca avatar

Conflating two concepts can be funny (e.g. puns) but this isn’t that. “Dereferencing a movie ” has no meaning outside of manual memory management.

I understand humour is subjective but some jokes aren’t as strong as others (and some jokes aren’t jokes at all).

Luvon ,

Referencing is the term that is being conflated.

Enough people apparently find this funny here. Not everyone needs to find every bit of comedy funny.

outer_spec ,
@outer_spec@lemmy.blahaj.zone avatar

🤓

Jakylla , in Returns a sorted list in O(1) time
@Jakylla@sh.itjust.works avatar

inplace sort be like:


<span style="color:#323232;">def sort(list: list):
</span><span style="color:#323232;">    list.clear()
</span>
aksdb , in Sleep() at home

On microcontrollers that might be a valid approach.

Darkassassin07 ,
@Darkassassin07@lemmy.ca avatar

But then I gotta buy a space heater too…

YIj54yALOJxEsY20eU ,

Microcontrollers run 100% of the time even while sleeping.

towerful ,

Nah, some MCUs have low power modes.
ESP32 has 5 of them, from disabling fancy features, throttling the clock, even delegating to an ultra low power coprocessor, or just going to sleep until a pin wakes it up again. It can go from 240mA to 150uA and still process things, or sleep for only 5uA.

YIj54yALOJxEsY20eU ,

Nah, Sleeping != Low power mode. The now obsolete ATmega328 has a low power mode.

kevincox ,
@kevincox@lemmy.ml avatar

I’ve written these cycle-perfect sleep loops before.

It gets really complicated if you want to account for time spent in interrupt handlers.

aksdb ,

Thankfully I didn’t need high precision realtime. I just needed to wait a few seconds for serial comm.

PoolloverNathan , in Bug Fixing

One of my old programs produces a broken build unless you then compile it again.

mindbleach ,

Some code has bugs.

Some code has ghosts.

olafurp , in ifn't

I’d take a not or “if not” operator tbh.

Lmaydev ,

It has a not keyword it’s used for pattern matching.


<span style="color:#323232;">if (x is not null)
</span>
Patches ,

Stuff can be two things

olafurp ,

It also has a !=.

Lmaydev ,

Pattern matching is different.

olafurp ,

Yeah, I just said it since you used it with null. I used it a lot for enums

Lmaydev ,

The type matching is the most common thing I use it with. Combined with inline variables.


<span style="color:#323232;">if (x is string { Length: 5} s)
</span><span style="color:#323232;">{
</span><span style="color:#323232;">    // do stuff with s
</span><span style="color:#323232;">}
</span>

And switch expressions.

As a side note inline variables are amazing haha

Appoxo ,
@Appoxo@lemmy.dbzer0.com avatar

ifnt instead of ifn’t

sneaky_hecker , in DO NOT MERGE
@sneaky_hecker@lemmy.world avatar

Even if it was merged I’d be more concerned how on earth you have infinite Firefox tabs open

lone_faerie ,

It’s when you have more than 99 tabs open

DreadPotato ,
@DreadPotato@sopuli.xyz avatar

What kind of psychopath has that many tabs open!?

CrypticCoffee ,

I take personal offense to that. How do you not?

Kusimulkku ,

I close all the tabs regularly. Bookmark for those that I need to save for longer than one session

DreadPotato , (edited )
@DreadPotato@sopuli.xyz avatar

I bookmark stuff I need at a later time, or will need again, and read the stuff I want to read now and close the tab when I’m done.

Daeraxa ,

I got to that once, on mobile I’ve never worked out the rule for when FF opens a new tab vs opening a site in your current tab. They just kind of silently accumulate.

DreadPotato ,
@DreadPotato@sopuli.xyz avatar

Yeah it’s a bit weird with FF, I just purge open tabs for unnecessary tabs daily.

loutr ,
@loutr@sh.itjust.works avatar

There’s a setting to auto-close tabs after a certain amount of time.

DreadPotato ,
@DreadPotato@sopuli.xyz avatar

I like to be in control of what gets closed and when, so nothing gets closed before I bookmark it if need it.

mexicancartel ,

“Oh no! What if I need it later”

~ me, more than 99 times

leds OP ,

Yeah that’s the problem I have, started while ago. It opens a new tab instead switching to existing tab.

poplargrove ,

I keep tabs open as a sort of “read page later” list. I never seem to get to reading them though.

DreadPotato ,
@DreadPotato@sopuli.xyz avatar

So do I, for a few days. If I haven’t read it by then, I’ll either bookmark for later or just close. I pretty much never have more than 10-15 active tabs ever.

ripcord ,
@ripcord@lemmy.world avatar

As we know, scientists have not yet discovered any numbers past 99

dangblingus , in “It’s not that hard”

I know literally 0.0000000001% of 1st year CS, and even I know that Musk just googled what “type” means in this context. No shit a compiler can determine the type at compile time. That’s not what the post was about, Elon my guy.

Tischkante ,

He doesn’t care about people writing code, unless they’re underpaid and in overtime.

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

Saw this post and all the redditors getting dreamy eyed at the idea of learning COBOL.

pcmag.com/…/ibms-plan-to-update-cobol-with-watson

Nighed , (edited )
@Nighed@sffa.community avatar

The historic high salary for COBOL Devs etc is also partially due to them mostly being old and extremely experienced senior devs

lurch , in Password requirements are getting out of hand

Pretty unsafe, because it makes people prefer big letters, i.e. W

plistig ,

That’s why my password consists exclusively out of Assyrian cuneiform letters, e.g.

https://en.wiktionary.org/wiki/File:Assyrian_cuneiform_U12030_MesZL_293.svg

Yes, that’s one letter.

tetris11 ,
@tetris11@lemmy.ml avatar

The Assyrians knew what they were doing

Lysergid , in Welcome to the wonderful world of code obfuscation

weekend = dayOfWeek > 5

DroneRights OP , (edited )

Sunday is 1 0 and Saturday is 7 6. You just made Friday part of the weekend You forgot Sunday

JeffKerman1999 ,

On which planet? Monday is 1

DroneRights OP ,

I was off by one, but Sunday is 0 in javascript

Cralder ,

JavaScript is wrong

DroneRights OP ,

That’s nice, you can run weekend = dayOfWeek > 5 and then explain to the boss why clients are getting work texts on a sunday

JeffKerman1999 ,

Don’t use JavaScript on the backend ¯_(ツ)_/¯

DroneRights OP ,

I’ll be sure to tell my boss to throw away all the work he already paid for and start over in a different language. I’m sure he’ll be very understanding

emmanuel_car ,

Sunken cost fallacy

DroneRights OP ,

I don’t think you understand the concept of having a boss.

Earlier this week I proved to him that his new “more secure” password policy results in passwords that can be cracked in under a minute, and he didn’t care

xmunk ,

Sneak in a library that makes things more sane when nobody is looking…

Also, that isn’t “having a boss” it’s having a shit boss. As an engineering manager I am happy to go to bat and make excuses for time my reports spend paying down technical debt and making things more maintainable (within reason of course, and if shits really bad I can usually sneak a sustainability project into the timeline).

We’ll always need to make some compromises for our workplaces, the perfect job doesn’t exist, but what you described is a huge red flag. You deserve respect at work.

Cosmicomical ,

Yo nodejs is just plain amazing. We should just keep improving on js and replace all other languages. Js is already on all browsers, by adopting it on the server you get huge efficiency as you can move code AND coders between backend and frontend. Of course you must make the right choices of practices and frameworks for this to be possible

JeffKerman1999 ,

I agree! How many js frameworks spawned today? Which one is best?

oolio ,

Cron has clearly the superior numbering system, where sunday is both 0 and 7

kungen ,

Depending on how you’re counting your integers, Monday is 0, being the first day of the week.

Zagorath ,
@Zagorath@aussie.zone avatar

Both Monday and Sunday are used as the first day of the week with quite some regularity. It’s a completely arbitrary standard no different to "the tenth month is the one called “October”. Or dividing a day into 24 segments which are each broken into 60 smaller segments of 60 even smaller segments. You can’t say either is “wrong” per se.

Personally, I was brought up learning Sunday is the first day of the week, but at some point decided that was bullshit partly because it’s the week end. But also just from a practical standpoint when looking at a calendar, it’s useful to have the weekend days grouped together.

DroneRights OP ,

Yeah, that’s why my calendar starts the week on Saturday

Cosmicomical ,

Funny thing, september comes from the number 7, october from 8 and november and december from 9 and 10, as the year in ancient rome was starting around march. This problem is timeless.

Zagorath ,
@Zagorath@aussie.zone avatar

Huh. I knew about the problem (that’s why I used October as my example, rather than, say, February), but I was mistaken as to the cause. The way I had always heard it told, September–December don’t match their current place in the year because of the addition of July and August. But I just looked it up and it seems you’re right. Those months are merely renamings of Quintilis and Sextilis, and the numbering issue comes from moving the start of the year from March to January.

Cosmicomical ,

Phew luckily my random memory was correct this time!

theKalash ,

On planet America.

JeffKerman1999 ,

Ah the same place that uses feet and inches, and puts the month before the day, and cannot read a 24 hour clock?

4am ,

dayOfWeek is clearly represented by 1-7 in the example, with Sunday being 1.

So, I guess the answer is “depends on what date library you’re linking against”

kronicmage , in We did this to ourselves

This is referencing Philip Wadler’s 1989 paper “Theorems for Free”, which is fairly well known in the Haskell community: home.ttic.edu/~dreyer/course/papers/wadler.pdf

spicyemu ,

That looks like something I’ve seen somewhere and didn’t understand.

Mchugho , in Microsoft Edge could use a win

Is it just me or is edge actually a decent browser? It’s not like the dark internet explorer times.

tautalas ,
@tautalas@lemmy.world avatar

Yeah, I like it too

DeathWearsANecktie ,

It’s a decent browser, but half the reason people hate it is because MS tries to force it on you. They should let it stand on its own merits then maybe it wouldn’t have such a negative reception.

Shard ,

Meh, Chrome is a piece of shit as well. If you use gmail on another browser, they keep pestering you to try Chrome.

DeathWearsANecktie ,

Ye I hate chrome too

VinnieFarsheds ,
@VinnieFarsheds@lemmy.world avatar

I just opened my gmail in Firefox and I don’t see this Chrome notification right now. Maybe it pops up every now and then. I wouldn’t be bothered by it that much, since started using Thunderbird as mail client last month, and the interface is so much better and customizable than gmail ever was. I did use Thunderbird a long time ago, but stopped when I got gmail in 2004. And all this time I thought Thunderbird still had the old classic UI. Apparently it became a bit too messy with all different volunteer contributions and Mozilla didn’t have a project management to stay with a certain direction. In Feb 2023 they announced in this blog post to rebuild Thunderbird from the ground up and invest the resources to support the community again, although with more control. Then a few months ago this big update to 115 was released, which was featured in a computer tech website so I became curious again. One of the best decisions of this year (although I’m still using it to access gmail), together with joining Lemmy of course.

Pixel ,

Solution, don’t use Gmail either

skybreaker ,
@skybreaker@lemmy.world avatar

Better than Chrome for sure. Not better than Firefox

Phen ,

It’s better than chrome for sure. Depending on what your criteria for using a browser it, it might even be in the top 3 browser options.

But it’s still a Microsoft product filled with the usual Microsoft shenanigans. If you don’t care about your browser keeping track of what you do and that sort of privacy concerns, absolutely give it a try. You can even use it on Linux and Android and it works fine on those too.

One other negative aspect I can think of is that Microsoft is quite open to adhering to Google’s own shenanigans like that recent proposal they got ridiculed for. For that reason I’d rather recommend Vivaldi instead - there’s very little that edge does better than Vivaldi and there’s plenty that Vivaldi does better than it.

But also, please, consider using Firefox if you don’t have any problems with it. You’ll literally be helping make the internet a better place just by using it. So many people use chromium based browsers today that Google literally owns the way the internet works.

Mchugho ,

I’ve never really liked Firefox and I’ve tried it multiple times. As for big companies tracking data, I think that’s pretty much unavoidable at this stage and I don’t really care.

My only criteria for browsers is just stuff loading when it should and fast. Corporations are welcome to my shit data, the only thing that annoys me about that is they profit from it and I don’t.

PastorHaggis ,
@PastorHaggis@lemmy.world avatar

I wasn’t a fan of Firefox either and personally lived using edge. When the whole web integrity thing started happening, I felt like I should switch to Firefox and haven’t looked back.

I still have some complaints, like you can’t install sites native app which I used a lot. I don’t think tab groups have been implemented yet, which isn’t a huge deal but very useful. And there were a few others I can’t remember off the top of my head. In the end I value my privacy a bit more so I’ve decided Firefox is worth it.

Plus mobile ad blocking is a god send.

Tlaloc_Temporal ,

There are several, possibly dozens, of tab group extensions for firefox.

PastorHaggis ,
@PastorHaggis@lemmy.world avatar

Sure, and there’s also an extension to install a web page as an app similar to Chrome. The point is that, out of the box, it lacks some features that I enjoy. Extensions are great and I use plenty of them, but that doesn’t mean that Firefox has those features, it just has extensions that have them.

Firefox is great, don’t get me wrong, I’m definitely preferring it, but that doesn’t mean it doesn’t have all the features that I wanted up front.

CeeBee ,

you can’t install sites native app

There’s an extension that lets you do this. I use it and it works great.

I don’t think tab groups have been implemented yet

Funny thing is that forced group tabs on Chrome mobile is what made me ditch it.

PastorHaggis ,
@PastorHaggis@lemmy.world avatar

The PWA app works decent, but, unless I did something wrong, it would open links in itself instead of my main Firefox window which wasn’t what I’d want normally.

I still use it, but it’s definitely not as nice as I’d want it to be.

Definitely one of those things that’s minor and I can look past though.

CeeBee ,

and I don’t really care.

This is why we can’t have nice things, like privacy.

Mchugho ,

Just being honest. It’s only the 0.5% of nerds that use Lemmy that actually care. It’s just one more thing I can’t bring myself to care about.

JeffCraig ,

It’s because Edge is built on Chromium now.

catlover , in D or d come on

alias d=“cd ~/Downloads”

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • [email protected]
  • lifeLocal
  • goranko
  • All magazines