HNHacker News
TopNewBestAskShowJobs

aib

339 karma · joined July 4, 2012

submissionscomments
aib··on Programming AIs worry me
What worries me are the low-grade programmers. By delegating their work to tools like ChatGPT (and doing so always a level or two beyond the current abilities of the tools) they will manage to take us to newer lows.
aib··on Ask HN: What made you finally grok Git?
Being the go-to git guy for a whole project when everyone was new to it.

Are you using it from the command line? I feel that helps a lot. Get a good log alias[1] and get hacking. I almost exclusively use the official CLI, with the exception of git-gui for committing and rolling back patches (lines / hunks). (I find it's easier than `add -p` and that CTRL+J is a good time saver.)

1: As an example, https://github.com/aib/dotfiles/blob/master/.gitconfig#L29

aib··on Walking Venice
It'a a photo of Uffe Isolotto's We Walked the Earth, at the Danish pavillion.
aib··on Useless Use of "dd" (2015)
So did I, but my man page (open(2)) cast doubts:

"The O_DIRECT flag on its own makes an effort to transfer data synchronously, but does not give the guarantees of the O_SYNC flag that data and necessary metadata are transferred."

While I don't think this is relevant to block devices, I see no harm in including the flag in my alias, either.

aib··on Useless Use of "dd" (2015)
I use it for the O_DIRECT flag (oflag=direct). Better progress report, and I know when to pull the stick.

Edit: Looks like O_SYNC (oflag=sync) is needed, too. Should update my 'sddd' alias.

aib··on UA Gotta Be Kidding
Is there something like a "capabilities declaration" in the works to actually solve the problem? You know, something like a "X-I-Support: images, frames, ecma6, vr, xss" header?

I could even imagine an "assigned capability strings" database and x- prefixes and all, but it's probably an old fool's dream in these fast-m— thing-breaking times.

aib··on We fixed f-string typos in popular Python repos
> where is the f-string described as suboptimal?

I guess it's implicit in that f-strings, as arguments, will be evaluated before the logging function can even run whereas `debug("...", heavy_obj)` will avoid a potentially expensive `str(heavy_obj)` (or whatever the string conversion warrants.)

As for raiseExceptions, I'm not sure it's for optimization. It looks like an old sanity check for bad logging configurations.

aib··on What a better Rust would look like
> Who gives a crap? Those four things break you free of the borrow checker while also letting you get a grip on the language.

Exactly! And remember, it's not always getting a grip on the language. Sometimes it's getting a grip on the problem or one of the possible solutions.

aib··on What a better Rust would look like
> > Wanting to ship without violations does not mean you are not interested in getting your algorithm working, first. Often enough, you will abandon your laboriously borrow-safed code without shipping it, because you figured out a better way. But! you had to borrow-safe the new way, too, before you could even try it out.

This is a great idea! It made me realize why I still choose Python for prototyping. (I had been wondering...)

I absolutely love Rust's guarantees and prefer its memory management over GC. But nothing beats no memory management! Make everything Arc, make everything static---I don't care! My program will only live long enough to print "OK" and reach the next TODO, anyway.

> If your program confuses the borrow checker, that means that the compiler can't figure out when it should close that TCP connection on your behalf.

That's quite okay. "Process end" is as good a time as any, in this case.

> This isn't the sort of thing you can just turn off in debug mode, because programs should act the same in debug and release modes.

I don't know why programs with and without overflow and bounds checking are the "same" while programs that close unused sockets at different times are not, but it's okay---we don't have to call it "debug" mode. "Development" or "prototyping" mode both sound fine to me.

> There are ways around this - you can use types like Box, String, Rc, Cell, etc. And then just .clone() all over the place. But your code will run slowly. And thats still way more annoying to use compared to other languages. I don't know any other language which makes you write "Box" to put an object on the heap.

I think this is precisely the point. In other languages we can just create objects without worrying about where they should be stored. This is good because most of the objects -w-e- some people create don't get stored anywhere, anyway. They don't make it to the first release.

--

And yes, I realize I'm describing what is, from some angles, a completely different language. But I think one of the original discussion points is "why Rust-like languages keep popping up"? This is my take.

I didn't know where to squeeze this in, but the biggest annoyance in my (quite limited) time with Rust was: refactoring functions. I like breaking up functions into smaller chunks: `do_xy() { ... do_x(); ... do_y(); }` especially where a block of code could really benefit from being under its own name. Developing in Rust, I often found myself looking up internal types for the parameters/return type, and sometimes fighting the borrow checker. (I'm not sure type inference would be a good solution to the first, and I believe the second is mostly due to lexical lifetimes?)

aib··on Ask HN: What technologies greatly improve the efficiency of development?
Source control
aib··on Show HN: Simple Zero-Knowledge Proof Treasure Hunt Game
I don't know how actual asymmetric KDFs work, but I was thinking more along the lines of secret -> private key -> public key, i.e. the public key doesn't contain information about the secret.
aib··on Show HN: Simple Zero-Knowledge Proof Treasure Hunt Game
I think there is an impedance mismatch in how easy the game is to understand versus how the ZK proof part has required reading. Some (if not most) of the questions or comments here must sound silly to someone knowledged in the field. Anyway, here is mine:

How is the proof different than a signed message saying "This person has found the treasure"? With the private key derived from the coordinates?

Anyway, I'm off to read more about ZK proofs in hopes of making the above sound silly to me.

aib··on Gameboy CT scan – design lessons learned
What page are you talking about? All I see is a hard-to-read white-on-black quarter page of text that takes longer to scroll through than to read and animated GIFs.
aib··on The Internet Is a Potemkin Village: Proof of Dead Internet Theory?
I remember "going on the Internet" (with a capital "I" back then) as an activity. It felt like walking through a forest with its vast ecosystem; a colored, rich variety of life, an intriguing mixture of things both alien and familiar, tiny niches all around and a delightful surprise never too far away. Nowadays browsing the web feels more like a walk in the concrete jungle; bland, bleak and teams of people paid to promptly rectify anything improper
aib··on The EU Wants a Universal Mobile Charger, but Apple Doesn’t
Um, hasn't this already happened? [1] It's what saved us from the quasi-distopian tech age where we had to carry adapters for everything, if memory serves.

This reads like an article from 10+ years ago, even the part where Apple objects.

1: See https://en.wikipedia.org/wiki/Common_external_power_supply

aib··on Ask HN: Projects for learning a language?
A raytracer is simple enough and fun.
aib··on Calc.exe is now open source; there’s surprising depth in its ancient code (2019)
Check out Qalculate![1] for a program that does that and much more (though obviously not as much as WA).

1: http://qalculate.github.io/

aib··on ISO 8601: a better date format
This has been my experience as well.

Sometimes I tell onlookers that it's an ISO standard.

aib··on Energy Efficiency across Programming Languages [pdf]
As if there weren't enough reasons to learn Rust already, there's a new one: We owe it to the planet.
aib··on Why Johnny Won't Upgrade
I do software development in bursts (think productive weekdays + long weekends) and do all my updates in the downtimes. One day Snap decided to update Slack right before an important meeting. To a, yes, broken version.

Another angle to this is that had Slack not been a proprietary platform, I would've taken time to find or help develop a sane client that is -e-a-s-y- possible to fix.

aib··on OpenJDK Comes to Windows 10 on ARM
> the least software support, even in this limited scope

I think they were talking about ARM.

aib··on Google starts testing its replacement for third-party cookies
uBlock with all third party requests blocked. That means I don't even see recaptcha, but when I explicitly enable it for a site, it takes 3-4 rounds to pass. Logged on to gmail and youtube.
aib··on I think my BBQ just offered to be my default browser?
Okay, so an IoT BBQ is a useful thing.

How are we going to prevent every single useful thing from coming up with its own crappy, poorly-maintained application? Because obviously having open standards is not enough.

So far the solution we've come up with seems to be "wait until one or a few companies dominate the market, come up with their own solution, and hope it's an open one and/or others adopt it."

This particular app might not be crappy, but I think my question still stands.

aib··on Siri, What Time Is It in London?
Can we please also take a moment to wish tiny inconveniences upon designers of applications which ignore my locale and present me with "11:06 AM" or worse, "04/05/2020"?
aib··on Some views on having your system timezone set to UTC
In your database, you should always use types with time zones.
aib··on Why does `True == False is False` evaluate to False in Python? (2013)
> > Whitespace sensitivity is a terrible choice

> It's my favourite feature of Python

It's like the speed bump: It's for people who can't follow simple rules. It inconveniences you, but is rationalized with that it ultimately makes the world a little safer for everyone, including you.

Me, I unindent temporary code like debug-print statements and literals overriding actual data. This makes it impossible to commit by accident.

But my argument against whitespace sensitivity would be that bad and unreadable code is bad and unreadable regardless of its whitespace. In fact, force-formatting it just hides the evidence.

aib··on Userscripts Are Fun and Are Still Very Much Relevant
Are userscripts still run once after page load? That was a major pain point last time I tried using them, on a dynamic page. I tried hooking some events and run-registered-function-on-tree-change-but-at-most-at-N-msec-intervals, but it got out of hand and ended up looking to take much more time to write than the handler it was going to call, so I filed it under "should be written once and properly" and postponed the whole thing.
aib··on Things Markdown got wrong
Have you seen Pandoc[1]? I'm not sure it supports the particular cases you've stated, but I've been using it happily as an HTML generator[2].

1: https://pandoc.org/MANUAL.html

2: https://www.aib42.net/articles source at https://github.com/aib/www.aib42.net/tree/master/articles

aib··on Back pain is a problem which is badly treated
The variety of solutions people have mentioned in this topic is a testament to the complex and varying nature of back pain (and the body in general, if you'd like to go there).

I would therefore like to add my personal savior: Hamstring stretches.

Changing your lifestyle (not necessarily drastically) and excercising/stretching in general is the solution in most cases, yes, but for me the single greatest contributor was the hamstring stretch. Lie flat on your back, keep your legs straight and raise one until you feel its back sides burn. Strain it a little; using a towel, rope, bedsheet or spare pair of pants to pull on your heel if necessary. IANAD, but I hear it's pretty hard to injure your spine this way.

aib··on State of Postgres
> didn’t manage to get past the first two scrolls

I did, but I was so distracted by the vast amount of whitespace (and 3x normal the amount of scrolling required) that I don't remember anything.

← PreviousPage 2 of 4Next →