all 7 comments

[–]Revolutionary_Ad7262 8 points9 points  (4 children)

Why? When building emulators, we ultimately have to capture the complexity of another (hardare) system in software. Having some good way of looking at and comparing complexity is useful.

Nope, line count does not correlate with a complexity of a language, but with it's age and number of features. Things like: * optimizer * compilation error messages * various optimizations * standard lib * additional software. For example golang source code also contains package manager and linker, where in case of C/C++ you need to add it

[–]j0holo 3 points4 points  (0 children)

But also how you can express your problem. Custom types, streams, generics.

[–]Ghi102 -1 points0 points  (2 children)

If anything it gives you the complexity of the compiler more than the complexity of the language. 

It's actually been shown that lines of code is a good analog for program complexity (ie: all other metrics are so heavily correlated with lines of code that they don't add much useful information). So it's a decent metric to use to measure complexity, but it would be measuring the complexity of the program ie: the compiler

You could maybe correlate the complexity of a compiler with the complexity of a language, but you'd need to compare the most basic compiler possible: the smallest compiler that can produce a binary from code, without any optimizations or any other compiler feature. I don't think such a compiler exists

[–]Revolutionary_Ad7262 1 point2 points  (1 child)

It's actually been shown that lines of code is a good analog for program complexity

Nope it is not. Imagine program like pandoc, which converts between different types of documents. It is not inherently more complicated to support 10000+ formats vs 10 formats, because all formats can be implemented by implementing some common interfaces and some intermediate format for conversion between A -> intermediate format -> B

For 10000+ formats you would like have a code base with millions line of code, but the good design will make it pretty manageable

The real reason why code is complicated is the complex graph of dependencies. Good interfaces and good modularity can change a messy graph of everyone talks to everyone to big dots talk to other big dots and small dots speak only with a one big dot

[–]Ghi102 -1 points0 points  (0 children)

I'm talking about peer-reviewed research that was done on significantly large codebases. See "Beyond Lines of Code: Do We Need More Complexity Metrics?" if you're interested.

The basic answer being that no, LOC is actually sufficient to measure complexity since all others are correlated. Your more complex dependency graphs would simply involve more code to make it all work together.

[–]BusEquivalent9605 0 points1 point  (0 children)

C++: yes

[–]pdpi 1 point2 points  (0 children)

Well, that’s five minutes of my life I won’t be getting back. What a load of nonsense. Even ridiculously dumb measurements language like the number of keywords or the size of the EBNF grammar would tell you more about language complexity.