• theskilledcoder Profile Picture

    Skilled Coder @theskilledcoder

    3 months ago

    Java coding hacks developers should know 🧵 1) Use Map.ofEntries() for creating multi-pair immutable maps Why: Shorter, immutable, safer and avoids accidental mutation.

    theskilledcoder tweet picture

    6 65 761 80K 708
    Download Image
  • theskilledcoder Profile Picture

    Skilled Coder @theskilledcoder

    3 months ago

    2) Use Optional. map().orElse() instead of manual null handling Why: Eliminates null checks, reads better, and chains smoothly with other logic.

    theskilledcoder tweet picture

    6 1 28 2K 11
    Download Image
  • theskilledcoder Profile Picture

    Skilled Coder @theskilledcoder

    3 months ago

    3) Use Enum.valueOf() + name() for safe enum conversion Why: Cleaner, and lets you easily serialize/deserialize enums in APIs, DB, or files.

    theskilledcoder tweet picture

    1 0 15 2K 6
    Download Image
  • jungleeBilla6 Profile Picture

    jungleeBilla6 @jungleeBilla6

    3 months ago

    @theskilledcoder The first seems more readable!

    0 0 3 43 0
  • AkumaCelest Profile Picture

    Akuma 🇰🇲🇾🇹🇯🇴🇫🇷 @AkumaCelest

    3 months ago

    @theskilledcoder This is not the goal of Optional, which is a data wrapper not a control flow operator. When implementing an algorithm it is better to write a null check with a simple if than using an Optional.

    0 0 2 29 0
  • tr_twtr Profile Picture

    TR @tr_twtr

    3 months ago

    @theskilledcoder "Use Optional. map().orElse() instead of manual null handling" Nah, that is actually not recommended. Only use Optional if you receive an Optional.

    0 0 1 13 0
  • thefaketechpod Profile Picture

    thefaketechpod @thefaketechpod

    3 months ago

    @theskilledcoder Not sure you should do this just because it compiles/works. I like your other examples though!

    0 0 0 2 0
  • AlloyLauncher Profile Picture

    Alloy - launcher and automator @AlloyLauncher

    3 months ago

    @theskilledcoder Sorry, it's a bad pattern. You should use it only if you already got an optional User. Otherwise use ? operator as it is cleaner, concise with no overhead. Even if you need chaining - there's a better way by using instanceof with patterns:

    AlloyLauncher tweet picture

    1 0 2 52 1
    Download Image
  • Download Image
    • Privacy
    • Term and Conditions
    • About
    • Contact Us
    • TwStalker is not affiliated with X™. All Rights Reserved. 2024 www.instalker.org

    twitter web viewer x profile viewer bayigram.com instagram takipçi satın al instagram takipçi hilesi twitter takipçi satın al tiktok takipçi satın al tiktok beğeni satın al tiktok izlenme satın al beğeni satın al instagram beğeni satın al youtube abone satın al youtube izlenme satın al sosyalgram takipçi satın al instagram ücretsiz takipçi twitter takipçi satın al tiktok takipçi satın al tiktok beğeni satın al tiktok izlenme satın al beğeni satın al instagram beğeni satın al youtube abone satın al youtube izlenme satın al metin2 metin2 wiki metin2 ep metin2 dragon coins metin2 forum metin2 board popigram instagram takipçi satın al takipçi hilesi twitter takipçi satın al tiktok takipçi satın al tiktok beğeni satın al tiktok izlenme satın al beğeni satın al instagram beğeni satın al youtube abone satın al youtube izlenme satın al buyfans buy instagram followers buy instagram likes buy instagram views buy tiktok followers buy tiktok likes buy tiktok views buy twitter followers buy telegram members Buy Youtube Subscribers Buy Youtube Views Buy Youtube Likes forstalk postegro web postegro x profile viewer