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.

LoremIpsumGenerator , in Every goddamn time

sudo apt-get update

*im in!

deaf_fish ,

vim

How do I get out?!

sneezycat ,
@sneezycat@sopuli.xyz avatar

-Esc twice

-:wq

-:q!

-kill the process

-fuck it pull the plug

-put a bomb in the power station that powers your house

-have a cosmic ray randomly bitflip vim’s internal logic making it quit

bluemellophone ,

ZZ

MacNCheezus ,
@MacNCheezus@lemmy.today avatar

-Good ol’ C-x M-c M-butterfly

WindowsEnjoyer ,

journalctl

I’m in!

cupcakezealot , in git commit -m "minor fixes" +26858 -69429
@cupcakezealot@lemmy.blahaj.zone avatar

kinda like on google play how it says “what’s new: no information from the developer” or “what’s new: we regularly update our app to fix bugs, improve performance and add new features”.

emptyother , in My coding skill V/S My GitHub Repositories
@emptyother@programming.dev avatar

They are all named some variant of “tutorial_Ch01” or “testprogram” probably. And one repository named “My Unnamed MMO” (or some other overly complex but trendy genre) that has like 12 lines of code so far and a crappy drawn pixelart png.

backhdlp ,
@backhdlp@iusearchlinux.fyi avatar

That’s a lot of code, I’d expect the 12 lines in the README.

abclop99 ,

There is no readme

ares35 ,
@ares35@kbin.social avatar

"check the comments in the code."

(there are none)

HawlSera , in “It’s not that hard”

This the new live action Joseph and Jotaro?

0x4E4F , in Rust project startup kit
@0x4E4F@sh.itjust.works avatar

Well, that escalated rather quickly.

Primarily0617 , in no.. just no

if you don't believe that adding more structure to the absolute maniacal catastrophe that is sql is a good thing then i'm going to start to have doubts about your authenticity as a human being

GBU_28 ,

Huh? Sql is one of the most powerful, action packed (as in you can move lots of shit with few commands) languages out there.

It’s transferable and ubiquitous.

Primarily0617 ,

powerful isn't the same as well-structured

it was written to be a language that anybody could read or write as well as english, which just like every other time that's been tried, results in a language that's exactly as anal about grammar as C or Python except now it's impossible to remember what that structure is because adding anything to the language to make that easier is forbidden

when you write a language where its designers were so keen for it to remain human readable that they made deleting all rows in a table the default action, i don't think "well structured" can be used to describe it

GBU_28 ,

Disagree, the difference between “week structured” and needing to know the rules of the verbs is pretty big, to me.

QuazarOmega , (edited )

Me trying to remember on whose output data having, count, sum, etc. work

Once you know functions you would have no reason to go back.
I propose we make SQL into this:


<span style="color:#323232;">const MAX_AMOUNT = 42, MIN_BATCHES = 2
</span><span style="color:#323232;">
</span><span style="color:#323232;">database
</span><span style="color:#323232;">    .from(table)
</span><span style="color:#323232;">    .where(
</span><span style="color:#323232;">        (amount) => amount < MAX_AMOUNT,
</span><span style="color:#323232;">        table.field3
</span><span style="color:#323232;">    )
</span><span style="color:#323232;">    .select(table.field1, table.field3)
</span><span style="color:#323232;">    .group_by(table.field1)
</span><span style="color:#323232;">    .having(
</span><span style="color:#323232;">        (id) => count(id) >MIN_BATCHES
</span><span style="color:#323232;">        table.field0
</span><span style="color:#323232;">    )
</span>

(Sorry for any glaring mistakes, I’m too lazy right now to know what I’m doing)

…and I bet I just reinvented the wheel, maybe some JavaScript ORM?

xep ,
QuazarOmega , (edited )

Thanks for the suggestion! It looks interesting, not quite what I expected looking at that file*, but that may very well be better

Edit: other examples seem a bit more similar to mine, cool!

rubythulhu ,

most languages have some first or third party lib that implements a query builder

expr , (edited )

Because you never learned SQL properly, from the sound of it.

Also, ORMs produce trash queries and are never expressive enough.

QuazarOmega ,

Because you never learned SQL properly, from the sound of it.

You might be right, though, to be fair, I also keep forgetting syntax of stuff when I don’t use it very often (read SQL (._.`))

Also, ORMa produce trash queries and are never expressive enough.

I meant to say that I would like the raw SQL syntax to be more similar to other programming languages to avoid needing to switch between thinking about different flows of logic

emptyother ,
@emptyother@programming.dev avatar

ORMs produce good queries if you know what you do. Which requires proper knowledge of SQL, unfortunately.

drathvedro ,

No. The arrow function in where eliminates any possibility of using indexes. And how do you propose to deal with logical expressions without resorting to shit like .orWhereNot() and callback hell? And, most importantly, what about joins?

cupcakezealot ,
@cupcakezealot@lemmy.blahaj.zone avatar

but sql doesn’t need to be structured that’s what abstraction layers and models are for

Lem453 ,

SQL is literally structured query language

expr ,

SQL is incredibly structured. It’s also a very good language, and developers need to stop piling on junk on top of it and producing terrible queries. Learn the damn language. It’s not that hard

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

git commit -m “changed somethings “

git push origin master

jelloeater85 ,
@jelloeater85@lemmy.world avatar

Do you always have to do origin master? I’ve seen it where sometimes just git push works and other times not.

Meowoem ,

I think it depends what branch your local version of the repo is set to. If you’re already in master then it’ll push there, if you’re in a testing branch then you can push it straight to master instead by telling it to

jelloeater85 ,
@jelloeater85@lemmy.world avatar

I just meant it not auto creating a new matching named branch.

adrian783 ,

uh in any actual company you almost never push to origin master. so I think it’s a joke.

MajorHavoc ,

Not with that attitude! /s

jelloeater85 ,
@jelloeater85@lemmy.world avatar

Force push Fridays!

Valmond ,

Depends on the configuration right?

You can work on your branch and then push that to integration for example.

I mean you’re not working on your local master/main branch right?

herrvogel ,

In most actually companies you can try push to origin master, but it’ll likely get rejected by the repo’s security policies.

TheUncannyObserver ,

That’s part of the joke, I think. If it’s a repo more than just you use, you would almost never push directly to the main branch.

zcoyle ,

where it Just Works, the branch is set up to track a remote branch

git-scm.com/book/…/Git-Branching-Remote-Branches

MajorHavoc ,

I was being more evil than that, saying that if one is gonna push direct to main, might as well maximize the possible damage to everyone else’s branch.

jelloeater85 ,
@jelloeater85@lemmy.world avatar

Lol why not just delete the whole project from GitHub… I mean, everyone has a copy, right?😱

Valmond ,

push origin your/branch

Pushes, you guessed it, your/branch!

Head is usually your checked out working branch if you’re not in a headless state, right?

jelloeater85 ,
@jelloeater85@lemmy.world avatar

Force push main, straight to jail🤣

Yup yup, usually you’re on a branch, sometimes a tag. I mean it’s all just pointers to references at the end of the day. I tend to treat Git like a story book, some folks still act like it’s SVN.

sloppy_diffuser ,
jelloeater85 ,
@jelloeater85@lemmy.world avatar

I tired that, still was having issues, weeeird.

MajorHavoc ,

You forgot this –force flag.

Valmond ,

I’m too lazy, I use -f

ensignrick , in I'll just be a quick 3h
@ensignrick@startrek.website avatar

Me this morning. I’m gonna take a look at why this Jenkins pipeline is failing. This one job starts a dozen others. Half are failing. For different reasons. After starting rewriting a job that someone half assed. Realize the original error was caused by missing input but some are still valid. Still can’t figure out why my rewritten program is erroring. Get pulled away because another program did something weird… I completed nothing today but worked a ton.

My day…

criminalunicorn ,
@criminalunicorn@feddit.uk avatar

You have perfectly described my day almost everyday.

okamiueru , in Merge then review

This is satire, right? Surely no one would put their name on that publicly?

Like someone working in a kitchen boasting about a life hack of not wasting time with hygiene.

DudeDudenson ,

Wash your hands after cooking, never let food products sit stale

affiliate ,

never chew before swallowing either. the food can still get stale in your mouth

GammaGames , in GoOn

0.0.0.0/0

Cwilliams , in Correcting > Helping

My coworkers had a hard time picking resturaunts, so I started recommending McDonald’s for work parties, and then everyone else started chiming in with actually good ideas.

savvywolf , in A box of DevOps
@savvywolf@pawb.social avatar

You know, at this point I’ve been writing YAML on and off for a while now. You’d think I actually understand the syntax by now, but I don’t.

ApexHunter ,

That’s because it is absolutely terrible. It is the first serious/real “language” I have encountered since Cobol where indent level has functional meaning. This is not good company to be in.

KrokanteBamischijf ,

The python community would like to have a word with you.

GTG3000 ,

Python has stricter rules about what can be cludged together and how.

Yaml is… Kind of nebulous, which is not a good thing for a data serialization format.

KrokanteBamischijf ,

Yeah not a fan of YAML either. I simply don’t see the benefit of getting rid of delimiters and replacing them with indentation. Yes, it does save several bytes, which might be important if you measure space in kilobytes I guess. It does provide cleaner files which may or may not be more readable.

It does not provide any advantages in parsing complexity. It does not provide any protection against typos.

I guess the same can be said of python, which forces indentation and therefore readable code formatting. Which is a problem that does not exist since the invention of code formatters and linters.

I like python for what it does but delimiters are actually useful in terms of readability. They provide an extra hint that the text you’re about to look at conforms to a specific structure.

GTG3000 ,

Oh god, parsing complexity. I actually tried writing a YAML parser in my free time before and boy was that not worth the headache. So many little things that complicate parsing and are ignored by majority of users!

I really like python, but I can agree that it’s no-delimiters style can be… Confusing at times. I definitely had to hunt down bugs that were introduced by wrong indentation. That and the way it handles global/local variables, mostly.

I do appreciate not having to enclose every key in “”, and being able to copy values - but if we want that kind of logic making our configs, why not just switch to writing configurations in Lua? It certainly has less footguns than YAML and it has the niceties like “I can just write {key = “value”} instead of {“key”: “value”}”.

KrokanteBamischijf ,

Honestly that probably goes for any interpreted programming language that supports imports.

Many Javascript frameworks just put their configuration into -.config.js files in the project root. Which is a pretty elegant solution that does not require custom parsing. Just import the config and go nuts.

Compiled (and by extension bundled) software obviously requires a different approach, but at that point you should probably consider storing your config in some kind of database.

Maybe there just isn’t a right answer to the config conundrum if all the general solutions are janky in some way.

GTG3000 ,

Well, there’s a few things I personally think are a must for a config format:

  1. It must be human readable and editable, in some way. - in many cases, you may want to go and change something in the config while the application proper isn’t running. That rules out stuff like pickle or binary formats. Although I suppose sqlite and it’s ilk still fulfill it, in a roundabout way.
  2. It should be unambiguous, with one way to do something right. - this one’s a doozie. JSON fulfills it since it’s unambiguous about it’s types, but many interpreted language configs will have options. And then YAML will have “no” turn into “false”.
  3. It should probably have comments. - handily failed by standard JSON implementations. Although to be fair a lot of parsers I’ve used understand comments. Or you can make a comment stripper real easily.
  4. It should have obvious structure. - I’ve dealt with CSV configs before, I do not want to ever again.
redcalcium , in A box of DevOps

Could’ve been worse. Could be unprettified json.

magic_lobster_party ,

Json is incredibly easy to prettify.

synae ,
@synae@lemmy.sdf.org avatar

I do it by converting to yaml ;)

Cratermaker ,

I wrote a json prettifier a couple months ago with just a couple lines of code. I thought it would take a while but ended up taking like 10 minutes.

kbotc ,

Import json Import pprint?

ElectricCattleman ,

js’s JSON.stringify(obj, null, 2);

30p87 ,

<span style="color:#323232;">| jq
</span>
30p87 ,

<span style="color:#323232;">| jq
</span>
magic_lobster_party ,

I use jq pretty much every day

Rogue , in I'm just at home heating up my no-code offering in the microwave...

I thought this was quite an insightful graphic until I realised the terms backend and frontend were borrowed from the terms back of house and front of house.

jaybone ,

Is that really where they came from though?

alphacyberranger , in The temptation is always there
@alphacyberranger@lemmy.world avatar

Is it an orgy if multiple global variables are used in a multi threaded code?

darcy ,
@darcy@sh.itjust.works avatar

not if everyone uses a Mutex. stay (thread) safe

noli ,

Always practice safe stacks

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