SimpleIO in JEP draft 8323335

Pedro Lamarão pedro.lamarao at prodist.com.br
Mon Feb 19 18:00:45 UTC 2024


Em seg., 19 de fev. de 2024 às 14:08, Brian Goetz <brian.goetz at oracle.com>
escreveu:


> One can make a reasonable case for "write a line / read a line" being
> sensible primitives.  They are simple enough: no parsing, no deciding what
> to throw away, no possible errors other than EOF, it is clear what state
> you leave the stream in.  These may not be what the student wants, but they
> are primitives a student can deal with without having to understand parsing
> and error handling and statefulness yet.
>

I feel that, though in appearance the discussion is about words like "read"
or "print" or "input", which convey actions, the core of the issue is what
primitive data format is going to have ready-made composable
parsers/assemblers. To me, as you seem to suggest, "read line" is not about
the read, it is about the line, a concept incredibly simple which hides
enough complexity to turn a line parser into a trap for the unwary. For
similar reasons, I appreciate class Properties' method load, which provides
an extremely quick way to do "property maps" when needed. For these
reasons, I think that the way for beginners is not actually about reads or
writes, but about line streamers.

-- 
Pedro Lamarão
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20240219/9689ef5d/attachment.htm>


More information about the amber-dev mailing list