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.

MagicShel , in Welcome to the wonderful world of code obfuscation

I’d make it a named function for clarity and testability and proceed to give zero shits how it is implemented. I would unironically write this code if it worked, but I wouldn’t inline it to reduce the cognitive load of reading it.

Cosmicomical ,

This, and maybe a couple of unit tests

TheSlad ,

7 unit tests should be enough I think

Cosmicomical ,

Lol i can't lie, it took me a while to get the joke. I feel so dumb

Cosmicomical , in Welcome to the wonderful world of code obfuscation

You forgot weekend = dayOfWeek.name[0] == 'S';

xmunk ,

Can confirm this works completely as expected when the user’s system is set to lang=ES.

Schmeckinger , (edited )

Simple save the users language setting in a variable, change it to english, check if the first letter is “s” and then change the language back.

xmunk ,

Genius.

Cosmicomical ,

true but that's a precondition to some of the other examples as well

killeronthecorner , in Debugging
@killeronthecorner@lemmy.world avatar

I’m not sure if this is a direct quote from Your Code as a Crime Scene, but it’s a good book and takes this same stance!

OneCardboardBox , in Welcome to the wonderful world of code obfuscation

Interesting that your days are 1-indexed. What happens on nullday?

xmunk ,

Zat is vhen ve party!

coloredgrayscale ,

Undefined

koper ,

Reserved for future use

idunnololz , in Debugging
@idunnololz@lemmy.world avatar

Hey. Sometimes the bug is in a third party library. I didn’t do it. I swear!

AnarchoSnowPlow , in me_irl

Also me waiting for the junior dev to address review comments satisfactorily.

aurelian ,
@aurelian@lemmy.ml avatar

It’s a game where they try to make you impatient enough that you do it for them.

RagingRobot ,

Maybe offer to pair with them?

Maoo , in Yes
@Maoo@hexbear.net avatar

You’re not at scale unless you’re deploying OpenStack to run a WordPress site.

msage ,

Which is hilarious since PHP scales incredibly well on its own.

Maoo ,
@Maoo@hexbear.net avatar

Regrettably, it does do that

moonpiedumplings ,

No I swear, I was gonna do more than that.

Maybe like, a static site as well. And a backup server. Y’know, things you need openstack for.

*looks away guiltily*

moonpiedumplings.github.io/…/build-server-2/

eluvatar , in Welcome to the wonderful world of code obfuscation

Honestly the first one is the only one that works when people define the first day of the week differently. On the other hand, it does make you wonder. If Sunday is the first day of the week (as it is in many places) then how is it also part of the weekend?

subignition ,
@subignition@kbin.social avatar

Yeah it's the front end of the week and Saturday is the rear end

Esca ,

But if you’re worried about locale, you can’t assume people use the string “Saturday” to describe Saturday either. That solution only works in English.

jonne ,

I assume this is in a language where the first day of the week is a fixed part of the language (like JS).

Halosheep ,

They’re the week’s ends, front and back.

Schrolli97 ,

Thats not really one weekend then though, is it? Its more like last week’s post-week weekend and this week’s pre-week weekend

quinkin , in GoOn

1 and 0. Some assembly required.

MystikIncarnate ,

32 or 128 of them, depending on protocol.

Socsa , in Yes

This is false, you also need vim and tmux

Rin ,

Idk about you but I use echo and sed to edit my files.

clearleaf ,
Telodzrum ,

Microsoft Word is the only text editor I need.

extant ,

I think you mean edit for ms-dos.

nomecks ,

One Note

And009 ,

A Notebook

xav , in GoOn

I’ll start.

0.0.0.1: Sophie

Your turn.

starman2112 ,
@starman2112@sh.itjust.works avatar

0.0.0.2 is Bob

tamiya_tt02 ,

0.0.0.3 is Clarence

1847953620 ,

0.0.0.4 is Darryl

v81 ,

127.0.0.1 is you

NocturnalMorning , in Debugging

I know there’s a crime because my code runs, but it doesn’t do what I asked it to do.

Zacryon ,

The fact that it runs means that it has something delinquent to it. Otherwise it wouldn’t run. Better run after it and catch it. /j

(That was a bad pun and I am not sorry. It’s 3 am here and I can’t sleep. This helped me to burn a minute. Thank you.)

MurdoMaclachlan , in Debugging
@MurdoMaclachlan@lemmy.world avatar

Image Transcription: YouTube Comment


@davidm.313

“Debugging. The game where you are the criminal, the victim, and the detective at the same time. But you probably don’t know where the crime took place, or what it was. But there definitely is a crime.”


I am a human who transcribes posts to improve accessibility on Lemmy. Transcriptions help people who use screen readers or other assistive technology to use the site. For more information, see here.

Zacryon ,

Good human.

CJOtheReal , in Debugging

Its usually a typo lol

DeltaTangoLima , in Debugging
@DeltaTangoLima@reddrefuge.com avatar

My biggest problem isn’t discovering my own crime. It’s trying to determine what my motive was at the time.

agent_flounder ,
@agent_flounder@lemmy.world avatar

“I plead insanity”

Gormadt OP ,
@Gormadt@lemmy.blahaj.zone avatar

Usually my motive is, “It’s 3am I’ll just put this temp placeholder here and fix it in the morning.”

Proceeds to not fix it due to forgetting by the morning

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