HNHacker News
TopNewBestAskShowJobs

ggregoire

4,955 karma · joined October 31, 2012

submissionscomments
ggregoire··on Dependency management fatigue, or why I forever ditched React for Go+Htmx+Templ
> The react community has 10 python v2->v3 situation in any given year.

That is not my experience. Maybe you could share with us some examples?

My most important dependencies, after React itself and TypeScript, are react-router (which released v6 in 2021) and react-query (which released v5 in 2023). I don't remember other major breaking changes in recent years, at least with the dependencies I'm using.

ggregoire··on Dependency management fatigue, or why I ditched React for Go+HTMX+Templ
While I also think react-query should have kept v5 compatible with the v3 API (even if the new API is better, keep the old one optional, at least for a while), the migration is fairly easy and quick to do, and more importantly, it's not mandatory at all. I still have apps running v3 and v4 without any issues. Also, v3 to v5 is a bump of two major versions, it obviously implies breaking changes [1] (can't tell for Go but this happens in most part of the industry, see for example Python v2 -> v3, SQLAlchemy v1 -> v2 or psycopg v2 -> v3) and it's not like they release a new major version every week.

As someone who do a good amount of frontend dev, I feel like the "dependency management fatigue" sentiment, which is very common on this forum, is way too much inflated. Just keep your dependencies to a reasonable number, pick solid dependencies that don't break their APIs every year, and don't upgrade just for the sake of it. Like you surely do with your backend environment too.

[1] https://semver.org

ggregoire··on Every board game rulebook is awful [pdf]
A large number of players are only interested in those "overly complicated and fiddly" boardgames (commonly known as "heavy"). The BGG ranking is massively dominated by those games [1]. There are also Youtube channels dedicated only to those heavy boardgames [2].

[1] https://boardgamegeek.com/browse/boardgame

[2] https://www.youtube.com/@Heavycardboard/streams

ggregoire··on Please stop the coding challenges
Genuinely curious, knowing nothing about this field: does, for example a neurosurgeon with 15 year of experience, when looking for a new place to work, have to pass surgery "challenges", like doing a lumbar puncture in 15 min on a fake body to prove his experience?
ggregoire··on Docker Compose Isn't Enough
How so? I run docker compose in production on 30 bare metals without any issue.
ggregoire··on Trump wins presidency for second time
You misinterpreted the massive disagreement of the population (20M people) with an affirmation of neutrality. One can hope the dems will not misinterpret it (as they often do, unfortunately, and they already started on twitter and the mainstream media). Hopefully they can recognize and acknowledge that a large portion of the left disagrees with their policies and start listening to their base, otherwise they will keep losing more votes every 4 year.
ggregoire··on Trump wins presidency for second time
Was expected, lot of Americans don't want to be represented by either of those two candidates.
ggregoire··on All political ads running on Google in the US
I don't know if I follow you. My point was that TV networks can't do propaganda for a candidate, i.e. they can repeat the policies of each candidate (without giving you their opinion on those policies and trying to convince you if it's good or bad or modify them) and fact check what they say, but they can't tell you who to vote for or blatantly lie about them. Hence they are neutral. Meanwhile here Fox will just tell you to vote for Trump to save America and that if Harris wins she will turn America into communism, and millions of people are watching and believing it.
ggregoire··on All political ads running on Google in the US
This is the most shocking part from an outsider POV. In Europe* mainstream media must obviously be neutral about each candidate but also give the same amount of airing time to each candidate. So like if candidate 1 is invited for a 10 min interview, candidate 2 must be invited too and offered the same airing time. Meanwhile here Fox can just call Harris "stupid" (and CNN reciprocally call Trump whatever they want), lie to make them look good/bad and support their candidate all day long while spitting on the other one, and it's fine.

Edit: my bad for generalizing all countries of Europe

ggregoire··on Developing with Docker
You can also pass an entire .env file with the --env-file option.
ggregoire··on Skeptical of rewriting JavaScript tools in "faster" languages
Not sure what languages you are thinking to with "most static type systems", but in languages like TypeScript or Rust (and I guess modern Java/C#, haven't touched those in a while), most of the types are inferred by the system such as you don't need to write them. You type your functions arguments (and return values in Rust) and that's about it.
ggregoire··on 4K Gaming on Raspberry Pi [video]
Crazy how big his channel has become. I used to install bare metal servers with Jeff's Ansible scripts almost a decade ago!
ggregoire··on Why does everyone run ancient Postgres versions?
I think it's more about avoiding downtime (I just upgraded a pg with 1TB of data from v11 to v16 and I didn't notice any breaking changes). In an ideal world, every client of the DB should be able to handle the case where the DB is down and patiently wait for the DB to come back to keep doing its job. But from my experience, it's rarely the case, there is always at least 1 micro service running somewhere in the cloud that everybody forgot about that will just crash if the DB is down, which could mean losing data.
ggregoire··on Why does everyone run ancient Postgres versions?
Postgres and mysql usually have changes in each new version that are important enough to motivate an upgrade, whatever it is new features or better performance or both. Although it really depends if your are using the features they are improving or not (e.g. if you don't use partitions, well of course that 30% perf improvement on write operations on partitions won't benefit you).

You can check this article about Uber migrating its Mysql from v5 to v8 posted here 3 days ago [1]. Among other things, they observed a "~94% reduction in overall database lock time." The before/after graph is pretty impressive. It also gave them window functions and better JSON support, which are two very big features.

[1] https://www.uber.com/en-JO/blog/upgrading-ubers-mysql-fleet

ggregoire··on Making the Python back end for my new webapp
> Is anyone actually using FastAPI in a commercial, large scale app? Would you prefer using...say Django or Flask + Gevent (since they're more mature) over FastAPI?

Django and FastAPI are two different things. The former is a huge and opinionated MVC-like web framework and the latter is a simple library to make HTTP endpoints. I prefer FastAPI but it really depends of what you are building and how many people are going to work on that API.

> What's odd for me is that the React website also asks you to pick between either Next.js or Remix[3].

It's indeed very odd, they made this change with the new doc. I would not recommend to pick any of those and just start your project with vite.js, so you can focus on React and keep it simple. You can use react-router for the routes and react-query to call your backend. You don't really need anything else.

ggregoire··on Helping wikis move away from Fandom
Literally the second sentence of the article:

> We’ve spent the last couple months working with the Riot folks and the League wiki editors to move it off of Fandom

ggregoire··on My negative views on Rust (2023)
> I'm unsure why this article is so upvoted given how vapid the content is, but it does have a snappy title, I guess.

rust, sqlite, htmx... there is a small list of techs that always get massively upvoted on hn, whatever the content or quality of the article.

ggregoire··on Gaining access to anyones Arc browser without them even visiting a website
Reading/watching random tutorials and asking basic questions on SO __instead of reading the official docs__ is a trend I've observed for the last 10 years. Even for stuff pretty well documented like Python, Postgres, React, etc.
ggregoire··on Gaining access to anyones Arc browser without them even visiting a website
They disclosed the vulnerability directly to the co-founder CTO.

> the timeline for the vulnerability:

> aug 25 5:48pm: got initial contact over signal (encrypted) with arc co-founder hursh

> aug 25 6:02pm: vulnerability poc executed on hursh's arc account

ggregoire··on Finding and optimizing N+1 queries on a relational database
> If you're starting a project today and considering Django, I highly recommend you go with Nestjs and Prisma instead.

I recommend you to take a look at PostgREST. I replaced all our Django, Flask, Falcon, FastAPI and custom Python HTTP APIs with it. It's phenomenal. It's faster than any of those solutions and adding an endpoint with roles & permissions is just creating a view and executing a bunch of GRANT/CREATE POLICY (takes about 2 min of work). I'm genuinely surprised this didn't replace CRUD APIs in most Postgres shops.

ggregoire··on Show HN: AI Tool Is Now Supporting React, Angular, CSS, Svelte, Vue
In this case is it not faster to just code the component yourself?
ggregoire··on Show HN: PGlite – in-browser WASM Postgres with pgvector and live sync
Wouldn't be easier to have a shared dev database? So that each developer doesn't have to apply the migrations and import the dumps in their local db, and figure out why the local db for dev A is different than the local db for dev B.
ggregoire··on Show HN: PGlite – in-browser WASM Postgres with pgvector and live sync
I was gonna ask what do people use to sync their local pg with their remote pg, but turns out, that's exactly what the authors are building. Cool stuff, and gratz on pglite!
ggregoire··on How Google handles JavaScript throughout the indexing process
jQuery is fine to add some client side interactivity on websites, but it doesn't provide enough structure, automation and reusability tools when it comes to building SPAs. You will eventually have to write your own framework on top of jQuery, which basically makes you reinvent Angular, React, Vue and friends. If you are building a SPA, I'd definitely recommend you to check out one of the existing solutions instead of writing it from scratch. Telling you this based on my experience of building SPAs with jQuery before Backbone and Angular were even a thing.
ggregoire··on How Google handles JavaScript throughout the indexing process
Not interested in changing techs just for the sake of it to be honest.

“If it ain't broke, don't fix it.”

ggregoire··on How Google handles JavaScript throughout the indexing process
> React (and specifically Next.js) is the new IBM[0]: You’ll never get fired for picking it, but it’s going to be expensive, bloated, difficult to get right, and it’s going to be joyless implementing it every step of the way.

Can't tell about Next.js but my conclusions on React are strictly opposite to yours, as someone with 8 years of exp with React, 15 years of exp in the industry, doing front, back and infra on a daily basis. A former teammate also told me last month that his new shop just rewrote their entire front codebase from Elm to React, because of how simple and fast it is to implement anything with React, and how easy it is to find good developers and well maintained packages for it.

ggregoire··on Please Stop Reinventing JSX
I don't get the "reinventing JSX" part, it's not what's happening here. JSX allows you to render a list by iterating over the elements of a JS array, using directly the .map method of the Array object. It's one of the main features of JSX. I'm very confused by the title, is it just clickbait?
ggregoire··on Panic at the Job Market
web programming is probably on the 3rd or 4th rank of what python is used for nowadays

Also, you don't really need to "learn" python. I mean, if you have been in this industry for long enough, it's the kind of languages that you can pick up in 1 afternoon. That's just how basic and easy it is. That's why it's so popular despite all its flaws. Like I'm sure you somehow already know python, even if you never used it.

ggregoire··on How we sped up Notion in the browser with WASM SQLite
> Using SQLite improved page navigation times by 20 percent in all modern browsers.

Couldn't you cache the data in LocalStorage and get similar speed improvements?

I mean, how to run SQLite in the browser is a great topic and surely has a lot of very good use cases. But attributing the performance improvements to it sounds a bit misleading, when you had no client caching strategy before and you do now. Obviously loading data from a local cache is faster than loading data from a remote server.

Comparing WASM SQLite vs. other client caching solutions (LS, IndexDB, etc) could be interesting. In terms of perf, complexity, compatibility, storage capacity, query language, etc.

ggregoire··on Rye: A Hassle-Free Python Experience
Indeed. Docker solved distributing and running python programs like 10 years ago. You can even run CUDA and pytorch in docker nowadays. And the usual answers you see on HN every time someone brings up "just use docker" on those threads, is "but I don't wanna """learn""" docker". Takes 10 min to get a python container running with 0 experience in Docker.
← PreviousPage 4 of 33Next →