4 ms·
> Using plain functions with slightly longer but globally unique names so many issues go away. That makes me assume two things: you work alone and your project
by ka0lin 7y ago
> Using plain functions with slightly longer but globally unique names so many issues go away.
That makes me assume two things: you work alone and your projects don't exceed 5.000 (fivethousand) lines of code. Without some namespacing and an expected method length less than 100, more likely 10 lines than 90 or more, you end up with roughly 160 names. An average human knows 150 people, maybe by their name. And while you have friends or at least parents and grandparents occupying some of the »address sace« few of your methods will not be »at hand« for your brain.
And in case you already prefix your methods with something like io_write(...), db_query(...) and you hand in context-specific references like io_write with a sort of file handle and db_query with a sort of database connection I transform all this 1:1 in an OO-style language and back.
- jstimpfle 7y agoYour assumption is wrong (of course), and yes, I don't doubt that it's always possible to make a rewrite in a shitty way, and then convert it back. For a clearer description of what I mean, see my other comment below where I write two lines of code in both ways.