Comment

Comment by matthewmacleod

Some interesting and useful syntax here! However...

I’m also partial to this trick for grabbing just the first element of an array.

  family, = socket.peeraddr
This is the sort of code that really turns me off when I'm digging through Ruby. It adds no clarity and actually looks like a typo. What's wrong with this?

  family = socket.peeraddr.first
It's much clearer what's going on.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton