HNHacker News
TopNewBestAskShowJobs

cytzol

2,811 karma · joined February 5, 2009

Personal site:

- https://bsago.me

Some of my software projects:

- https://the.exa.website

- https://dns.lookup.dog

- https://specsheet.software

submissionscomments
cytzol··on The Danger of “Simplicity”
> "If I had more time, I would have written a shorter letter"

I don't like seeing this quote in the context of programming.

Sure, they're both about writing, but in different settings. A person who writes a letter has one goal: for the intent of the letter to be understood by the recipient. However, a programmer writing code has two goals: not only for the intent of the code to be understood by future programmers, but also to make the code easy to change in response to unknown requirements without causing any regressions.

The article is a bit all-over-the-place, but I do agree with it in general, because I've seen far more bugs in production caused by changing code than by adding it. Therefore, I would rather use a language with advanced features I can use to make my code harder to change in the wrong way. I think that if you phrase it like that, it makes it more acceptable to "avoid simplicity".

cytzol··on The Danger of “Simplicity”
I'm in the opposite camp from you — I like generics, lack of null, and syntax highlighting — but that's fine! I don't think this is something we have to 'agree' or 'disagree' with. It simply means that you're within Go's target market. If you want to use a simple language, and the software you're writing works just fine without these features in your code, then of course it's OK to jettison them and stick with the simple language. I need those features because of the software I write, so I need to stick with a more feature-ful language.

Acting like there needs to be some 'one true way' when we're writing completely different pieces of software is how pointless internet arguments get started.

cytzol··on I turned on every notification for a month
Keep going! 60 seconds in, it throws a huge pop-up at you.
cytzol··on Thank You, Guido
> How come so many people try to use code to show how smart they are?

It's tricky, isn't it? The original quote was about "clever code" versus "maintainable code", but they are not orthogonal: it's possible to write code that's more maintainable (because it's harder to use incorrectly) at the cost of being more clever (because you need to learn more of the language or standard library to understand it). One person's "more maintainable" is going to be another person's "too clever" — you're going to get a bunch of different opinions on where the line lies. Not everybody is trying to show off their brains.

cytzol··on We are leaving the Apple App Store and all its problems
> I also really dislike the App Store. [...] I used to _love_ it, I would check weekly for new things

I used to do this too, and like you, I've now grown to really dislike it. My reason is different, though: the App Store app has _plummeted_ in quality. It's now so hard to use, I don't bother using it.

1. The UI is all over the place. Some UI controls cause pages to swipe up from the bottom. Some cause pages to swipe in from the right. Some cause modals. Whenever I click something, I have no idea what it's going to do. Here are some examples: https://grumpy.website/post/0RsaxCu3P

2. It's full of bugs. I have witnessed the App Store lose track of whether an app is bought or not, downloaded or not, or installing or not. Another example: https://grumpy.website/post/0SU9WNFXB

3. It makes the rest of my system worse. Every week or so, I get a message like "Fantastical cannot be updated because it is open". I didn't set it to update. I had no idea it was even updating. I just get an obnoxious dialog interrupting my work.

The App Store used to be like a shopping mall — I'd browse the shelves, see what was new, and maybe buy a small app I liked the look of once in a while. But now it's become so hard to browse, I don't bother paying. Everyone loses out.

cytzol··on Ask HN: Feasible Alternative to the MacBook Pro?
> In a hotel (=on Mac), everything is stylish and cared for, but you have very little freedom to change things.

I've heard this over and over — that Macs are locked-down, uncustomisable machines — and I don't agree with it at all.

I use replacements for almost all the built-in apps. I use a custom launcher. My editor config Git repo is approaching ten years old, and my shell config Git repo is almost eight. There are standard interfaces to per-application Preferences and keyboard shortcuts. When I sit down to use someone else's Mac, I have no idea how to use it!

What changes am I missing? The only thing I can think of is that I can't use a different window manager or a different kernel, but I'm fine with those already.

cytzol··on Improving Form Controls in Microsoft Edge and Chromium
I agree — I prefer the old colour picker, too. Not only is it more functional, but it's the standard colour picker! If you've used any other Windows program that uses it, even if it was Paint in Windows 95, you already know how it works.

I don't mind people trying to re-invent the wheel, but I'm getting tired of having to use a dozen different interfaces for the same task.

cytzol··on Please Add RSS Support to Your Site
> I really enjoy reading content on my terms on not having to go everywhere to get it.

Unfortunately, I like to write my content knowing how it's going to have a certain appearance and layout, and because this doesn't scale to the narrow set of HTML allowed in the <description> tag, I don't have anything in there and just have a link to my site.

There are definitely RSS feeds without content so you have to go to their site and have adverts thrown at you, yeah, but it's not as simple as flipping a switch and having readable content in your RSS feeds.

cytzol··on Fork: A fast and friendly Git client for Mac and Windows
I use a Git GUI, not because it's more efficient or because it enables better workflows, but it's more comfortable for me.

- When I'm browsing the history, I can scroll up and down the list of commits and see the diff of each one by clicking on it.

- When I'm cherry-picking a commit, I can just drag the commit onto the branch.

- When I'm modifying a branch or a remote, I can right-click on it and go to Delete or Rename.

- When I'm resetting to an old commit, I can right-click on it and go to Reset.

Basically, I like to refer to things by pointing to them, and interacting by clicking or dragging. All of those things I just mentioned are trivial using the command-line — with the exception of modifying a branch or remote, you just have to write the git subcommand and its arguments. But having a Git resource as a tangible "thing" on the end of my mouse cursor makes me feel more calm using Git. I want to reset to that commit. I want to delete this branch. I want to cherry-pick this commit onto that branch. I want to see the diff for this commit. I can't really describe it but I feel more "connected" interacting with a repository like this, than on the command-line where I have to run commands and use the output of previous commands in new commands.

cytzol··on Chrome extension manifest v3 proposal: comment from uBlock Origin author
> In order to keep the society from diverging into rampant monopolization and totalitarization, I would propose a modification to TLS that would allow to optionally turn off encryption while preserving data integrity guarantees.

You can already use TLS with the null cypher to get the data integrity guarantees you want.

Apparently Microsoft (back in 2016) did this to for Windows Update: https://twitter.com/SwiftOnSecurity/status/74533301869746995...

cytzol··on A World Run with Code
> On the other hand, the "Wolfram language" is really a pretty poor design as far as programming languages go, and would not even be noticed if it wasn't for the giant standard library that gets shipped with it, called Mathematica.

In the official documentation (as well as his blog posts), the term “Wolfram Language” is used to refer to the combination of the two: both the syntax and the huge standard library, because you almost always encounter one using the other. This seems pretty common to me — I’ve said things like “I used the Ruby language” when I’m also using its built-in modules.

I agree with you in saying that the language part of the Language is nothing particularly special, though.

cytzol··on Add detailed message to NullPointerException describing what is null
> Is this just acceptable now?

That’s a matter of opinion, and my opinion is hell yes that’s not only acceptable but recommended! If creating a variable makes the code more readable, then do it; if it doesn’t, then don’t. But certainly don’t worry about NPEs.

A similar piece of advice is that you shouldn’t do this:

    if (a.equals("hello"))
You should instead, the advice goes, do this:

    if ("hello".equals(a))
because this doesn’t throw an NPE if `a` happens to be null. The only problem is that you want to be aware that your value is null; you don’t want to hide the error, then wonder why your program blows up further down the call stack. You haven’t solved the problem. You haven’t fixed a bug. All you’ve done is make that particular error message go away.

It turns out that the real advice is not “structure your code to avoid NullPointerExceptions”, but “avoid null”. With this in mind, rules like this one, as well as guidelines telling you not to have too many function calls on the same line, are rendered useless.

cytzol··on Show HN: Zero – A fast, zero-configuration server for React, Node.js, Markdown
I think your comment about scalability is accurate. Small apps become big apps, and small user bases get bigger. I’ve seen it happen — but I’m not going to think about scaling to thousands of users when I just need a small application to share with my team. If I spent five days building it to the utmost standards, instead of spending one day on something that solves a problem immediately, I’d be laughed at. It is the same with security.

> Your sort of thinking is how you end up with Yahoo levels of account leaks.

I wouldn’t store any of my customers’ data on an insecure internal service! I know that’s mad!

> Security always matters.

The first part of securing a system is to come up with your threat model, isn’t it?

cytzol··on Show HN: Zero – A fast, zero-configuration server for React, Node.js, Markdown
> When is security ever not a concern?

Internal applications where the entirety of the userbase are trusted employees. (Preferably, the userbase is small, too.)

Nobody’s going to bother finding vulnerabilities in an application where, if they break it, their own job gets harder.

cytzol··on Apple to Target Combining iPhone, iPad and Mac Apps by 2021
> I think it will likely result in lazy UX that's "good enough" for multiple device types.

This is already the case: the Marzipan apps shipping with Mojave are _shockingly_ bad (Home, News, Voice Memos). Standard keyboard shortcuts don’t work, drag-and-drop is inconsistent, and it’s clear that they never considered standard Mac features like multiple windows while designing them.

I worry that people will look at these badly-ported, out-of-place apps and say “Apple are doing it, so why can’t we?” rather than “Even Apple could only come up with this, so let’s not.”

cytzol··on Griping about Go
I think this is what you’re asking for with your last sentence, but I’m not sure so I’ll say it anyway:

My main gripe with Java’s checked exceptions is that there’s no way to bubble up a checked exception from inside a functional interface, because the function signatures differ. For example, if you want to close a bunch of files, you can’t do `files.forEach(file -> file.close())` if the call to close throws IOException — you need to use an iterator (which is longer) or catch and re-throw it as a RuntimeException (which is much longer). Libraries like JOOL can help here, but not completely.

It also doesn’t help that certain methods are declared as throwing exceptions that aren’t actually thrown, such as `ByteArrayOutputStream#close()`.

I used to argue in favour of checked exceptions, but once I switched to Kotlin, I realised that I didn’t actually miss them at all. However, my other favourite language (Rust) uses something a lot closer to checked than unchecked, so maybe I’m just writing different kinds of code on the JVM to let me get away with having this opinion!

cytzol··on Chezmoi: manage your dotfiles securely across multiple machines
> Do you have a whole ton of machines you log into on a regular basis? Where it's deeply unproductive / impossible to use the default configuration? What gives rise to this state of affairs?

I’m not the parent, but, yeah, this. I don’t have many machines that I need to connect to, but I make sure to sync my dotfiles to each of them. This gives me:

- A different shell prompt on each machine, so I’m less likely to type a command into the wrong one.

- Consistency in my shell aliases, so I never have to see “bash: ll: command not found” again. I have a lot of these, and I’d rather deal with syncing my dotfiles than re-mapping my muscle memory.

- All the helper scripts I’ve written over the last few years, so if I want to write a command and have it available everywhere, all I need to do is put it in a folder and wait for it to be synchronised.

I’ve been doing this for ages so I might be blind to some of the drawbacks, but I really like having the same terminal environment when I have to SSH somewhere else.

cytzol··on Potholes to avoid when migrating to IPv6
> 192:168:1:1 is not a valid IPv6 address

Ack, you’re right. For some reason, I was thinking it would get parsed as “192:168::1:1”.

That mapping does make sense.

cytzol··on Potholes to avoid when migrating to IPv6
I agree that some of IPv6’s features have caused it to be adopted really, really slowly, but I also think that those features are still better than anything else we could have come up with.

> Using colons for separators when they’re already being used for ports served no purpose but to confuse.

Dots and colons are the only separators I can think of that are available on common keyboards, and don’t look ugly. We can’t re-use dots because then there’d be addresses that are _both_ IPv4 and IPv6. And I’m serious about the ugly part! Try writing an address out using commas or semicolons or asterisks or something, it just looks weird.

> Having more than a single valid form of an address again only serves to confuse.

Yes, as the article demonstrates, it certainly introduces edge cases that aren’t present in IPv4 — but the alternative is having to type out all the zeroes. Would you want to type out ’0000:0000:0000:0000:0000:0000:0000:0001’ each time?

> If there’s anything to learn from the UNIX principals it’s there is great power in making things easily manipulated as strings.

I think this is a testament to how wrong that statement is. How many scripts have broken because a file path has a space character in it? How many content injection attacks have there been, caused by code that blindly concatenates strings together? IPv6 addresses are just another example.

It’s a shame, but IPv6 is the best we’re going to get.

cytzol··on Crystal 0.27.0 released
I haven’t used Crystal, but wouldn’t that cause some parsing ambiguities? `a %- b` would clash with `a % -b`.
cytzol··on A Map of Wireless Passwords from Airports and Lounges
Funny you picked that particular IP -- out of all four billion, 1.1.1.1 is the only one (that I know of) that uses HTTPS!
cytzol··on MacBook Pro with faster performance and new features for pros
Oh hey, neat.
cytzol··on MacBook Pro with faster performance and new features for pros
I’m not sure, but for what it’s worth, I’ve got “Automatically adjust brightness” unchecked in System Preferences. So either it’s just ignoring that option, or it’s using some secondary light sensor.
cytzol··on MacBook Pro with faster performance and new features for pros
I have filed a bug report. But yeah, it’s crazy that one part of the machine makes all the rest of it slow down! There was a time before I figured out it was the Touch Bar when I thought it was _moving fast_ that was making it lag (because it didn’t happen when the train stopped at stations). I was paranoid that it was trying to keep tabs on my location... so it could be worse, I guess.
cytzol··on MacBook Pro with faster performance and new features for pros
I use HapticKey, which makes the Touch Bar slightly less awful by clicking the trackpad when you touch it: https://github.com/niw/HapticKey
cytzol··on MacBook Pro with faster performance and new features for pros
Your tip only works for _decreasing_ the volume. If it’s turned all the way down, and you want to turn it up, you can’t tap-and-drag it because the fingerprint sensor gets in the way.
cytzol··on MacBook Pro with faster performance and new features for pros
I’ve got an issue with the Touch Bar that, as far as I can tell, only I am experiencing:

Take your MacBook Pro, put it in a room indoors, and flick the lights on and off in that room several times a second. You’ll notice high CPU usage on a process called “TouchBarServer”, as it tries to adjust itself to the changing light levels so it can display its screen. For some reason, as it does this, it lags the entire rest of the computer: scrolling will freeze every couple of seconds, clicks won’t register, the mouse will lag, and keystrokes will just be ignored.

Why would you do this, you might ask? I work on trains a lot, and I get this same flicker effect as the trees by the tracks go past. As they pass the windows of the train, it’s like a bright light source is being rapidly turned on and off.

I don’t ever use the Touch Bar — nor did I want one — but merely having one renders my laptop unusably slow for two hours every day. I hate this computer.

cytzol··on Ask HN: What is one Vim trick most people don't know?
Guy who uses <C-c> here. Is that bad?
cytzol··on One year of C
I think it’s American Fuzzy Lop, a fuzzer that’s good at finding bugs in your code: http://lcamtuf.coredump.cx/afl/
cytzol··on From Java to Kotlin and Back Again
JSON doesn’t support non-String keys, for one thing.
← PreviousPage 4 of 11Next →