Get the latest tech news

Linus Torvalds and the Supposedly "Garbage Code"


Linus Torvalds criticized a RISC-V Linux kernel contribution from a Google engineer as “garbage code.” The discussion focuses on the helper function make_u32_from_two_u16() versus Linus’s pro…

Let’s discuss the importance of using proper type casting, bit manipulation, and creating a safer, reusable macro or function for clarity and bug reduction. And, if this operation of combining two uint16_t into a uint32_t is done in several places, you sure have many opportunities to introduce bugs with the explicit code that Linus advocates for in his email! So, it would be much better, clearer, nicer, and safer, to raise the semantic level of the code, and write a helper function or macro to do that combination safely and correctly.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Linus Torvalds

Linus Torvalds

Photo of garbage code

garbage code

Related news:

News photo

Linus Torvalds warns Linux devs: Stop cluttering patches with automated, useless links

News photo

Linus Torvalds is sick and tired of your 'pointless links' - and AI is no excuse

News photo

Linus Torvalds Expresses Frustration With 'Garbage' Link Tags In Git Commits