top | item 40684364

(no title)

huyegn | 1 year ago

Swift for all its niceties still suffers from a habit of inherently tying its conventions to Apple and its "appleisms" when coding. Tasks that should be relatively straightforward to do e.g. iterating through a file line-by-line still requires an awkward amount of code. It's especially noticeable when compared to languages like Go or Python:

https://forums.swift.org/t/text-streaming-in-standard-librar...

While these things are not difficult to solve with some minor additions to the standard library and documentation that emphasizes some basic conventions, the fact that we're on Swift6 and things like this aren't just available speaks to how much further the community needs to evolve to get the language ergonomics right for non apple-y things.

discuss

order

saagarjha|1 year ago

What's wrong with

  for try await line in file.lines

?