dukk

joined 1 year ago
[–] [email protected] 6 points 11 months ago

Zero was (in its modern form) invented in India. It’s pretty fundamental to the concept of Hindu-Arabic numerals too: it’s how we represent numbers such as 10, 100, and so on.

[–] [email protected] 9 points 11 months ago (4 children)

IIRC Hindus invented this number system (with glyphs for 0-9), and then the Arabs starting using it. Eventually the west started using them and credited the Arabs.

As for how they are written, everyone used the same shapes, and then they probably just ended up changing over time (“Hmm…how do I write that number again? Oh whatever I’ll just make it up”)

Feel free to do your own research though.

[–] [email protected] 5 points 11 months ago

Freaking love TUIs, it’s like they took the convenience of a GUI and the efficiency of the CLI and merged them. As a Neovim and Lazygit user myself it’s amazing what I can accomplish in but a few keypresses.

[–] [email protected] 3 points 11 months ago (1 children)

Shout out to Lazygit for letting me stage individual lines

[–] [email protected] 2 points 11 months ago

Also possible in Voyager too :)

[–] [email protected] 7 points 11 months ago* (last edited 11 months ago) (1 children)

Better yet, git commit -p

[–] [email protected] 19 points 11 months ago

“feat: stuff”

Guilty of this one myself.

[–] [email protected] 20 points 11 months ago (3 children)

Commit more often. Maybe work in a different feature branch, and don’t be afraid to commit your half-working crappy code. If it’s a personal project/fork, it’s totally acceptable to commit often with bad commit names and small unfinished changes: you can always amend/squash the commits later. That’s how I tend to work: create a new branch, work on the feature, rebase and merge (fast forward, no merge commit). Also, maybe don’t jump around working on random features :P

[–] [email protected] 11 points 11 months ago (1 children)

Rearranging the keys? My password’s pretty much muscle memory, typed fast enough in not really worried about people watching me enter it. Call me lazy, but having to pick and hit every key? No thanks.

[–] [email protected] 7 points 11 months ago* (last edited 11 months ago) (6 children)

I’ll point to how many functional languages handle it. You create a type Maybe a, where a can be whatever type you wish. The maybe type can either be Just x or Nothing, where x is a value of type a (usually the result). You can’t access the x value through Maybe: if you want to get the value inside the Maybe, you’ll have to handle both a case where we have a value(Just x) and don’t(Nothing). Alternatively, you could just pass this value through, “assuming” you have a value throughout, and return the result in another Maybe, where you’ll either return the result through a Just or a Nothing. These are just some ways we can use Maybe types to completely replace nulls. The biggest benefit is that it forces you to handle the case where Maybe is Nothing: with null, it’s easy to forget. Even in languages like Zig, the Maybe type is present, just hiding under a different guise.

If this explanation didn’t really make sense, that’s fine, perhaps the Rust Book can explain it better. If you’re willing to get your hands dirty with a little bit of Rust, I find this guide to also be quite nice.

TLDR: The Maybe monad is a much better alternative to nulls.

[–] [email protected] 3 points 11 months ago (1 children)

I thought it was TS/JS too, but the way those braces are below the if statements makes it feel more like C#.

[–] [email protected] 3 points 11 months ago

To be fair, Tesla Autopilot probably already did that.

view more: ‹ prev next ›