Why do NetBSD and OpenBSD have more lines of code than Linux?

According to the Open Hub website, Linux has 37,016,567 lines of code, but this is small compared to NetBSD and OpenBSD, which have 72,065,568 and 81,902,070 lines of code, respectively.

Is there a reason why Linux has fewer lines of code compared to NetBSD and OpenBSD? I'd like to know.

20 points · 12 comments · view on lemmy.world

12 Comments

mech@feddit.org · 70 pts · 278d (1 reply)

You're comparing a kernel with an entire operating system.

vext01@lemmy.sdf.org · 11 pts · 277d

This.

mrus@lemmy.sdf.org · 31 pts · 278d

Your numbers don't check out, please provide sources. The Linux Kernel has around 40 million lines, the OpenBSD kernel around 7. You might have mistakenly counted OpenBSD/NetBSD as a whole system (the base installation), instead of solely the kernel.

DFX4509B@lemmy.wtf · 9 pts · 278d

Given BSD is supposed to be a complete package while Linux has a separate kernel and userland, that's probably why.

beutlin@feddit.org · 5 pts · 277d

Doesn't mean anything. Lines of Code is a stupid metric because it's just an absolute count. Not relative to any implemented functions, not imaging the actual density. Especially stupid because you can easily tweak the count by bloating a function.

xylogx@lemmy.world · 1 pts · 278d

Is that more than the kernel? How much more?

ryannathans@aussie.zone · 1 pts · 278d (1 reply)

You're probabry including ports/ which contains all the software available for the platform

strlcpy@lemmy.sdf.org · 2 pts · 278d

Those are just the packaging makefiles etc though, not the actual software sources (with some notable exceptions for bootstrapping, at least in NetBSD). Still it's comparing a kernel with an OS

steeznson@lemmy.world · 0 pts · 277d

One reason is that the coreutils in Linux use a lot of hacky or hard to read tricks to improve performance. OpenBSD explicitly wanted to make their source code more legible. FWIW I prefer the Linux approach.

Goretantath@lemmy.world · -21 pts · 278d (2 replies)

My best guess is bloat.

strlcpy@lemmy.sdf.org · 28 pts · 278d

No one who ever had anything to do with OpenBSD or NetBSD would venture such a "best guess"

vext01@lemmy.sdf.org · 11 pts · 277d

Ah yes. OpenBSD. Well known for bloat...

Come on.