Abstract answers and actual code snippets are both welcome π
For further actions, you may consider blocking this person and/or reporting abuse
Abstract answers and actual code snippets are both welcome π
For further actions, you may consider blocking this person and/or reporting abuse
Nik L. -
shadowy-pycoder -
Vivesh -
dansasser -
Top comments (9)
My favorite lines of code is those which saves me typing and makes my code cleaner. Like:
global log = console.log
Over the time that line grow to a full module, but I think that saved me hundreds of console dots.
I love doing things like that with my output statements! It lets me swap out the implementation or even disable output entirely without modifying every log statement in my code. π
To be honest, that line was later refactored to:
To create a log history to be flushed later, and redirect all console.log() to log(). But lost a little bit of its beauty.
Maybe not the most elegant example, but this line in Cloud Foundry's deprecated v2 API let us implement rolling "no downtime" app deployments on v3 without breaking the legacy stuff.
It basically let have more than a single "web" process for an app at a time, but let v2 continue to only concern itself with the newest.
The beauty of Ruby is that we could mix it in to all of the v2 controllers that needed it!
A wise old wizard I used to work with once said,
It's taken me a few years, but I've finally caught on to that appreciation.
And a wise old wizard I currently work with offers up a bottle of Scotch during our company's annual Hackathon to the dev who creates a PR which deletes the most code while maintaining bug-for-bug compatibility without adding new code. ππ
My favorite line of code is that I will never delete, because is perfect and cannot be replaced.
That sounds great, but I'm not sure I'll ever be good enough to write a line of code that never gets modified before being deleted. Seems like a good goal to strive for!
Sorry for the 'never'...
I mean, a line of code to be "perfect" must:
But my really favorites, "the perfect ones" are those that beyond that, yet saves me the typing of another lines. :D