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

No, because that still assumes files are the general usage.

In my experience, they're not. It's strings.



And where do you get these input strings? Big enough that .split() is not sufficient? Files, and yes sockets support the interface as well with a method call.


> And where do you get these input strings?

From database fields, API calls, JSON values, HTML tag content, function inputs generally, you know -- the normal places.

In my experience, most people aren't dealing directly with files (or streams) most of the time.


Your examples ultimately come from files or sockets, as I mentioned. Especially if big enough to use splitlines on them.

I also used the word generally, so your insistence on quantifying the proportion is a complete waste of time.


What a nonsensical thing to say. You said to call "for line in file" -- you can't do that on a string, even if it originally came from part of a file. Or are you suggesting one should...?

And I said your "generally" was wrong. You were provided general advice, I'm saying it's wrong in general. Do you see me giving numerical quantities anywhere?


They might be programmatically generated, for example.

There are countless sources one can get a string from. Surely you don't think filesystems are the only source of strings?


Input is very rarely auto-generated, though output is.

Surely you haven't misread my comments above to such an extent? Perhaps not familiar with sockets.


No, I didn't misread, input can be self-generated of course. If you're writing a system that's designed like UserInput -> [BlackBox] -> Output, clearly user input won't be auto-generated. But if you factor [BlackBox] into a system like A -> B -> C, A -> D -> C, C -> Output, then each of those arrows will represent an input into the next system that was generated by something our devs wrote. This could be bunch of jsonlines (related to this thread) interpreted as string, a database, some in-memory structure, whatever.




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

Search: