Hacker News new | ask | show | jobs
by ptx 1803 days ago
> I guess everyone else's reading-file-line-by-line loops in python are the epitome of creativity

I would certainly hope not, since there is barely any code to write:

  for line in my_file: ...
For even more convenience in common cases, there is the fileinput module[1] in the standard library.

I can see how a boilerplate-generating AI could be helpful in a more boilerplate-heavy language like Java, but a better solution is to use a language that better suits your usecase and lets you express it without the boilerplate.

[1] https://docs.python.org/3/library/fileinput.html

1 comments

I'd say using a better language is an easy decision to make when you're in a team of one and not depending on any framework-specific features and somewhat harder when you're in a team of more, depending on some framework-specific features, or both.