Hacker News new | ask | show | jobs
by pansa2 2170 days ago
It’s not so much that Python requires boilerplate - all executable code does. For example, the article includes code to read the input data from a file, which is not relevant to the algorithm and could be omitted from a pseudocode version.

Similarly, executable code requires unnecessary detail, like the article’s `Stream` class. In pseudocode this could be replaced by simply saying “get the next N bits”.

1 comments

I don't think we're defining "boilerplate" the same way, then. Reading from a file isn't something that every executable does, so when you add code for it, it's because you want your program to do it. Boilerplate is things that have to be added to every program regardless of whether they communicate anything that differentiates your program: main(), for example, or class in Java when you're not actually trying to define a class that will be instantiated by later code.