HN user

nicopappl

470 karma

https://nicopap.ch

Posts8
Comments38
View on HN

It assumes that "Skill" is a 1d value. But the ability to write quality code and the ability to debug are a bit orthogonal.

Being better at debugging doesn't necessarily makes you better at writing less complex, more approachable code. Though debugging should teach you which patterns cause bugs or impede debugging.

And what do you do once you are so skilled your software doesn't have bugs? :P

Regarding self improvement, Aaron Swartz put it better here: https://web.archive.org/web/20240928215405/http://www.aarons... (tldr: do things you don't like)

I can't say about France. But in Switzerland, there is a "three strikes" system where if you are caught with drug, the first time you have a $100 fine; Then a higher fine, called "Day-fine" which is proportional to your income; Then maybe, just maybe, a jail sentence.

Comparing that to the US, where if you get caught dealing marijuana, you get a 5 years minimum sentence. That seems disproportionate to me. Maybe police in the US is more compassionate than some militants make it seem, and that's why they don't like catching people for that kind of crime?

Looking at Wikipedia[1] it appears the number of policemen per people is two times higher in the US than Switzerland, and about the same as France. If it is true that "the police are plentiful and they come down fast" in Switzerland (which I would not agree with), it is twice as true in the US.

[1] https://en.wikipedia.org/wiki/List_of_countries_and_dependen...

Accelerando (2005) 2 years ago

Diaspora is a book for Math PhDs, involving a lot of physics and math theories. Accelerando is a book that anyone can read. Involving hyperintelligent cats and sentient shrimps (actual shrimps, not aliens).

I would recommend it not just for the philosophical aspect (it has a very interesting way of placating transhumanism) but also for the entertainment aspect (aforementioned shrimps, did I mention the Iranian space program?)

Stross is a very approachable author, Accelerando is not his most accessible book, but if you can go through half of Diaspora, you can easily go through the entirety of Accelerando.

Yoo, congratulations to the author for going from this blog post dated to October 2023 to shipping an actual rust crate (bevy_light_2d)!

I suspect the author might be reading this post back and cringe a bit. That last code listing with handle_session_completed triggers my inner clippy. Why clone session.customer_id to then pass it as a reference? Why are those CheckoutSession fields Options?

The other advice I would give is to identify what the author calls "Service" as what is called "view type" or "newtypes" in rust. A newtype wraps another type, to give it a different set of methods. For example, a counter could wrap an i32 and only allow incrementing and reading the value. Or put together a set of references to fields/slices of a struct.

It can be useful, but the way it's used by the author here is not very rusty, and the final suggestion of using a function is a descent alternative. Although I think defining handle_session_completed as a method on CheckoutSession or UserRepo might be better.

If you are interested in creative voter coercion, and generally very creative ways of changing law so that the election results always end up how you like them, I recommend reading up on the very innovative Hungarian system https://www.journalofdemocracy.org/articles/how-viktor-orban...

“Chain voting” ensures that people vote the right way. Voter 1 goes into the polling station,

appears to vote by depositing an empty envelope into the ballot box, but comes out with a

blank ballot. Voter 2 is then sent in with that ballot—now marked by a [party] operative—and

told to put it in the ballot box and exit with another blank ballot in hand. Carried on down

the line, the [...] party boss in the town can ensure that all have voted the proper way

while the election workers find that they are short only one unaccounted-for vote

Wow, this is exactly how I felt with regard to my first job as well. This old codebase no one wants to touch but works somehow. The quite nice later-on additions. Even the "build a pipe-separated string using reflection and a 150 classes hierarchy" rings something.

The old codebase was an hairy ball of scala using a very outdated version of a (now) infamous actor framework. Before they figured out that untyped messages kinda left out one of the major selling point of Scala.

The code was readable, but the authors had this strange idea that every little piece of logic should be part of its own "Actor". An actor is pretty much equivalent to a class, and each one of them had their own little file. With this many classes, with very specialized purposes, you ended up with 90 character identifier names.

To understand what would be a single function in a normal code base, you would have to dive through half a dozen files through several repositories to piece together the logic. Generally, at the end, you find that most of the code is about passing around a value, and there is this one file where there is actual logic applied to the value.

It wasn't that awful. The thing was that it was impossible to change anything: no documentation, no test, no bug tracking, not even any PR process, laconic commit messages, no Wiki pages. And the actor framework made it very difficult to add tests. But later developers did manage it pretty well, they drew fences around the old services, with an HTTP API to communicate with it. And all later additions were part of different services that were very cleanly and consistently designed.

Tooling

When your text editor is not enough for a task, and it hopefully is extensible, consider writing little plugins to reduce repetitive tasks.

Here is an example. I was working with a legacy code base using an infamous Scala actor framework. Basically, all function calls were replaced by message passing. All messages were sent as 'Any' objects, then downcast to the expected type, so an IDE wasn't of much use. I wrote a little bash script to populate a jump buffer in vim with the result of a grep, and suddenly, I had jump functionality! Originally, I had to jump to type definition, hope that the associated "received message" type was in the same file, then look for downcasting into that received type. I don't remember precisely the details, but what I do remember is that the little script helped go from a few seconds to just pressing two keys to navigate the code. It's especially useful for legacy code, where the main activity associated with it is reading and understanding.

Our capacity to focus as humans is limited in time and energy. Writing tools to do in half a second what otherwise would take a few seconds can help, not only to make you faster (for that, refer to xkcd 1205) but also to effectively increase your capacity to focus.

Though being able to develop your own tooling is less important today. Languages and frameworks nowadays prioritize tooling as an important feature. And I'm grateful for that, programming used to be much more annoying.

Inkscape 1.3 3 years ago

Yes!

I use regularly Inkscape, and it has been a constant source of frustration. The UI is the exact opposite of how I expect things to work.

It's improving at breakneck speed though. 1.2 already solved some of my frustrations (the new interface for linecaps & line dots, amazing!)

Almost all the features in this release seem to solve a major frustration I had with Inkscape.

* The node deletion behavior, it was so annoying, how you delete a node on a straight line and suddenly you get some soup.

* The awful color palette. You had to manually edit text files to get your own palettes, couldn't edit them in Inkscape. I, in fact, never managed to create a custom palette. Pinned colors seem to solve this.

* Lasso selection. It was soo fiddly to select a group of nodes. One missclick and you had to start from scratch, clicking on the tinny controls.

* Multithreaded rendering. The single-threaded software renderer is a misery for complex projects, or just zooming in. Now Inkscape is going to be 12 times faster on my machine

* Font selection was utter garbage, the new UI seems promising

* Patterns was also a constant source of frustration, looks like this release improves it.

This is exciting. I'm looking forward to use this new release.

Now please give me a dialog for key rebinding, similar to Krita. And better key binding discoverability.

Nice post.

Personally I find the way rows are added in this post a bit confusing. It's done for the sake of illustrating a source of data where rows elements of the jagged array are not accessed sequentially. That's reasonable for the purpose of the post, but for someone not familiar with jagged arrays, it can be a bit confusing. A more traditional way of building a jagged array is as follow:

    struct JaggedArray<T> {
        offsets: Vec<u32>,
        data: Vec<T>,
    }
    // impl JaggedArray<T>
    fn add_row(&mut self, row: Vec<T>) {
        self.data.extend(row);
        self.offsets.push(self.len());
    }
    fn get_row(&self, row: usize) -> &[T] {
        let start = self.offsets[row] as usize;
        let end =  self.offsets[row + 1] as usize;
        &self.data[start..end]
    }
Now this could be improved to reduce allocations, but it's fine as an illustration.

I personally prefer to store the end element in the 'offsets' array, since you know the first offset will always be zero. With this, the 'offsets' array has as many elements as the jagged array has rows, which I find elegant:

    fn get_row(&self, row: usize) -> &[T] {
        let start = if row == 0 { 0 } else { self.offsets[row - 1] as usize };
        let end =  self.offsets[row] as usize;
        &self.data[start..end]
    }
Jagged arrays are super useful as lists of list, some better perf characteristics than the naive Illife Vector. I've used them extensively lately. It's also extra fun when you combine them with a bitset.

With a vector as backing storage, jagged arrays are also not limited to a fixed size! You can trivially add new rows or extend the last row. This comes in handy in a parsing context.

To clarify this. On my RX5700 XT, with ROCm, Stable Diffusion generates images on the default sampler at 512x512 20 passes in about 2 seconds. It's definitively slower than a similar NVIDIA card, but I've no concrete numbers.

It's still a pain in other ways. AMD does not support ROCm on consumer-grade GPUs, it only "happens to work". I had to explicitly install the 3.10 python interpreter and use an older torch version, because seemingly, the newer ROCm releases do not support the RX5700 XT. Also ROCm only works on Linux.

I recommend Stanisław Lem's Cyberiad. The English translation has amazing prose and it is hilarious. I can't recommend anything else :) I like Charles Stross, good sci-fi with a satirical strike, but he's not as good with words as the authors you mention.

I've seen this still be recommended in 2021. I personally read it last year and it was definitively helpful.

Just excellent if you want to understand what is going on under the hood. Which is necessary if you are writing anything more than a toy graphic program, or understand the output of GPU debugging/profiling tools from Nvidia and AMD.

I know I shouldn't recommend it because it is extremely addictive, but try Oxygen Not Included. To me it is like Rimworld, but without the feeling of arbitrary nonsense sometimes literally falling on your colonists' head. There is a lot of challenges, and all of them are natural consequences of the simulation. It's much more "emergent simulation" although since the simulation is much more focused on physics than humans, it might feel a bit too technical.

AI Homework 4 years ago

Like Stratechery, my immediate concern is education. But not just homeworks (which actually were already criticized, I think the gears are already moving with regard to relying less on this kind of assignments)

The real problem is entry-level opportunities. As a developer, I experienced first hand how great ChatGPT is. I can just submit an undecipherable bash one-liner I wrote 6 months ago and it will explain in details what it does.

I tell it "write a command line utility using libraries X and Y to convert MessagePack to JSON" and it writes it. It's pretty bad, so I type "refactor duplicate code into a single function" or "put that string into a constant" and it does it. Amazingly.

It's not perfect, sometimes it is completely wrong and persists in it, like Trurl's first machine in the Cyberiad, but my experience tells me what is credible and what isn't. What elements of the answer are total bullshit.

But to build that experience, I first had to write that code. How will a junior programmer find a job when all the menial labor can be done so easily in two seconds by an AI? This is not limited to programming, other domains where writing dominate are also a concern.

We need somehow a safe space for people to experiment and become experts. If we blindly use ChatGPT I fear we are going to cut out the opportunity to become an expert to a whole generation.

AI Homework 4 years ago

I found that understanding compilers was precious at several occasions, especially for cross compilation and embedded programming. Even for Java, for uni assignments, I was completely flabbergasted and at a lost when my IDE stopped working with cryptic messages. Understanding the process of creating object files, what javac does, what goes into a jar helps. As much as understanding what a compiler does, its relationship wtih linkers, how libraries are "added" to an executable (dynamically or statically)

Beside, with ChatGPT in its current state, it's still absolutely impossible to get it to produce any useful code without knowing how code works. There is an advantage to the precise specification of a formal language. At least for the next decade, I think there will be human proof-reading AI output before generated code is ran, with catastrophic consequences when that doesn't happen.

What I've difficulties getting over right now is every time I write something (text or code) I ask myself "Could ChatGPT have written it better?"

This is the exact premise of one of the stories in the Cyberiad. The main character Trurl builds a machine and it is convinced that two and two is five, so much so that when Trurl refutes it, it starts getting angry and hunting its creator.

There is also another story, "The Electronic Bard" another computer made by Trurl, capable to write such good poetry that poets start to give up on life. ChatGPT is surprisingly good at writing romantic poems in the language of pure mathematics! Though still needs some work on rhyming.

Of all the Sci-fi AIs, we ended up with the ones from the Cyberiad. Amazing.

Accelerando (2005) 4 years ago

Consider reading Existence by David Brin. The book premise is the first alien contact being a pyramid scheme.

It is true that power laws are seen everywhere, and that there are reason for those.

I like the article, because it exposes very quickly a very powerful idea, but I disagree with the conclusion.

Information networks are built by humans, they are designed, they are not necessarily bound by the rules of evolution. Which means we may yet be able to find a system that is not afflicted by the curse of perpetual destruction and reconstruction.

The essay you linked doesn't at all convey that Wikipedia is cancer, in fact it does somewhat the opposite. A shame the title is so inflammatory and doesn't at all reflect the content.

It's in fact a seriously amazing essay, thank you for sharing it here. The 2006 Jaron Lanier essay, in addition with the 13 responses (including from Cory Doctorow and Jimmy Wales) is a golden nugget of internet history, and a snapshot of what people believed would be the future of the internet (oh boy, with 15 years of insight, there is quite a lot to say)

You may be interested in Fraidycat.

Per the description:

Fraidycat is a desktop app or browser extension for Firefox or Chrome. I use it to follow people (hundreds) on whatever platform they choose - Twitter, a blog, YouTube, even on a public TiddlyWiki.

This doesn't solve the problem of discoverability, but it solves half of what you described.

https://fraidyc.at/

After a certain level of wealth, most assets are financial and liquid cash becomes a vanishingly small part of total wealth.

I've absolutely 0 info on cash distribution across the richest people, but this figure shows average asset across all people (in France). It still can be helpful as a way to "visualize" asset type property distribution across the spectrum.

http://piketty.pse.ens.fr/files/ideology/pdf/F11.17.pdf

× The Cyberiad (English translation) by Stanisław Lem. It's the most hilarious science fiction I've read. It hits a special note with me, I actually immediately started reading it again from the start as soon as I finished it.

× The Dawn of Everything by David Graeber & David Wengrow. An amazing rethinking of archeology, a denunciation of social orthogenesis and an invitation to dream of a better world

Other mentions are long fantasy series, including a complete re-read of the Discworld series by Terry Pratchett and Tchaikovsky's Shadow of the Apt (not his best, but frighteningly relevant in 2022. A story about the Eastern "wasp empire" invading the west and all its strategies of propaganda, division and subjugation)

Note that this blog post announces that Code Simplicity is published as a free pdf download by the author. I'd suggest changing the title to "Code Simplicity: now free to download" or something.

I can recommend Code Simplicity. It's a very short book and provide very useful insight.

The author was a lead developer in the Bugzilla rewrite. Which seemed to be quite an adventure. And illustrates his ideas with Bugzilla's numerous maintainability issues.

I read it before starting my career as a developer, and I think it deeply influenced the way I approach writing code. It doesn't have as much as practical recommendations, but provides a helpful framework to think about how to write code and avoid general pitfalls.

I think code I wrote in my first job was praised as greatly readable only because I integrated the book's teaching before I had to learn them for myself.

Maybe it's not a "must read" for experienced devs, but I found it useful when I started.

You'd definitively be interested by the ryg[1] series on the graphic pipeline. It goes in details about how bits get to the GPU and how the GPU handle them. The author writes that using a 3D graphics API is a prerequisite. To the contrary, the series itself is great to get a grasp on things and not feel completely alienated by 3D graphics APIs if you ever decide to use one in the future. It's fairly old (2011) but I still see it recommended as a relevant resource today.

[1] https://fgiesen.wordpress.com/2011/07/09/a-trip-through-the-...

Ahah, I'm glad to see you here! I do enjoy the postfinance app, but I recently had to use the service.post.ch website, and it was one of the most unpleasant experience I had with a computer in recent times. I'm so sorry to breach all protocols of decency and just complain here, but I thought "if only I get a hold of the [derogatory term] who designed that website," and you are here!

The praise in this thread is clearly from people who never had anything to do with the modern Swiss Post.

I had to setup a mail "hold" order (in Switzerland you have to pay an extra fee and make a request to not deliver mail when you leave for a few weeks) and I found the UI to be very confusing.

I think the design of the site could be improved, here is what annoys me the most:

* The "clickable" button color being so close to the "disabled" color that it's very hard to distinguish when they are not next to each other (as most of the time) and very confusing when you try to click on a seemingly active button and nothing happens

* Calendar widgets letting you select every date, but after selecting the date, you get an error message

* communications in German despite the whole process being in French and the destination address being in a 100% French speaking canton

* downright bad French translation (hi from the 25% of the Swiss population) eg: "Reprendre" is *not* a valid button name, maybe use "selectionner"

* ending into a redirect loop when going back during the check-in step

The UI feels broken. There is a lot of "strange" space, or button layouts accidentally ending up on two rows eg: the login nag dialog (I could reproduce it on Firefox and Chrome).

It felt like a miracle when I managed to complete the process after about 1 hour (process that technically only requires my name, address and payment coordinates)

I'm used to computers acting up and generally bad software (hell, I use Linux), so I could handle it, but my mom says she has trouble with the website as well.

If you need more details, or a generous Romand QA tester, don't hesitate to contact me (domain of email address in my user profile).

I feel that good software is important, especially for a state-run monopoly. Because it's always the most marginalized people that end up eating up the hidden costs of rushed-up software.

Remember that even those people you are citing built on someone else's work. Someone's contribution may simply be a tinny layer on top of an already existing massive amount of work. It is difficult to distinguish new work from pre-existing work in a domain you have no expertise in.

The other thing is: no person is an island. The rust compiler is the work of an absurdly large amount of people, the most visible members of the community absolutely deserve their reputation, but you must not forget that rust is mostly people like you and I. People who may have contributed a tinny bit and do not get a wide recognition.

I use the "I don't care about cookies" browser extension with "Cookie AutoDelete". Cookies are managed client-side, those banners are redundant. The purpose of open standards is that you can have a user-agent that does whatever you want it to do, so take advantage of that.

Cookie banners are the dictionary definition of a meme. They give the site makers a piece of mind, helping them sleep better at night, even if they may have no other practical purpose. Other site makers see them and reproduce them because it gives them the same piece of mind, exposing the banners to more site makers. Obviously, there are better ways to get a piece of mind as webmaster, but you'd need first to explain the problem to a lot of people before anything changes.