Lazy instantiation one-liner with the coalesce operator(realfiction.net)

submitted by fquednaufquednau(404) 4 years ago

The one-liner for lazy instantiation of instance fields using the coalesce-operator

2 comments |category: |Views: 344

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by photozphotoz(80) 4 years ago 0

simple but helpful. less typing always wins

Reply

posted by johndoe2008johndoe2008(190) 4 years ago 0

Yes, it's faster to type, but when you come back to the code 6 months later it looks confusing. I'd rather see the longer version as it's more maintainable.

Reply

information Login or create an account to comment on this story