frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Brent's Encapsulated C Programming Rules (2020)

https://retroscience.net/brents-c-programming-rules.html
9•p2detar•1h ago

Comments

jjgreen•59m ago
Outstanding, why hadn't I come across this before?
Jean-Papoulos•38m ago
>What this means is that you can explain all the intent of your code through the header file and the developer who uses your lib/code never has to look at the actual implementations of the code.

I hate this. If my intellisense isn't providing sufficient info (generated from doc comments), then I need to go look at the implementation. This just adds burden.

Headers are unequivocally a bad design choice, and this is why most of every language past the nineties got rid of them.

unwind•16m ago
Quite interesting, and felt fairly "modern" (which for C programming advice sometimes only means it's post-2000 or so). A few comments:

----

This:

    struct Vec3* v = malloc(sizeof(struct Vec3));
is better written as:

    struct Vec3 * const v = malloc(sizeof *v);
The `const` is perhaps over-doing it, but it makes it clear that "for the rest of this scope, the value of this pointer won't change" which I think is good for readability. The main point is "locking" the size to the size of the type being pointed at, rather than "freely" using `sizeof` the type name. If the type name later changes, or `Vec4` is added and code is copy-pasted, this lessens the risk of allocating the wrong amount and is less complicated.

----

This is maybe language-lawyering, but you can't write a function named `strclone()` unless you are a C standard library implementor. All functions whose names begin with "str" followed by a lower-case letter are reserved [1].

----

This `for` loop header (from the "Use utf8 strings" section:

    for (size_t i = 0; *str != 0; ++len)
is just atrocious. If you're not going to use `i`, you don't need a `for` loop to introduce it. Either delete (`for(; ...` is valid) or use a `while` instead.

----

In the "Zero Your Structs" section, it sounds as if the author recommends setting the bits of structures to all zero in order to make sure any pointer members are `NULL`. This is dangerous, since C does not guarantee that `NULL` is equivalent to all-bits-zero. I'm sure it's moot on modern platforms where implementations have chosen to represent `NULL` as all-bits-zero, but that should at least be made clear.

[1]: https://www.gnu.org/software/libc/manual/html_node/Reserved-...

Where are you supposed to go if you don't care about growth?

https://ramones.dev/posts/where-are-you-supposed-to-go/
39•ramon156•43m ago•25 comments

LLM from scratch, part 28 – training a base model from scratch on an RTX 3090

https://www.gilesthomas.com/2025/12/llm-from-scratch-28-training-a-base-model-from-scratch
141•gpjt•6d ago•19 comments

Show HN: AlgoDrill – Interactive drills to stop forgetting LeetCode patterns

https://algodrill.io
36•henwfan•1h ago•19 comments

The Joy of Playing Grandia, on Sega Saturn

https://www.segasaturnshiro.com/2025/11/27/the-joy-of-playing-grandia-on-sega-saturn/
71•tosh•3h ago•28 comments

Epsilon: A WASM virtual machine written in Go

https://github.com/ziggy42/epsilon
66•ziggy42•1w ago•19 comments

ZX Spectrum Next on the Internet: Xberry Pi ESP01 and Pi Zero Upgrades

https://retrogamecoders.com/zx-spectrum-next-on-the-internet-xberry-pi-esp01-and-pi-zero-upgrades/
13•ibobev•2h ago•0 comments

A deep dive into QEMU: The Tiny Code Generator (TCG), part 1

https://airbus-seclab.github.io/qemu_blog/tcg_p1.html
21•costco•6d ago•1 comments

Icons in Menus Everywhere – Send Help

https://blog.jim-nielsen.com/2025/icons-in-menus/
608•ArmageddonIt•17h ago•250 comments

No ARIA is better than bad ARIA

https://www.w3.org/WAI/ARIA/apg/practices/read-me-first/
79•robin_reala•6d ago•48 comments

The universal weight subspace hypothesis

https://arxiv.org/abs/2512.05117
304•lukeplato•12h ago•106 comments

Kroger acknowledges that its bet on robotics went too far

https://www.grocerydive.com/news/kroger-ocado-close-automated-fulfillment-centers-robotics-grocer...
192•JumpCrisscross•13h ago•176 comments

Why frozen test fixtures are a problem on large projects and how to avoid them

https://radanskoric.com/articles/frozen-test-fixtures
3•amalinovic•1h ago•0 comments

Manual: Spaces

https://type.today/en/journal/spaces
76•doener•12h ago•7 comments

Brent's Encapsulated C Programming Rules (2020)

https://retroscience.net/brents-c-programming-rules.html
9•p2detar•1h ago•3 comments

Transformers know more than they can tell: Learning the Collatz sequence

https://www.arxiv.org/pdf/2511.10811
4•Xcelerate•5d ago•0 comments

Jepsen: NATS 2.12.1

https://jepsen.io/analyses/nats-2.12.1
383•aphyr•18h ago•142 comments

Strong earthquake hits northern Japan, tsunami warning issued

https://www3.nhk.or.jp/nhkworld/en/news/20251209_02/
326•lattis•22h ago•151 comments

Microsoft increases Office 365 and Microsoft 365 license prices

https://office365itpros.com/2025/12/08/microsoft-365-pricing-increase/
404•taubek•23h ago•470 comments

Has the cost of building software dropped 90%?

https://martinalderson.com/posts/has-the-cost-of-software-just-dropped-90-percent/
310•martinald•17h ago•470 comments

AMD GPU Debugger

https://thegeeko.me/blog/amd-gpu-debugging/
260•ibobev•20h ago•49 comments

Launch HN: Nia (YC S25) – Give better context to coding agents

https://www.trynia.ai/
121•jellyotsiro•19h ago•76 comments

Let's put Tailscale on a jailbroken Kindle

https://tailscale.com/blog/tailscale-jailbroken-kindle
294•Quizzical4230•20h ago•72 comments

Horses: AI progress is steady. Human equivalence is sudden

https://andyljones.com/posts/horses.html
451•pbui•12h ago•365 comments

Trials avoid high risk patients and underestimate drug harms

https://www.nber.org/papers/w34534
135•bikenaga•17h ago•42 comments

IBM to acquire Confluent

https://www.confluent.io/blog/ibm-to-acquire-confluent/
408•abd12•23h ago•327 comments

A thousand-year-long composition turns 25 (2024)

https://longplayer.org/news/2024/12/31/a-thousand-year-long-composition-turns-25/
27•1659447091•5h ago•5 comments

Paramount launches hostile bid for Warner Bros

https://www.cnbc.com/2025/12/08/paramount-skydance-hostile-bid-wbd-netflix.html
335•gniting•22h ago•355 comments

Hunting for North Korean Fiber Optic Cables

https://nkinternet.com/2025/12/08/hunting-for-north-korean-fiber-optic-cables/
264•Bezod•20h ago•102 comments

Cassette tapes are making a comeback?

https://theconversation.com/cassette-tapes-are-making-a-comeback-yes-really-268108
110•devonnull•5d ago•187 comments

The Lost Machine Automats and Self-Service Cafeterias of NYC (2023)

https://www.untappedcities.com/automats-cafeterias-nyc/
79•walterbell•12h ago•25 comments