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.

all 10 comments

sorted by: hot top controversial new old
[–] [B] 28 points 11 months ago

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.

  • source
  • [–] 10 points 11 months ago

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

  • source
  • [–] 1 point 11 months ago (1 child)

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

  • source
  • hideshow 1 child comment
  • [–] 2 points 11 months ago

    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

  • source
  • parent
  • [–] 1 point 11 months ago

    Is that more than the kernel? How much more?

  • source
  • [–] 0 points 11 months ago

    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.

  • source
  • [–] 0 points 11 months ago*

    This is why I typically refer to it as GNU+Linux and not just Linux. Two different and incompatible operating systems can use the same kernel just look at Android and GNU+Linux. Each of the BSDs is a complete operating system (userland + kernel).

  • source
  • [+] -20 points 11 months ago (2 children)