6 ms·
Last night I built a website from scratch. Not a landing page. A full blog with three-domain routing, animated video covers, an audio player with playlists, dar
by riclib 6mo ago
Last night I built a website from scratch. Not a landing page. A full blog with three-domain routing, animated video covers, an audio player with playlists, dark mode, RSS feeds, social cards, and a sticky sidebar with a lightbox. Seven commits. Zero test failures. One binary.
The site you've read the article on. Built in one session. In Go.
I work with an AI that writes most of the code. The question everyone asks is which language to vibe in. Python is fast to start. Rust is correct by construction. Go is boring.
I choose boring. Here's why.
- malcolmgreaves 6mo agoYou also have AI write your HN comments.
- sodapopcan 6mo agoHere's why!
- saidnooneever 6mo agoevery page includes inline css, js etc. so each load it will pull all of that in each time. so each page transfer. you could put the css and js parts that are common between them into separate files so that the browser can cache them and your users and server save some bandwidth. happy to see most of it looks kinda decent. Not sure why you promote the site as being built in Go because its html, css and javascript. The backend can be go, but since it is not visible and theres no link to that code its impossible to see if its good or bad. the fact it does xyz doesnt really say anything about code quality..it just confirms the happy path works which is what AI is pretty good at. it might be interesting to open it up for scrutiny and get some contributions if its good or some tips for footguns or bugfixes if there are such things. not trying to discourage ofcourse :D and it sounds like a fun and rewarding project and ultimately i can navigate the pages just fine and it works ok on my connection regarding the bandwidth remark. (thats long run savings i guess, or handier when u receive higher volume traffic perhaps?)
- riclib 6mo agoFair comment. In my production code I always separate out the css and embed it in the go binary as files that can be cached. Having it in embedded into the page was really useful to iterate behind cloudflare and not worry about css caching but is a terrible practice.
- Cthulhu_ 6mo agoCounterpoint, inlining CSS / JS used to be an optimization in early website optimizers, because fetching multiple files incurred more HTTP overhead, and (...I think) compression was more efficient working on a single file vs three. I don't think these arguments hold up anymore with http 2/3, but still, it used to be an optimization.
- gerdesj 6mo agoWould you mind showing us the Go bits of this website? I'm also struggling with this: "The compiler is the floor. The human is the taste. The binary is the proof." I'd initially go for parody but I'm not laughing (inwardly).
- riclib 6mo agoYes, this is the serious (?) front end to a satirical website.
- hackingonempty 6mo agoWhy use an obscure language like Golang when you can use Java? It is just as capable and boring as Golang but has an order of magnitude or two more available libraries, training data, and runtime support.
- wanderlust123 6mo agoObscure? That is just false
- alexjplant 6mo agoIf you've only had exposure to one corner of the software industry then it's very easy to develop blinders. Not saying that this is what parent is guilty of but as somebody who has regrettably had this particular problem in the (thankfully distant) past I feel compelled to point out that this type of ignorance is sometimes just a side effect of one's circumstances. As an example PHP still powers something like 75% of web sites and I've never once used it professionally. If I didn't know better I might think it dead.
- spwa4 6mo agoOkay ... here is that code: import net/http func main() { http.ListenAndServe(":8080",http.FileServer(http.Dir("."))) } Oh and in python: "python3 -m http.server" ...