Comment

Comment by meowface

The problem with "stream/generator as default" is the boilerplate you constantly have to add.

In Python 3, for example, map() returns a generator. So you can no longer transform a list into another list with `new = map(func, lst)`. You have to do `new = list(map(func, lst))`. One of the most subtle gotchas when upgrading from 2 to 3 is having to wrap list() around functions and methods like map(), range(), dict.items(), etc.

Discussion I've seen about Rust on less moderated websites often seems to make fun of the .unwrap() spam seen in a lot of programs, to the point of the mockery even dominating some discussions.

Streams and lazy evaluation are really nice, but sometimes you just want some nice procedural handling.

parent meowface 11 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton