HNHacker News
TopNewBestAskShowJobs

jcparkyn

620 karma · joined April 16, 2022

https://github.com/jcparkyn
submissionscomments
jcparkyn··on Design Patterns Are Temporary, Language Features Are Forever
> Java is perfectly capable of expressing an enum

I think this is a bit of an exaggeration, unless you're talking about very modern versions of Java (sealed interfaces and better pattern matching). Java has no good way to attach different data types to each enum variant (a la ADTs) except inheritance, and until recently switching over class types was a PITA.

jcparkyn··on Official proposal for Type Unions in C#
But then what name would they use for tuples, which are distinct from records?
jcparkyn··on Panic at the Job Market
You forgot to test for associativity: ((1-1)-1) vs (1-(1-1)).

Your implementation does handle it correctly though, but it requires some care when using parser generators :)

jcparkyn··on Zed on Linux Is Here
I've never experienced this. Have you tried disabling all your extensions to see if one of them is causing it?
jcparkyn··on Python Modern Practices
> what's wrong with pip freeze?

Aside from all the obvious issues of having no distinction between transitive and direct dependencies, it completely breaks cross-platform support if any of your dependencies have platform-specific sub-dependencies (which is not uncommon in python).

jcparkyn··on Overleaf: An open-source online real-time collaborative LaTeX editor
Installing it is easy, what's harder is making sure all your collaborators have the same packages and versions of everything.
jcparkyn··on Ask HN: What's the weirdest bug you ever had?
I don't think anyone had tried copying it until after I figured out the problem, the bug report would've just been a screenshot.
jcparkyn··on Ask HN: What's the weirdest bug you ever had?
Here's a fun one that's not really code-related:

I was working on a web application with a maintenance mode feature where it would show a "system offline" while changes were rolled out etc. We noticed there was a typo (or so we thought) in the message, so it said "system olffine" instead.

Because this message could be overridden by site admins, there was a somewhat convoluted data flow to produce the final message. I grepped the codebase for "olffine" and found nothing. Then I checked my local DB to see what message was stored - it was spelled correctly. Then I stepped through the backend code to look at the message being returned - still correct.

Eventually I was back in my web browser with the page open on the left (spelled incorrectly) and devtools on the right (spelled correctly). What the hell?

It turned out the problem was that the font we were using had made a mistake with the "ffl" ligature so it rendered as "lff". We contacted the font author and they fixed it.

jcparkyn··on This Message Does Not Exist
Well somebody had better discard it now, lest it start existing at some point in the future.
jcparkyn··on Your Transformer is Secretly Linear
A fun example of that (making a neural network using floating point error as a source of non-linearity): https://youtu.be/Ae9EKCyI1xU?si=n9vgvCvxoxrQeKd8
jcparkyn··on How to read C type declarations (2003)
I was with you until the second sentence - there's so many better syntaxes C could've used but that's not one of them.
jcparkyn··on Static Chess
One of my personal projects uses a similar idea, but it's a word game (scrabble-like) and it's hosted statically: https://jcparkyn.github.io/scrobburl/

Repo: https://github.com/Jcparkyn/scrobburl

jcparkyn··on The only two log levels you need are INFO and ERROR
What kind of deprecation are you talking about? Assuming deprecated functions/types/etc, isn't this something your compiler or linter should catch?
jcparkyn··on U-M finds students with alphabetically lower-ranked names receive lower grades
I think an important difference is that when you shuffle them, the unfairness stops being correlated across multiple assignments, so the "aggregate" unfairness over the course of the semester is much lower.
jcparkyn··on `async: false` is the worst
One feature I've never seen in test frameworks that I think would be good:

Instead of concurrency being a boolean on/off, tests should be able to declare a list of shared dependencies (e.g. using arbitrary string identifiers). Then the test runner could make sure no two tests with the same dependency run at the same time, but still use as much concurrency as possible.

You could extend this further by marking certain dependencies as read-only, so the read-only tests can still run in parallel with each other.

jcparkyn··on SQL is syntactic sugar for relational algebra
Your first example should be more like

  return source(criteria).results
In your SQL, `results` isn't the variable you're assigning to, it's the column you're reading from source.
jcparkyn··on Defcon: Preventing overload with graceful feature degradation (2023)
- The comment is referring to a graph that used 10^6 on the vertical axis, which is a very common way to format graphs with large numbers (not just "lately"). It's also the default for a lot of plotting libraries.

- 10^n is more compact than million/billion/etc, more consistent, easier to translate, and doesn't suffer from regional differences (e.g. "one billion" is a different number in Britain than in the US).

I'm not saying it's clearly better than "million" in this specific case, but it's definitely not clearly worse.

jcparkyn··on How I build and run behavioral interviews
> if you are going to get them during the interview you study for them

And a lot of interviewers (at least in my limited experience) are quite okay with you referencing your notes during the interview.

jcparkyn··on BBC: Big Tech jobs have lost their glamour
(Not saying anything in your comment is wrong, just an additional data point)

For "big tech" in Australia, ~$160k is pretty much the starting compensation for graduate/entry level SWEs.

jcparkyn··on OpenAI – Application for US trademark “GPT” has failed
> people remember the name just fine.

What about all the people who mistakenly call it ChatGTP? (and yes I have heard this more than once in real life). I assume this is also the origin of the HN user with the same name.

jcparkyn··on Dark UX doesn't work in the long run
Another option would be to replace the X with a small (i) symbol or similar, so at least users won't be confused when it doesn't do what they expected.
jcparkyn··on Why Charging Your Gadgets over 80% Is Such a Bad Idea
Disclaimer: I'm not an expert, so take this with a grain of salt.

There's always going to be some trade-off between how full you charge the battery and how much it degrades, so of course manufacturers choose a threshold that isn't going to destroy the battery too quickly.

The problem is that this isn't exposed to the user (e.g., there's no way to temporarily override it to a higher threshold when you actually need it). This means the threshold needs to be set quite high (to avoid wasting usable capacity), and manufacturers don't have much incentive to make the battery last more than a couple of years.

Limiting to 80% in software is a way around this, because users (and reviewers) can use the full "100%" (still an arbitrary threshold) when they need it, and choose for themselves how long they want the battery to last.

jcparkyn··on Apple has not fixed the macOS audio left/right balance bug for nearly 10 years
Maybe I'm optimistic, but I find it unlikely that someone went to the time to build this app, maintained it for the last eight years, and thousands of people went to the trouble to find it, install it, and leave a review, all without anyone contacting apple about their problem.

Edit: Apple was well aware of this issue (or a similar one), 12 years ago: https://web.archive.org/web/20221205223648/https://support.a...

Their response? "deal with it"

jcparkyn··on Mystery monk makes billions with 5-hour energy (2012)
Is there any evidence of him actually following up on any of those pledges? The example from the article about his "billion dollar" donation (of which only $4MM seemed to have actually been spent) makes me skeptical.

Edit: It appears the Hans Foundation is doing some things, at least if their annual report [1] is to be believed. Looking at the graphs at the end, their total budget was somewhere around $45MM USD for FY2022-2023 (but there are two graphs which seem to have different numbers, among other problems).

[1] https://thehansfoundation.org/wp-content/uploads/2023/12/THF...

jcparkyn··on Questioning "The Value of Open Source Software"
> The top 5 programming languages contain C (including C# and C++), [...]

Including C++ in the "C" category is _maybe_ defensible (at least the use cases overlap), but including C# is crazy. And then in the same sentence they list JS and TS as different languages!

jcparkyn··on Show HN: A no-frills CV template using Typst and YAML to version control CV data
Interesting example that I hadn't considered. But, since Typst is a programming language, there are lots of ways the same thing could be achieved directly in the language. E.g.:

    // Change this to switch languages
    #let selectedLang = "en"
    #let lang(..arguments) = arguments.named().at(selectedLang)
    
    #workinfo(
      position: lang(en: "Senior Developer", es: "Señor Developer"),
      etc...
    )
jcparkyn··on Show HN: A no-frills CV template using Typst and YAML to version control CV data
Looks cool (I'm a big fan of Typst), but I do question the value of moving the data to yaml, rather than just building a set of Typst functions and styles (see example below).

To me, it's one of those things people often do because it _feels_ nice, but when you really think about it the benefits are often very small (and the costs are quite high). The most obvious benefit is that the yaml data can be parsed by other programs, but is anyone really going to do that?

For an example of what I mean, is [1] (plus all the supporting code) really a better DX than [2] (which is also simpler to implement and much easier to debug and modify)?

[1]

    work:
      # Can't use markup or code in most of these fields, even if I wanted to.
      - organization: X Company
        position: Senior Developer
        url: https://example.com
        location: Remote / New York, New York
        startDate: 2021-08-01
        endDate: "present"
        highlights:
          - "Any markup I use here needs to be `eval`ed, and I don't get syntax highlighting etc."
[2]

    == Work Experience

    #workinfo(
      organization: "X Company",
      position: "Senior Developer",
      url: "https://example.com",
      location: "Remote / New York, New York",
      startDate: "2021-08-01",
      endDate: "present",
      highlights: (
        [I don't need to use `eval` any more],
        [etc...]),
    )

    #workinfo(etc...)
jcparkyn··on Deep cloning objects in JavaScript
I know you were mostly joking, but for cloning dates you can "just" use the constructor (https://stackoverflow.com/a/69601256).
jcparkyn··on 4B If Statements
Probably Peano numbers.

https://wiki.haskell.org/Peano_numbers

jcparkyn··on San Francisco’s rent prices have never returned to pre-2020 levels
The very first line of the linked article:

"San Francisco rents continue to drop, and they probably haven’t hit bottom."

← PreviousPage 2 of 8Next →