What programming practice/operation did you hate at first but come to love? via /r/learnprogramming


What programming practice/operation did you hate at first but come to love?

I used to hate ternary operators. Example:

 isActive ? activeAction() : otherAction(); 

As short form for

if(isActive){ activeAction(); }else{ otherAction(); } 

Started out thinking they were weird and difficult to read (they kinda still are), but the onelineability is just too great to pass up, I use them all the damn time nowadays.

Submitted July 13, 2017 at 11:20AM by k4kuz0
via reddit http://ift.tt/2sUr1s7

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s