programmer_humor

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

Witchfire, (edited ) in no.. just no
@Witchfire@lemmy.world avatar

Honestly more readable than a lot of SQL I’ve read. It even has hierarchical grouping.

reimufumo,
@reimufumo@lemmy.ca avatar

true, but having it look like a component might get annoying. since this is likely to stay at the top, having an island of non components between two components might make it hard to see where functions start and end. and if this isn’t used directly inside a component it’ll just look dumb and inefficient (this also looks like it’ll take way more to edit once you change something)

bahbah23, (edited )

I think I agree with you both. I’m not a Node developer; could you keep your SQL objects/components in a separate file so that they don’t clutter up other logic?

doidera,

Yes

somePotato, (edited )

I was disgusted by the XML at first, but it’s a readable query returning a sane JSON object.

Meanwhile, I’m mantaining Java code where the SQL is a perfectly square wall of text, and some insane mofo decided the way to read the resulting list of Object[] 🤮 is getting each column by index… so I’d switch to SQXMLL in a heartbeat.

blackbrook,

Check out JOOQ.

shotgun_crab,

JOOQ made me realize that most ORMs suck

leftzero,

it’s a readable query returning a sane JSON object.

No it’s not. What table is the data supposed to be coming from…?

cmdrkeen,

React basically figured out how to make XML work.

Remember, XML was actually designed for use cases like this, that’s why it came with XPath and XSLT, which let you make it executable in a sense by performing arbitrary transformations on an XML tree.

Back in the day, at my first coding job, we had an entire program that had a massive data model encoded in XML, and we used a bunch of XSL to programmatically convert that into Java objects, SQL queries, and HTML forms. Actually worked fairly well, except of course that XSL was an awful language to do that all in.

React simply figured out how to use JavaScript as the transformation language instead.

jflorez,

It is so readable that you missed the fact it doesn’t have the FROM clause

istoff, in no.. just no

Is that select * ?

I expect it looks more cumbersome with joins and multiple columns from different tables.

adamth0,

That’s what I was wondering. It’s doing a SELECT, but not saying exactly which columns it wants to retrieve.

Sanchokan, (edited ) in The Holy Trinity of JavaScript

A few years back I came to the conclusion that the holy trinity in Christianity are three levels of abstraction: the son => God walks on earth and tangible, the father => God in heaven untangible but still reachable by speech, holy spirit => God in who knows where.

Then I thought that as a way of imparting the thought that any level of abstraction of the universe would also be inhabitated by God, those which we can sense, and those where our senses can't reach. The idea that omniprescense is not only limited to our dimension.

I'm not sure if that is the original meaning but is a way of seeing it that I can relate to, since I've always been akeen to a more abstract idea of God, and not so much to a figure that praises itself of thought, which is a human attribute.

yannic,
CanadaPlus,

As far as I can tell, the doctrine of the trinity served political rather than logical purposes back when it was put in writing in late antiquity, and since then it’s just been the doctrine. If you want to believe, you just have to believe and not think about it too hard, like the video says.

kamen, in The Holy Trinity of JavaScript

Lots of silliness indeed, yet I can’t remember the last time I had to use a non-strict comparison.

CanadaPlus,

Yes, it’s been established that you can still use JavaScript, and it will only backfire sometimes, even though it’s a bad language. And yet, people try to use it where it’s not even required.

mvirts, in no.. just no

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

Thcdenton,

Oh it can and it did.

guy, in The Holy Trinity of JavaScript
@guy@lemmy.world avatar

== is a heathen with no rightful place except equality to null. All praise ===

cmdrkeen,

That’s what I used to think but it turns out to be the most Christian operator there is.

match,
@match@pawb.social avatar

Eval works in mysterious ways

ADTJ,

I Object to your terrible pun

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

cmdrkeen, in no.. just no

Honestly not the worst thing I’ve seen.

xmunk,

I’d like you to think for a moment about CTEs, the HAVING clause, window functions and every other funky and useful thing you can do in SQL … Now just think, do you think that this syntax supports all those correctly?

cmdrkeen,

Probably no better or worse than any other ORM written in a more traditional language. Worst comes to worst, you can always escape to plain SQL.

Primarily0617,

sql syntax doesn't support even itself correctly i fail to see your point

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.

zqwzzle, (edited ) in The Holy Trinity of JavaScript

=== is just == with extra steps

kamenlady,
@kamenlady@lemmy.world avatar

It’s to be REALLY sure

thanks_shakey_snake,

It’s actually the other way around. == has to perform type coercions as part of its equality algorithm, whereas === does not, so == has more steps.

sv1sjp, in Multifactor auth done right
@sv1sjp@lemmy.world avatar

As I Cybersecurity Consultant, I totally agree

MCHEVA4EVA,

I get my passwords from the collective unconsciousness.

Kissaki,

One time passwords

Forgotten after one use

backhdlp, (edited ) in GitHub Desktop or Git CLI?
@backhdlp@lemmy.blahaj.zone avatar

I don’t understand git anyway

fckreddit,

Well, you learn four commands and hope for the best.

Valmond,

fetch, reset --hard, checkout -b and cherry-pick?

:-D

muix, (edited )

More like clone, pull, commit, and push --force

>:-D

Valmond,

push origin head

^^

xmunk,

Nah, rebase -i, squash, fsck and reflog

Valmond,

reflog saved my life once after a stupid misshap.

All rebase are belong to us (onto, rebase, and ofc interactive) but what’s fsck (I don’t squash personally)?

xmunk,

Fsck is File System Check - realistically you should never need to use it.

rikudou, (edited )
@rikudou@lemmings.world avatar

Must be an interesting work if you never add, commit or push.

Edit: How the hell did you get the repo without clone?

xmunk,

Pshaw, real programmers write out the contents of .git by hand.

(Also, it was a joke, the last two commands I listed are ones you’ll ideally never need in your life)

overcast5348,

I was scared of reflog too. Had to use it for the first time recently after I accidentally’d a branch that I hadn’t pushed to remote yet. I was so glad that I could recover it all in <5 commands.

traches,

https://imgs.xkcd.com/comics/git_2x.png

Title text: If that doesn’t fix it, git.txt contains the phone number of a friend of mine who understands git. Just wait through a few minutes of ‘It’s really pretty simple, just think of branches as…’ and eventually you’ll learn the commands that will fix everything.

popcar2,
  • git pull
  • git add *
  • git commit -m “Some stuff”
  • git push

And occasionally when you mess up

  • git reflog
  • git reset HEAD@{n} (where n is where you wanna roll back to)

And occasionally if you mess up so hard you give up

  • git reset --hard origin/main

And there you go. You are now a master at using git. Try not to mess up.

bjoern_tantau, in Multifactor auth done right
@bjoern_tantau@swg-empire.de avatar

They forgot something old, something borrowed and something blue.

muntedcrocodile,
@muntedcrocodile@lemmy.world avatar

da ba dee da ba di

reflex,
@reflex@kbin.social avatar

da ba dee da ba di

Mm-mmm, waffles.

lemann,

🤢

backhdlp, in We're not the same! (period)
@backhdlp@lemmy.blahaj.zone avatar

I don’t open source my code bc I don’t understand git

xigoi,
@xigoi@lemmy.sdf.org avatar

You can open source your code just by uploading it on some kind of cloud storage and setting it as publicly available.

frezik,

There’s a guy out there who made a reversible NES emulator, meaning it can run games backwards and come to the correct state. He made a brilliant post on Reddit /r/programming linking his ideas for the emulator to quantum mechanics.

Then he was asked why he didn’t distribute his program in git. He said that he didn’t know git.

To me, that’s a pretty good example of the difference between computer science and software engineering.

jack,

It’s perfectly fine to just make a zip available

gratux,
@gratux@lemmy.blahaj.zone avatar

it’s just linked lists of commits (except when merging)

xx3rawr, (edited )

I don’t understand linked lists

QuazarOmega,

In internet terms: It’s just a soyjak holding a box with data who is pointing at another soyjak holding a box with data who is pointing at another {insert N-3 of the same soyjaks} soyjak with a box with data without an arm to point with

ibk,
@ibk@lemmy.world avatar

I don’t understand what a soyjak is.

QuazarOmega, (edited )

soyjaks pointing linked list

Kourtesy of Krita

sheepishly,
@sheepishly@kbin.social avatar

I still don't understand Git but I like this image

gratux,
@gratux@lemmy.blahaj.zone avatar

each commit points to the one before. additionally a commit stores which lines in which files changed compared to the previous commit. a branch points to a particular commit.

Denvil,

It’s just a thingie

philm,

Almost… To be precise it’s a Merkle DAG

HangingFruit,

We are the same

shaked_coffee,

Branchophobic

ImplyingImplications,

git good

nastyyboi,

So, you don’t “git it”?

I’ll escort myself out.

HamBrick,

Git push yourself out* to make the obvious joke

TurtleTourParty, in GTA 5 Java Coffee shop

Bancon and bread are both 2?

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

    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 18878464 bytes) in /var/www/kbin/kbin/vendor/symfony/http-kernel/Profiler/FileProfilerStorage.php on line 171

    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 10502144 bytes) in /var/www/kbin/kbin/vendor/symfony/error-handler/Resources/views/logs.html.php on line 37