Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> And why go so extreme? A main() calling into 3 functions like load, process and save will be still plenty better than a single blob of IO mixed with computation and would still contain no boilerplate.

Sure. But a main() ordered into loading, processing, and saving would be similar amounts of better, despite not using the abstraction of functions.



Code style / formatting is a secondary thing. If someone made the effort of splitting it into well organized 3 pieces, and denoted those pieces somehow (by comments?), that also counts as an abstraction to me, even though it is not my preferred code style.


If you consider organization in general to be abstraction, then I think that might cause some overselling of abstraction and miscommunication with others.

Unless I'm the one using words weirdly here.


It is not just reordering the lines of code.

In order to organize code that way, you need to establish e.g. some data structures to represent input and output that are generic enough that they don't depend on the actual input/output formatting. There you have the abstraction.

The key thing is to be able to understand the processing code without the need to constantly think the data came from CSV delimited by semicolons. ;)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: