Recent Representative Line

You Can Only Get What You Have

by Remy Porter
in Representative Line
on 2018-08-22

Sean's ongoing career as a consultant keeps supplying him with amazing code.

Let's talk about encapsulation. We put getters and setters around our objects internalsto help keep our code modular. Given an object, we call something like getUsername to extract a piece of that object safely.

Tern This Statement Around and Go Home

by Remy Porter
in Representative Line
on 2018-08-16

When looking for representative lines, ternaries are almost easy mode. While there’s nothing wrong with a good ternary expression, they have a bad reputation because they can quickly drift out towards “utterly unreadable”.

Or, sometimes, they can drift towards “incredibly stupid”. This anonymous submission is a pretty brazen example of the latter: