Live data from Hacker News

Simple Code, High Performance [video]

youtube.com

21–30 of 86 posts

Re: Simple Code, High Performance [video]

#22

Earlier quoted context omitted.

He measures code 'simplicity' by how much work it makes CPU do, and not some made up metric like 'readability'.

How exactly is readability made up?

Simple example: I love the ternary operator and use it quite a lot in simple "if/then" scenarios. However some people hate them because they consider them harder to read than the fully written out if/then form. Those people would judge my code less readable.

Re: Simple Code, High Performance [video]

#23

Earlier quoted context omitted.

He measures code 'simplicity' by how much work it makes CPU do, and not some made up metric like 'readability'.

How exactly is readability made up?

It is not made up but different people can have different opinions on what's readable and what's not.

If the metric is supposed to be objective, then number of CPU cycles used is probably the simplest metric there is for computers.

Re: Simple Code, High Performance [video]

#24

Earlier quoted context omitted.

He measures code 'simplicity' by how much work it makes CPU do, and not some made up metric like 'readability'.

How exactly is readability made up?

This is a good question to ask, if not rhetorical.

When practicing rigorous measuring, quantities need to be quantifiable aspects of the world. For example, you can quantify how much physical space your code or compiled output takes up in memory, and use these quantities as base units to derive others. By branching from a quantifiable root, you can derive metrics such as lines of code or number of CPU instructions, and they’d still retain those quantifiable aspects. Meaning there’s a clear path to the quantifiable root.

Needless to say, readability, as a metric, is not branched from quantifiable aspects of the world. So in a sense, it is still a “made up” metric because (as of today), there’s no way to trace it down to the quantifiable measurements.

Re: Simple Code, High Performance [video]

#26

Earlier quoted context omitted.

How exactly is readability made up?

This is a good question to ask, if not rhetorical. When practicing rigorous measuring, quantities need to be quantifiable aspects of the world. For example, you can quantify how much physical space your code or compiled output takes up in memory, and use these quantities as base units to derive others. By branching from a quantifiable root, you can derive metrics such as lines of code or number of CPU instructions, a…

I’d note that because something is hard to measure doesn’t make it “made-up” or unimportant. And that concentrating on things that are easy to measure doesn’t make them more important and in fact can bias things badly.

Re: Simple Code, High Performance [video]

#27

Earlier quoted context omitted.

How exactly is readability made up?

It is not made up but different people can have different opinions on what's readable and what's not. If the metric is supposed to be objective, then number of CPU cycles used is probably the simplest metric there is for computers.

Right it’s a communication problem because calling code simple conjures different ideas in people heads. Code that is simple for computers (principle of least work) is not necessarily simple (principle of comprehension?) for humans.

Re: Simple Code, High Performance [video]

#28

Earlier quoted context omitted.

He measures code 'simplicity' by how much work it makes CPU do, and not some made up metric like 'readability'.

How exactly is readability made up?

Code readability is at least extremely subjective, one person's highly readable code is another person's incomprehensible mess.

Re: Simple Code, High Performance [video]

#29

Earlier quoted context omitted.

It is not made up but different people can have different opinions on what's readable and what's not. If the metric is supposed to be objective, then number of CPU cycles used is probably the simplest metric there is for computers.

Right it’s a communication problem because calling code simple conjures different ideas in people heads. Code that is simple for computers (principle of least work) is not necessarily simple (principle of comprehension?) for humans.

There is a high overlap though, it's often harder to understand how highly abstracted code actually works than 'unrolled' verbose code composed from simple operations (which is closer to machine code - thus the 'overlap').

It might be easier to understand the 'intent' of highly abstracted code, but this doesn't mean the code behaves as intended, and IMHO 'readability' is about understanding what the code actually does, not what it is supposed to do.

Post reply on HN