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.

marcos , in every damn time ...

Trust the author? Are you crazy? Do you have any idea how many dumb mistakes I’ve caught the author doing?

flambonkscious ,

They’re getting worse, too

(Assuming my experience is anything to go by)

space , in Welcome to the wonderful world of code obfuscation

You want to expand your business to Europe. Bam, your code is broken, in Europe the week starts on Monday.

Than you want to expand to the middle east. Bam, broken again… Because in arab countries and Israel, the weekend is on Friday and Saturday.

Then you want to expand to Mexico and India. Bam, broken again, their weekend is only on Sunday.

Hadriscus ,

I was wondering why the second example returned monday and tuesday. I had no idea the week could start any day other than monday

kogasa ,
@kogasa@programming.dev avatar

The obvious solution is to inject an IWeekendDaysOfWeekProvider service in the inversion of control container. In your, uh, javascript web app.

coloredgrayscale ,

Just npm install isWeekend for the required locales.

Depends on: isMonday, isTuesday,…

Elderos ,

This but non-ironically.

RonSijm ,
@RonSijm@programming.dev avatar

Not using CultureInfo.InvariantCulture for basically everything

AndyLikesCandy ,

This dude(ette) globalizes.

dan , in A lot of YAML
@dan@upvote.au avatar

Friendly reminder if you prefer dealing with JSON - YAML is a superset of JSON, so any valid JSON is also valid YAML.

magic_lobster_party ,

That’s more of a weakness of yaml. There’s so many ways to specify the exact same thing. Not exactly what you need for configuration files maintained by multiple people. It easily becomes an big incoherent mess.

In JSON the default way is the only way. Nice and coherent.

dan ,
@dan@upvote.au avatar

I agree that YAML is painful and it really seems like it’s had a lot of feature creep.

JSON is painful in its own way too, though. There’s a lot of syntax noise from things like braces, quotation marks, etc, so it’s easy to make a mistake. Regular JSON doesn’t allow trailing commas.

YAML tried to solve some of that, and did succeed in some ways, but introduced its own issues.

TOML seems great to me, but maybe it has its own issues. TOML actually has defined data formats for things like dates (both offset and local) and times, which is missing from both JSON and YAML so every app ends up doing it its own way.

XTornado ,

One big thing of JSON I hate is that sometimes is used for config files or similar and it doesn’t supports comments which sucks.

rambaroo ,

JSONC does support comments but it wouldn’t be interoperable with anything expecting pure JSON. But still useful for local configs.

theterrasque ,

Found out the hard way that no, it’s not… there are a few valid json files that most yaml parsers choke on

Synthead , in A fun simple game

You’ll get an OSError if you try to remove a directory with os.remove

docs.python.org/3/library/os.html#os.remove

KairuByte ,
@KairuByte@lemmy.dbzer0.com avatar

I was gonna say, isn’t os.remove only for files? Docs say yes.

Zron ,

Delete a random one of the System DLLs

It’ll crash good and hard after a game or 2

yum13241 ,

Just delete hal.dll.

CivBase ,

shutil.rmtree(‘C:\Windows\System32’)

towerful , in What's your most obscure binding?

I guess the obvious one is “holding spacebar for control key”

andrew ,
@andrew@lemmy.stuart.fun avatar

Look, my setup works for me. Can you please just add an option to reenable spacebar heating?

Crul ,

Reference: xkcd - Workflowxkcd: Workflow
https://xkcd.com/1172/Hover text: There are probably children out there holding down spacebar to stay warm in the winter! YOUR UPDATE MURDERS CHILDREN.

JokeDeity ,

This is me. I will find a way to make it work, it will be janky, and any update is liable up throw the entire thing into disarray.

intelati ,

That’s horrifying

FlickOfTheBean , in What's your most obscure binding?

I typically don’t know what I’m doing, so my favorite binding is :q!

Thyrian , in Apple donation

Was propapbly an emberassed employee paying it out of his own pocket, just pretending his company would even care a tiny bit.

TheTetrapod ,

The last time this was posted, people were speculating that Apple does donation matching for employees, so they only did this unconsciously.

Schmeckinger ,

Last time this was posted someone said apple matches employee donations and someone probably donated 24 and apple matched it.

PP_BOY_ ,
@PP_BOY_@lemmy.world avatar

$5-24*

But yeah, this is 100% the case of Apple matching an employees donation

RustySharp ,

Or, someone donated 2.5-12, Apple matched it and filed the whole thing under their corporate account.

igorlogius , (edited ) in Imagine
@igorlogius@lemmy.world avatar

i could see that as a powershell “feature”, which allows microsoft to sell adspace in the command line that reaches technicans and administrators

!aboringdystopia

edit: fixed link

GhostsAreShitty ,

I was going to say, I’m surprised this isn’t a Windows 11 “feature”

igorlogius , (edited )
@igorlogius@lemmy.world avatar

cut them some slack, they can’t put every annoyance into one version … got to leave something for future “upgrades”

President_Pyrus ,
@President_Pyrus@feddit.dk avatar

If you write !aboringdystopia instead the link is usable for any instance.

igorlogius , (edited )
@igorlogius@lemmy.world avatar

i always forget. i am just to used to markdown. Thanks for the reminder.

SturgiesYrFase ,
@SturgiesYrFase@lemmy.ml avatar

Ahhhh…THANK YOU! r/boringdistopia was one of the few subreddits I have been still missing.

igorlogius ,
@igorlogius@lemmy.world avatar

no problem … enjoy … kind of … maybe.

Brustadnrift ,

Maybe for the first time Ubuntu could get to sue them for infringing on their innovation.

canihasaccount ,

Good lord, I hope no one employed at Microsoft reads this. I would bet they institute it if they think of it.

Glarrf , in Gourmet Programmer

The codebase I’m working on would give chatGpt an aneurysm. I’m actually a ghost.

onelikeandidie ,

I’m guessing you’re using opencart cuz I’ve been working with an old codebase for around a year and I would love if any code analysis or intelisense actually worked… on xml files… with php in them… with javascript in php variables… with calls to php inside xml files…

Zink ,

Yo dawg, I heard you like code

nerdschleife ,

Lmao I asked chatgpt to restructure a POST API to a bash file and it started writing fan fiction

alcasa ,

I never knew I needed API fanfiction

insight06 , in Quantum Lock suspends sales due to developers losing access to source code

A good decompiler and an auto-formatter might leave them with a nicer copy of their source code than they had in the first place.

warmaster ,

QL was our first game and although it was a big disappointment losing the source code it was lost at a time before we understood decompiler and auto-formatter software.

FaceDeer ,
@FaceDeer@fedia.io avatar

The time at which the source code was lost is irrelevant for decompilation, decompilation uses the binary files. Those are the files that are out there being played right now.

Until recently decompilers tended to produce rough and useless code for the most part, but I'm looking forward to seeing what modern LLMs will bring to decompilation. They could be trained specifically for the task.

awesome_lowlander ,

You’re missing the point of the comment you’re replying to, which is that the devs don’t understand decompilers RIGHT NOW, and it’s formatted in a tongue in cheek way similar to their current comment about VCS

laughterlaughter ,

Great. Hallucinated decompiled code.

I’m all for AI, but there’s gotta be a better way for machines to become intelligent. Not just “training and predicting without any thought in the process.”

FaceDeer ,
@FaceDeer@fedia.io avatar

You're welcome to try other methods but LLMs seem to be working best so far.

With a decompiler it should be pretty straightforward to automatically check for "hallucinations," the compiled code is still right there and you can compare the decompiled logic to the original.

laughterlaughter ,

You have a point. I guess we could compile the decompiled code and compare the binaries.

Reddfugee42 ,

I like how you’re willing to comment on things you completely don’t understand. That shows chutzpah.

warmaster ,

Read it enough times so that you uncover the comment’s true meaning. If you give up, I can give you a tip.

Aatube OP ,

Have you actually read my post?

rbn , (edited ) in If C++ wore pants

If I were C++, I’d wear my pants like that.Pants are pulled over both ends of the uppercase C with one leg going to each of the plus characters.

On the opposite ends of the plus characters I’d put my shoes obviously.

victorz ,

I will allow this.

0ops ,
vzq , in Bold Ideas For Funding Open Source Software

Paging the “how can we monetize peertube” dude that went aggro on the fediverse community few days ago.

TootSweet , in How I date

I think that’s just how every Rust developer learns Rust.

vk6flab , in How big is your desk?
@vk6flab@lemmy.radio avatar

So, when you use 40 or so programming languages, your employer needs to supply a mansion…

I’m okay with that.

Now, where is the boss?

30p87 ,

'Yes boss, I need 16-Bit, 32-Bit and 64-Bit Arm and x86_64 ASM as well as MySQL, SQLite, Postgres, Firebird, Mongo and all other stuff too, so I need a lot of computers … of course all with Threadripper PRO 7995WX’s.

ZeroCool OP ,
@ZeroCool@vger.social avatar

Corporate be like “mandatory return to office aircraft hangar.”

nothacking , in C++

Hot take, C is better then C++. It really just has one unique footgun, pointers, which can be avoided most of the time. C++ has lots of (smart)pointer related footguns, each with their own rules.

Venator ,

Then C++ what?

MajorHavoc ,

Yeah. My journey of love, loathing, hatred, adoration, and mild appreciation for C++, ended with the realization that 90% of the time I can get the job done in C with little hassle, and a consistent, predictable, trustworthy set of unholy abominations.

Valmond ,

If you do C, and avoid pointers, do tell me what the point is using the language at all?

I mean if memory management is “the only way to shoot yourself in the foot” in C, then thats a quite big part of the language!

uis ,

If you do C, and avoid pointers, do tell me what the point is using the language at all?

Person is saying that C has one big footgun, while C++ has armory of them

Valmond ,

C is like one big problem then :-D

C++ lots of smaller problems: divide & conquer baby!

jas0n ,

But it’s a single problem.

AProfessional ,

C++ literally makes it easier to avoid raw pointers and allocation that are dangerous…

jas0n , (edited )

Preach brother, I don’t think that’s a hot take at all. I’ve become almost twice as productive since moving from c++ to c. I think I made the change when I was looking into virtual destructors and I was thinking, “at what point am I solving a problem the language is creating?” Another good example of this is move semantics. It’s only a solution to a problem the language invented.

My hot take: The general fear of pointers needs to die.

porgamrer ,

I’m not a fan of C++, but move semantics seem very clearly like a solution to a problem that C invented.

Though to be honest I could live with manual memory management. What I really don’t understand is how anyone can bear to use C after rewriting the same monomorphic collection type for the 20th time.

jas0n ,

Maybe I’m wrong, but aren’t move semantics mostly to aid with smart pointers and move constructors an optimization to avoid copy constructors? Neither of which exist in c.

I’m not sure what collection type you’re referring to, but most c programmers would probably agree that polymorphism isn’t a good thing.

porgamrer ,

That’s what std::move does, and you’re right that it’s quite an ugly hack to deal with C++ legacy mistakes that C doesn’t have.

I say move semantics to refer to the broader concept, which exists to make manual memory management safer and easier to get right. It’s also a core feature of Rust.

Also I’m talking about parametric polymorphism, not subtype polymorphism. So I mean things like lists, queues and maps which can be specialised for the element type. That’s what I can’t imagine living without.

jas0n ,

Hahaha. I knew I was wrong about the polymorphism there. You used big words and I’m a grug c programmer =]

We use those generic containers in c as well. Just, that we roll our own.

Move semantics in the general idea of ownership I can see more of a use for.

I would just emphasize that manual memory management really isn’t nearly as scary as it’s made out to be. So, it’s frustrating to see the ridiculous lengths people go to to avoid it at the expense of everything else.

porgamrer ,

I definitely agree on the last point. Personally I like languages where I can get the compiler to check a lot more of my reasoning, but I still want to be able to use all the memory management techniques that people use in C.

I remember Jonathan Blow did a fairly rambling stream of consciousness talk on his criticisms of Rust, and it was largely written off as “old man yells at clouds”, but I tried to make sense of what he was saying and eventually realised he had a lot of good points.

I think it was this one: m.youtube.com/watch?v=4t1K66dMhWk

jas0n ,

Just watched this. Thank you. I think I’d agree with most of what he says there. I like trying languages, and I did try rust. I didn’t like fighting with the compiler, but once I was done fighting the compiler, I was somehow 98% done with the project. It kind of felt like magic in that way. There are lots of great ideas in there, but I didn’t stick with it. A little too much for me in the end. One of my favorite parts C is how simple it is. Like you would never be able to show me a line of C I couldn’t understand.

That said, I’ve fallen in love a language called Odin. Odin has a unique take on allocators in general. It actually gives you even more control than C while providing language support for the more basic containers like dynamic arrays and maps.

porgamrer ,

The only conceivable way to avoid pointers in C is by using indices into arrays, which have the exact same set of problems that pointers do because array indexing and pointer dereferencing are the same thing. If anything array indexing is slightly worse, because the index doesn’t carry a type.

Also you’re ignoring a whole host of other problems in C. Most notably unions.

People say that “you only need to learn pointers”, but that’s not a real thing you can do. It’s like saying it’s easy to write correct brainfuck because the language spec is so small. The exact opposite is true.

jas0n ,

What’s wrong with c unions? I’ve never heard that complaint.

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