programmer_humor

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

Shinji_Ikari, in GitHub Desktop or Git CLI?
@Shinji_Ikari@hexbear.net avatar

I really never understood why one would need a GUI for git except for visualizing branches.

I feel like I’m crazy seeing so many people using clicky buttons for tracking files. I need like 4 commands for 95% of what I do and the rest you look up.

You’re already programming! Just learn the tool!

And now there’s a github CLI tool? I hate to beat a dead horse but Microsoft pushing their extended version of an open source tool/protocol is literally the second step of their mantra.

idiocracy,

knowing how to program doesn’t mean u need to do things the hard way.

heck the whole point of programming is to make things easier and faster.

popcar2,

FWIW not everyone using source control is a programmer. I’ve seen artists in game dev using GUI tools to pull new changes and push their assets.

Shinji_Ikari,
@Shinji_Ikari@hexbear.net avatar

That’s fair, there’s plenty of uses for source control.

I was speaking from a programming context though, as this is a programming community.

hubobes,

Maybe not a GUI but using a TUI (lazygit) I am certain that I can do everything faster than you could ever do using the CLI. Tbf if a GUI Tool had the same shortcuts it would also be faster.

sloppy_diffuser,

I use LazyGit on the CLI for a “GUI-like” experience. I find it helps me make smaller more meaningful commits. If I’m working on a feature that enhances or fixes other modules in my repo to support, its trivial when done to make multiple clean commits out of the one feature that isolates the changes in functionality to individual commits instead of one medium commit.

On a large enough repo (e.g., monorepo), its a pain to do using git commands.

coloredgrayscale,

Checking the diff before commit, solve merge conflicts

Also if it’s well integrated into the IDE it feels less like using a separate tool. For 95% of what I do the ide/gui feels better (fetch, pull, push, commit, checkout, merge). Usually just 2-4 clicks and no need to type the branch name (ticket number and then some)

For Reflog, reset I use the terminal.

If I had to start github desktop or another seperate gui I would use the terminal that’s integrated into the IDE.

OpenPassageways,

I primarily use GitHub CLI to interact with the GitHub API, not Git. I don’t really see it as an extension of the Git CLI, which I use much more frequently. Everything you can do with it can also be done through their REST API.

I use it for things that aren’t really git features, like:

Syncing repository admin, pull request, and branch control settings across multiple repositories

Checking the status of self-hosted actions runners

Creating pull requests, auto-approving them

Shinji_Ikari,
@Shinji_Ikari@hexbear.net avatar

Thanks for the explanation, that does sound useful.

firelizzard,
@firelizzard@programming.dev avatar

Do you use the command line for everything? Do you edit with vim, view diffs with git diff, browse the web with links or lynx?

GUIs are useful tools. I’m happy with VSCode’s git integration. It’s just what I need for basic stuff like staging files and committing. I use the CLI whenever I want to do something like rebasing because I can type that command faster than I can figure out the GUI, but it would be stupid to artificially force myself to use the CLI for everything because of some kind of principal.

Shinji_Ikari,
@Shinji_Ikari@hexbear.net avatar

Yeah I actually just prefer the command line, I’ve never had to force myself to use it. I even tried using VSC for a bit recently but i couldn’t get myself to like it. I just use nvim with some plugins in a tmux session now and its productive as hell.

Of course I don’t browse the web with the command line. For merging branches, I always merge main into the working branch first, check conflict files, and go through the file finding the diffs and resolving them. I’ve used merge tools before that were sorta nice but I had my own issues with them.

Maybe it’s the type of programming I do. I don’t do any web stuff, so file count is down. For larger code bases I keep a non editor terminal up and will grep -re for word/phrase searching, find to look for specific files, etc. I’ll occasionally use an IDE, typically eclipse based because embedded, but I don’t find myself missing the features they add.

firelizzard,
@firelizzard@programming.dev avatar

Of course I don’t browse the web with the command line.

That’s my point. Browsing the web with a command line tool is obnoxious - you use a GUI for tasks that you find easier/more pleasant to do with a GUI. The difference is where that line is. When I’m reviewing what work I’ve done and checking through my code for debugging statements and other cruft I don’t want to push, I prefer to have a nice tree view of my change set where I can click on an item, see what I’ve changed, select lines and stage them, select other lines and revert them, etc. I could do all of that with command line tools (though not that many have mouse support) but I already know how to do exactly what I want with VSC so why would I use anything else?

You’re already programming! Just learn the tool!

If someone is incapable of learning the tool, that’s an issue if they’re a developer. But your statement implies that everyone should use the CLI for everything. My point is that it’s a matter of preference. The CLI is not superior and GUIs aren’t superior. They’re both just tools and if you can get your job done quickly and efficiently, that’s all that should matter.

HiddenLayer5, in Need a rust version too.
@HiddenLayer5@lemmy.ml avatar

You have Rust.

Forget rescuing the princess, that’s unsafe. Lock her down even more!

agent_flounder, in Need a rust version too.
@agent_flounder@lemmy.world avatar

Omg Lisp. I’m dying. Our object oriented programming class in college involved programming in Scheme. This was… a while ago.

Saving this forever.

lastunusedusername2,

I did the same thing in Scheme. It was mine expanding.

Lawyerator,

Yup, Scheme was the only programming language taught in our comp-sci department so we could “learn how to learn.” Two years and a broken parentheses button later, and I switched to being a theatre major.

Today, my legal career stands as a testament to the pointlessness of a declared major.

EnderMB, in Need a rust version too.

Always good to see Jon Skeet get some love. I’d love to know in terms of quantity just how many people he’s helped over the last decade or so.

thedirtyknapkin,

if we count the number of people who have used products with code helped by him; we’re probably around 50% of all humanity by now. at least…

Honytawk,

I just wonder how many he would have saved if he didn’t write the language in the first place

revlayle,

wat

Skeet did not write or create c#

Daxtron2,

Literally every time I’ve ever posted a question on SO that’s related to .NET, Skeet comes to my rescue.

magic_lobster_party,

He has used this comic as his profile pic on Twitter and StackOverflow for quite a while.

ClamDrinker, in Fitbit Clock Face

Finally. A human readable format. And pretty too.

Dkarma,

Jesus I hope this is a joke. I hate json 🙄

damnfinecoffee,

yeah for real, let’s see an xml one instead

gornius,

Ah yes, perfect data format, where markup takes more space than the actual data.

curiousaur,

Would you prefer Yaml?

Hotzilla, in 4 billion if statements

Could be easily made 50% space saving by only iffin all odds and return even on else. Maybe one if before to handle overflow to avoid wrong even if over the last if.

Deebster,
@Deebster@programming.dev avatar

Well yeah, if you allow cheating!

bjorney, (edited )

Yeah but then ALL even numbers would be slow to compute because you would have to chain through every odd before you know that 2 is even.

Depends on the expected distribution of input values

coloredgrayscale,

Heuristic: keep it until 512, afterwards powers of 2, and numbers like 1000, 2000,…, 10000, 20000,… (regex: [0-9]000+)

gravitas_deficiency, in no.. just no

I want to hate this. I really do. But the problem is… I think I like it.

lorty,
@lorty@lemmygrad.ml avatar

This needs a bit of work but it could be interesting

naonintendois,

But how do I know if the WHERE clause is AND or OR?

gravitas_deficiency, (edited )

Fair. The constraint nodes should probably exist under an And or Or node.

akash_rawal,

We can say default is and and add an Or node for or. Similar to SoP notation, you only write +.

victorz,

How about an or boolean attribute.

OsrsNeedsF2P, in Release notes of an open source app. Someone is pretty mad at Canonical for Snap

Canonical could have done a lot better with the explanation message here. The idea is to push apps towards XDG compliance and the use of things like Portals.

That said, unlike Wayland, portals really aren’t there yet from a UX perspective, especially for an app that is heavy on file transfers.I prefer what Flathub does where it puts a nice green checker beside your app for XDG compliance - it’s an encouragement, but not an enforcement.

lung, in ifn't
@lung@lemmy.world avatar

ifn’t(!valid) halp?

Deconceptualist,

I believe that resolves the same as

ain’t!(!untrue)

RagingHungryPanda,

ain’t (nothin)

leds, in DO NOT MERGE

But thanks for keeping my phone up to date, it is appreciated ♥

infinitevalence,
@infinitevalence@discuss.online avatar

Same, I run 3 devices all on Lineage and its great. Who know that you could still get updates and support for a device from 10 years ago, suck on that apple.

DreadPotato, (edited )
@DreadPotato@sopuli.xyz avatar

It’s just kind of sucks that updates consistently breaks banking apps and other stuff relying of passing safetynet. Every time I update I have to do the Magisk workaround again which is really annoying.

Bye, in Happy New Year Coders.

Dude what, replace all of those with me skiing while my mouse jiggler keeps my slack status active lol

thetreesaysbark,

Is slack more intelligent than teams for this? With teams you can open a word doc and put something on the space bar and it’ll keep you active

GBU_28,

Best to be jigglin.

AgnosticMammal,

You can also press and hold the arrow key on the Desktop. I assume this works because of keyboard based navigation

lseif,

does slack seriously monitor mouse movements ? heavens above.

dabu,
@dabu@lemmy.world avatar

If needed just use a website. The electron app is just that + tracking

lseif,

does the web version set your status as ‘active’ ?

DinosaurSr,

This is my new New Year resolution. You got any good mouse jiggler recommendations?

expr, in no.. just no

Not only is this really gross, it’s also straight up wrong. It’s missing a from clause, and it makes no sense for a where clause to be nested under the select. The select list selects columns from rows that have already been filtered by the where clause. Same for the limit.

Also just gonna go ahead and assume the JSX parser will happily allow SQL injection attacks…

nephs,

Booooo

CanadaPlus,

I like the format, though.

ReluctantMuskrat,

Clearly you’ve not had to write and maintain much XML.

CanadaPlus,

I have not. I just thought it looks less goofy than a nested SQL statement split over multiple lines.

What are the issues with XML?

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

cupcakezealot, (edited )
@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

Solemarc,

If you think this is more structured than traditional SQL, I really disagree. Is this a select * query, it’s ambiguous. Also what table is being queried here there’s no from or other table identifier.

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?

rubythulhu,

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

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!

marcos,

Well, if you lose the OOPism of those dots, we can talk.

Anyway, I’m really against the “having” tag. You need another keyword so that you can apply your filter after the group by?

physicswizard,

Boy then are you going to hate QUALIFY

marcos,

Yes, I do. It’s a lot of effort and hidden functionality to try to paper over the fact that the statements do not compose.

QuazarOmega,

Well, if you lose the OOPism of those dots, we can talk.

That’s a good point, I didn’t even think about it, maybe a more functional style would make more sense?

rubythulhu,

having is less annoying way of not doing needless/bug-prone repetition. if you select someCalculatedValue(someInput) as lol you can add having lol > 42 in mysql, whereas without (ie in pgsql) you’d need to do where someCalculatedValue(someInput) > 42, and make sure changes to that call stay in sync despite how far apart they are in a complex sql statement.

docAvid,

Postgres has the having clause. If it didn’t, that wouldn’t work, as you can’t use aggregates in a where. If you have to make do without having, for some reason, you can use a subquery, something like select * from (select someCalculatedValue(someInput) as lol) as stuff where lol > 42, which is very verbose, but doesn’t cause the sync problem.

Also, I don’t think they were saying the capability having gives is bad, but that a new query language should be designed such that you get that capability without it.

expr, (edited )

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

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

emptyother,

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

QuazarOmega, (edited )

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

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?

baseless_discourse, in Rust's static linter is called "Clippy" for a reason.

Every monad is a monoid in the category of endofunctors, it is literally the definition of monad. But what do you expect from clippy…

CurlyMoustache, in Programmer tries to explain binary search to the police
@CurlyMoustache@lemmy.world avatar

This is how I look for the best bits in porn

cRazi_man,

Fast forward half way and see if the woman is still there?

xaxl,

I fast forward half way and pray she still isn’t slobbering on some knob at that point and they’ve gotten down to businesses already.

doctorcrimson,

It’s got huge amounts of applicability in many lifestyles and situations that most people never realize until the moment arrives. I once played a fun game that had you guess a number between 1 and 1 Billion with them telling you higher or lower to earn your freedom. Takes a couple of minutes at most.

yum13241,

Your first guess should always be 500,000.

doctorcrimson,

500,000,000*

yum13241,

Thanks.

  • 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 25