programmer_humor

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

mvirts, in no.. just no

Remember kids, JSX is just function calls. It can’t hurt you.

Thcdenton,

Oh it can and it did.

kpw, in no.. just no

The most offensive thing here is the amount={5} attribute. What is it? It's not XML.

MostlyHarmless,

It’s JSX. It’s used to embed markup into javascript

sndrtj,

It’s to embed Javascript into embedded markup in Javascript

ABC123itsEASY,

It’s a react component and that would be the proper way to give a numerical value in jsx

Huschke,

JSX has grown beyond react, so without further context it doesn’t have to be react.

purplemonkeymad, in git commit -m "hotfix"

I’m sure that commit will be fixed in sort order and not remain that way until it becomes a “we don’t know why, but just do this bit.”

hakunawazo, (edited )

Just comment out the window until it is fixed. Either way it isn’t dangerous as long as you surround it with try/catch.
But I don’t know exactly about that catch part if something happens a few miles above.

Potatos_are_not_friends, 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

olafurp, in ifn't

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

Appoxo,
@Appoxo@lemmy.dbzer0.com avatar

ifnt instead of ifn’t

Dasnap, (edited ) in Guys! Should I accept the offer? 😂
@Dasnap@lemmy.world avatar

This reminds me of heart4heart levels in LittleBigPlanet.

prongs,

I miss that game. Not much tickles the same creativity and playfulness that I’ve tried since then. I used to spend hours in the level creator doing dumb stuff.

jaybone, in Fitbit Clock Face

Clocky McClockface

Use datatypes

sbv, in The Holy Trinity of JavaScript

Sorry, 0 == ‘t’? What?

jtk,
@jtk@lemmy.sdf.org avatar

Yeah, it’s true. I knew all the other ones, had to put that one in the dev tools console to believe it. I was just happy to know === continues to be sane in that comparison.

Limitless_screaming, (edited )
@Limitless_screaming@kbin.social avatar

that's not "t", it's "\t" which is just a tab. There's also "\n" for newline.

MinekPo1,
@MinekPo1@lemmygrad.ml avatar

yeah but why is a single character string containing a tab equal to zero ???

Limitless_screaming, (edited )
@Limitless_screaming@kbin.social avatar

That would be weird if a string containing a space wasn't equal to 0 " " == 0, but that's not the case in JS. If you think that "" and " " being equal to 0 is weird then I agree, but since they are, you should expect "t" and "n" to equal 0 too.

Ephera,

The == operator in JS will try to cast the things being compared and do all kinds of ‘smart’ assumptions about what equality means. This is why everyone uses === instead…

8bitguy,

Unless you enjoy inviting the chaos.

sbv,

It’s a slash-t in the comment. Maybe kbin has different rendering rules for comments?

https://sh.itjust.works/pictrs/image/7026f17a-f237-49d3-8d80-28632876acdb.png

Limitless_screaming, (edited )
@Limitless_screaming@kbin.social avatar

Oh, in that case I replied to @MinekPo1 with my answer to that. BTW can you see the slash in: t and "t".

sbv,
Limitless_screaming, (edited )
@Limitless_screaming@kbin.social avatar

My bad. I just edited it. "t" t It's displaying correctly on Lemmy.world. So it seems like another Kbin only issue.

Sonotsugipaa,
@Sonotsugipaa@lemmy.dbzer0.com avatar

It still makes no sense though

Limitless_screaming,
@Limitless_screaming@kbin.social avatar

If " " wasn't equal to 0, it wouldn't make sense, but since a string containing a space equals 0, you'd expect the same to apply to a string containing a tab or a newline. (or at least I'd expect that)

FaceDeer,
@FaceDeer@kbin.social avatar

I admit I have never dabbled in javascript, despite being a proficient programmer. I now dread to ask... would any string that contains only whitespace == 0? " \t\n \t " for example?

Limitless_screaming,
@Limitless_screaming@kbin.social avatar

Yes, it would. Just like a string of spaces " " == 0, but it isn't that bad; === is Javascript's version of == in other languages, and, thus, you should be using it if you don't want that wonkiness.

== is just for convenience, like when you want to make sure that the user didn't leave the form empty and the button shouldn't be greyed out, and other UI stuff. Without these kinds of features JS wouldn't be used in so many toolkits.

atx_aquarian,
@atx_aquarian@lemmy.world avatar

Ok, I always mistakenly assumed === was the identity operator in JS, too. TIL, thanks! As much as we like to poke fun at JS, every time I’m taught the rationale behind some aspect of it, I find it redeeming and even a little endearing.

bitcrafter,

The explanation given to you makes it sound like == was deliberately designed to be a more convenient version of ===, but what actually happened was that == used to be the only equality operator in JavaScript, which meant that if you didn’t want it’s auto-coercing behavior then you needed to go out of your way to add additional type checks yourself. Because this was obviously a tremendously inconvenient state of affairs, the === operator was introduced later so that you could test for equality without having to worry about JavaScript doing something clever underneath the hood that you weren’t expecting.

masterspace, (edited )

The explanation given to you makes it sound like == was deliberately designed to be a more convenient version of ===

I mean technically == was deliberately designed to be a more convenient version of other languages’ == operator… Just specifically more convenient for light UI stuff since that was all JavaScript was supposed to be used for at the time (or all they thought it would be used for).

But give programmers a way to write and execute a small script and someone will eventually use that to try and write an emulator that emulates the computer it’s running on, so the web evolved into more complicated applications, and then that convenience turned out to be wildly inconvenient, not to mention horribly unexpected for programmers coming from other languages, so then they added the triple equality to match other languages.

Blackmist,

You have to remember that the underlying principle of JavaScript seemed to be “never throw an error”, even if what it’s being told to do is weapons grade bollocks.

sheepishly, in We're not the same! (period)
@sheepishly@kbin.social avatar

Jokes on you, the reason I don't open source my code is because I never finish writing it

dan,
@dan@upvote.au avatar

But that’s one of the benefits of open source. Post your code and find someone else to finish it :D

itsnotits,

Joke’s* on you

(Short for “The joke is on you”.)

sheepishly,
@sheepishly@kbin.social avatar

Jokes on you, my apostrophe key is broken

dantheclamman,
@dantheclamman@lemmy.world avatar

Commitmentphobe

nissenice, in :q! to quit the Force

False! A proper Vim user would never put their hand on the arrow keys.

hakunawazo, (edited )

Always on hjkl to move, and always ready to insert (i), append (a) or insert before (O) or after (o) line and fast escape with esc.
For search and rescue missions usually use the /.
They need a vim drill before combat.

rgb3x3, in Programmer tries to explain binary search to the police

I’m realizing now that this would have been super useful when I worked in Loss Prevention way back when. Wish I had known…

coloredgrayscale,

Even without algorithm knowledge it should be fairly obvious that you can just fast forward several minutes and check if the item has gone missing.

Not the most efficient solution, but beats watching the entire tape in real time.

pressanykeynow,

You can now go back working there with this new secret technique.

xthexder, (edited ) in Walking Desk Is More Annoying Than A Standing Desk
@xthexder@l.sw0.com avatar

I feel like a treadmill desk would have been way simpler. Unless you like sun glare and spotty wifi.

sbv,

Okay, now put the whole thing on wheels. I can finally go grocery shopping during my scrum.

SinTacks,

Wolfram uses a walking desk but it’s more of a laptop support like a baby bjorn. I kind of want one but looks like they need a bit of customizing.

MostlyBlindGamer,
@MostlyBlindGamer@rblind.com avatar

There are also under-desk treadmills that you can use with an existing standing desk. You need to be able to raise it a bit higher though.

SinTacks,

The point would be to be outside. Were traveling right now and I can’t find the link but if you search for wolphrams life hacks type of thing there’s an article he wrote about it which was a fascinating read.

Personally I have an elliptical at home with a laptop stand on it and I love it.

Potatos_are_not_friends, in Someone has started answering to the github stalebot with memes

After a extremely long week, I sometimes participate in open source. I have to deal with malicious commits. I have to follow up on issues from misguided individuals who are actually looking for tech support. I have to guide new contributors to how this massive repo works and to submit tests. I have to negotiate with the core team and these convos can often last months/years.

And contributing to open-source is one of the few things that give me pleasure, even if it’s a extremely thankless job.

But I’m tired man.

I’m not dealing with low-quality memers who are providing zero value. Nor should we encourage it.

Anders429,

I would argue that in this case the maintainers are in the wrong for not even responding to the issue, not the reporter responding with memes.

db0, (edited )
@db0@lemmy.dbzer0.com avatar

I do FOSS as well, but I’d rather people have fun punting the stalebot than just keep repeating “this issue still exists”. I will probably get a chuckle out of it.

peopleproblems, in The Perfect Solution

oh Jesus

did this come full circle?

we used python to query chatgpt to decide if a number is even or odd and return true or false?

Ephera,

True or false or null.

Mathematicians didn’t know it yet, but numbers can now be even, odd or neither.

dan,
@dan@upvote.au avatar

True or false or null.

Ah, yes, a three-state boolean.

lars,
Natanael,

Non integers certainly aren’t even or odd, so yes?

Ephera,

Yeah, I’m chalking that up to Python’s untypedness. I was going to write “integers”, but technically that function takes a “num”, whatever that is.

For all we know, it could be a string, asking ChatGPT to hack the government. Is that even? Probably no. Or None. Or T-Rex. Without reading the entire function, we don’t know that it’s not returning T-Rex.

Thankfully, it doesn’t matter. Just stick the result into an if-else, then False and None will land you in the else-branch. And both True and our Truthiness-Rex will land you in the if-branch. Just as Guido intended.

…this rant brought to you by trauma.

peter, in Sydney is very concerned about lost data
@peter@feddit.uk avatar

There’s something really depressing about an AI telling a suicidal person they’re not alone and referring them to the vague notion of “national resources” or “a helpline”

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