this post was submitted on 21 Jun 2023
86 points (97.8% liked)

Programmer Humor

32426 readers
1046 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
top 21 comments
sorted by: hot top controversial new old
[–] fibojoly@sh.itjust.works 18 points 1 year ago (2 children)

I can't tell if it's a parody or an actual genius idea.

[–] GlitchyDigiBun@lemmy.world 3 points 1 year ago (1 children)

I would like to see the debugger give a list of all these boolean values and watch them toggle in real time. That would be far more useful.

[–] sebastiancarlos@lemmy.sdf.org 2 points 1 year ago (1 children)

fwiw I opened an issue on the vs code repo. It already got a downvote and the issue was reassigned from one maintainer to another. Popcorn is tightly secured.

[–] GlitchyDigiBun@lemmy.world 1 points 1 year ago

Eh, I'll stick with C# slowly becoming more and more syntax-redundant like all the other OOPLs :'(

[–] dingdong@lemm.ee 1 points 1 week ago* (last edited 1 week ago)

No there is AT LEAST one use for this. You could create an options class with booleans, and you could toggle settings when running or debugging. Also less savvy people (other non software engineers) can toggle settings easier for internal tools.

[–] conciselyverbose@kbin.social 11 points 1 year ago (3 children)

I, uh, actually kind of like the idea. If you just visually converted primitives to a toggle after you type true/false, and let you delete it like any other text, it could be a small convenience on any flags you might change during the development process.

[–] PlexSheep@feddit.de 3 points 1 year ago (1 children)

As a visual indicator, sure.

[–] conciselyverbose@kbin.social 5 points 1 year ago (1 children)

Oh, I could easily see a trainwreck of an implementation. But if this was just a display option like color coding keywords and variables, but you could click to change the underlying true/false? I might add it.

[–] sebastiancarlos@lemmy.sdf.org 3 points 1 year ago (1 children)
[–] LukeChriswalker@feddit.de 3 points 1 year ago

Beatiful. Magnificent indeed

To actual posisble implementations, it'd actually be interesting as an indicator next to the bool to make it easier to see when debugging

[–] Perry@kbin.social 3 points 1 year ago (1 children)

As long as it's not literally a toggle that you can interact with.

I can only imagine the horrors of accidentally clicking in the editor while selecting some text and quietly changing certificateIsValid = false; to true or something like that.

[–] Maven@lemmy.sdf.org 2 points 1 year ago

Nah, make it a keybind like alt-shift-click and give it a deafening sound like throwing an industrial breaker.

[–] sebastiancarlos@lemmy.sdf.org 2 points 1 year ago* (last edited 1 year ago)

I mean this as a joke but you might be right. A quick search suggests that no one implemented something like this yet.

[–] Henrik@lemmy.world 10 points 1 year ago

Previously I was able to search for “true” and “false” in my codebase. How do I do that now? VS Code has a new search interface specifically for toggles. It’s closed by default, but you can open it by clicking the “Toggle Search Toggle” toggle.

Yo dawg, I heard you liked toggles so we gave you a toggle to search for toggles in your toggle

Also, the section defining behaviour for null and undefined values are kind of bonkers.

Buuut, a nice visual nonetheless. I don't see myself using it though.

[–] JSens1998@lemmy.ml 8 points 1 year ago

It looks neat, but I think I'll keep my true and false. I don't like chhannngggeeee!

[–] MegaUmbreon@lemmy.world 4 points 1 year ago

Ngl I dont hate it.

[–] Jorgelhus@sh.itjust.works 4 points 1 year ago

You know, I could find a few cases where this could have helped me troubleshoot stuff on the code.

[–] Hazzard@lemm.ee 3 points 1 year ago (1 children)

I used an extension a while ago that changed CSS colour values (#ababab) into little coloured dots, that became a colour picker when clicking on them (while still letting you input RGB or Hex, ofc), and it was pretty awesome!

So, I could unironically see this being really nice. Although... I think this would need a pretty narrow context, something like if x == true would look pretty confusing as a toggle, I imagine. But assigning x = true? Bring it on.

[–] sebastiancarlos@lemmy.sdf.org 6 points 1 year ago

Good point. I actually thing that having if x == true is bad practice anyway because it's redundant, so showing a toggle in that context would have the benefit of highlighting that something's wrong.

[–] TechieDamien@lemmy.ml 2 points 1 year ago

MATLAB does this...

[–] justinalanbass@kbin.social 2 points 1 year ago

Grep -Irn "green toggle thingy" ./*