HNHacker News
TopNewBestAskShowJobs

jonathrg

883 karma · joined July 29, 2021

submissionscomments
jonathrg··on Please just try HTMX
Rust is doing great.
jonathrg··on Cloudflare was down
Why not? They have been proudly vibe coding for a while.
jonathrg··on Zigbook Is Plagiarizing the Zigtools Playground
It's unbelievable to me that Github allows repo admins to edit other people's comments.
jonathrg··on Do you know that there is an HTML tables API?
This is not an improvement. Having named variables for things is good actually. They will need to be declared again immediately once you want to modify the code. insertCell(i).innerText = c is a nonsense statement, it should be 2 lines for the 2 operations
jonathrg··on Go beyond Goroutines: introducing the Reactive paradigm
It's really tough to read through a text where you can't go more than a few sentences without having something be described as *an adjective, a second adjective, and a third adjective*. Just let the code example speak for itself, man.

Speaking of the code examples, I am not convinced at all. The supposedly bad example is idiomatic and understandable to me, and I have a much better idea of what's going on than in the supposedly good examples. It contains the kind of constructions I expect to see when working on a Go codebase, and it will be easier to modify correctly for another Go developer coming in later. Please, work with the language instead of forcing it to wear a programming paradigm it doesn't like.

jonathrg··on System.LongBool
You can just make stuff up on this website
jonathrg··on Trump pardons convicted Binance founder
Yeah that's pretty much what happened last time I tried to reinstall my distro
jonathrg··on /dev/null is an ACID compliant database
You can store any data as long as it doesn't contain any ones
jonathrg··on Casey Muratori: I can always tell a good programmer in an interview
What is Flynn factor?
jonathrg··on Show HN: Cuq – Formal Verification of Rust GPU Kernels
It sounds like cuck.
jonathrg··on Element: setHTML() method
Why? Does it not set the HTML?
jonathrg··on Mathematicians have found a hidden 'reset button' for undoing rotation
Every (mathematical) knot is one that can't be untangled, by definition.

Every knot with a cut can be trivially collapsed go a point by moving one of the endpoints to the other one through the path of the knot

jonathrg··on Best xkcd
That's &&

& runs the thing in the background. So this is running all the commands in parallel.

jonathrg··on Categorical Foundations for Cute Layouts
Needs to be capitalized as CuTe
jonathrg··on Want to piss off your IT department? Are the links not malicious looking enough?
It's a nice touch that the buttons are styled like ads.
jonathrg··on Two Slice, a font that's only 2px tall
Her wa[]y hair was a challenge for the hairdresser
jonathrg··on Protobuffers Are Wrong (2018)
The generated types in go are horrible to work with. You can't store instances of them anywhere, or pass them by value, because they contain a bunch of state and pointers (including a [0]sync.Mutex just to explicitly prohibit copying). So you have to pass around pointers at all times, making ownership and lifetime much more complicated than it needs to be. A message definition like this

    message AppLogMessage {
        sint32 Value1 = 1;
        double Value2 = 2;
    }
becomes

    type Example struct {
        state                    protoimpl.MessageState 
        xxx_hidden_Value1        int32                  
        xxx_hidden_Value2        float64                  
        xxx_hidden_unknownFields protoimpl.UnknownFields
        sizeCache                protoimpl.SizeCache
    }
For [place of work] where we use protobuf I ended up making a plugin to generate structs that don't do any of the nonsense (essentially automating Option 1 in the article):

    type ExamplePOD struct {
        Value1 int32
        Value2 float64
    }
with converters between the two versions.
jonathrg··on What to do with C++ modules?
I understand and empathize with your fear. C++23 added a type with 22 constructors (http://en.cppreference.com/w/cpp/utility/expected/expected.h...), that ought to be enough to strike fear into anyone.
jonathrg··on What to do with C++ modules?
C++ is widely used in embedded. Most compilers support it. Usually you turn some things off (e.g. -fno-rtti, -fno-exceptions) and try to stick to some sane subset of the ++.
jonathrg··on “This telegram must be closely paraphrased before being communicated to anyone”
The term to google for more information about this would be Known plaintext attack.
jonathrg··on Palantir CEO Alex Karp's Letter to Shareholders
This reads like a Bryce P. Tetraeder quote
jonathrg··on Guid Smash
You would need a little more memory to see/detect that collision.
jonathrg··on Dev Compass – Programming Philosophy Quiz
Yes, it's so easy to tell which direction each question will push the result, that it kinda distracts from thinking about the question
jonathrg··on Traps to Developers
> If you already use locking, no volatile needed.

Kinda misleading. volatile is for memory mapped I/O and such. volatile means the memory access really happens

jonathrg··on Python performance myths and fairy tales
It's much more than 1%, it is what enables commonly used libraries like pytest and Pydantic.
jonathrg··on What the Fuck Python
bool() is not a function named after a fundamental type. bool is a type. As with any type, you can call bool(...) to construct a new object of that type.

https://docs.python.org/3/library/functions.html#bool

A good tutorial will reflect this fact and use appropriate language.

Both the idea that you can "cast", and the idea that bool is a function, are misunderstandings rooted in the idea that Python should be like C in all ways.

jonathrg··on What the Fuck Python
> If casting from a string to a type works with ints and floats, why not with bools? What possible justification is there?

There's no type casting in Python. int(), float() and bool() just create objects of their respective types, passing the arguments to the initializer. They are not fundamentally different from, say, PostgresqlDriver() in this regard.

Different classes will provide different ways to construct objects depending on what is most useful. For int and float, the most useful thing to do when receiving a string is to parse it; for bool, the most useful thing to do is to check its truthiness; for PostgresqlDriver, the most useful thing to do is to interpret it as a database URL and connect to it.

jonathrg··on What the Fuck Python
You can't go calling the police on people for writing idiomatic Python code.
jonathrg··on That XOR Trick (2020)
(wrapping) overflow doesn't affect the final result.
jonathrg··on Go 1.24's go tool is one of the best additions to the ecosystem in years
My first thought was Monokai (the default theme in Sublime Text 3 and earlier)
← PreviousPage 2 of 7Next →