• Sign Up
    Time to claim your honor
  • Training
  • Practice
    Complete challenging Kata to earn honor and ranks. Re-train to hone technique
  • Freestyle Sparring
    Take turns remixing and refactoring others code through Kumite
  • Community
  • Leaderboards
    Achieve honor and move up the global leaderboards
  • Chat
    Join our Discord server and chat with your fellow code warriors
  • Discussions
    View our Github Discussions board to discuss general Codewars topics
  • About
  • Docs
    Learn about all of the different aspects of Codewars
  • Blog
    Read the latest news from Codewars and the community
  • Log In
  • Sign Up
davejones Avatar
Name:Dave Jones
Clan:Fretless
Member Since:Aug 2016
Last Seen:Oct 2022
Profiles:
Following:5
Followers:7
Allies:5
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (7)
  • Replies
  • Authored
  • Needs Resolution
  • Custom User Avatar
    • pciacka
    • commented on "Rock Paper Scissors!" elixir solution
    • 4 years ago

    As far as I understand how Elixir works, using Map makes the code DRYer, but it doesn't leverage Elixir and BEAM optimization process.
    With @p1_wins_table[p1] Map is accessed during runtime, where def ("scissors"), do:... are optimized during compilation and there's no need to lookup for proper values in the Map on runtime. For the sake of this kata, this may seem irrelevant but may play a significant role in real-world use cases.

    More info: https://medium.com/@amuino/maps-vs-pattern-matching-in-elixir-e69b7bb11b5d

  • Custom User Avatar
    • dsomething
    • commented on "Welcome!" elixir solution
    • 6 years ago

    Thank you for this info.

  • Custom User Avatar
    • Nehonar
    • commented on "Thinkful - Number Drills: Pixelart planning" elixir solution
    • 7 years ago

    If you want, you can do this in one line

  • Custom User Avatar
    • dbodow
    • commented on "Rock Paper Scissors!" elixir solution
    • 7 years ago

    Would be DRYer to use a Map instead of defining 3 helper functions

  • Custom User Avatar
    • davejones
    • commented on "Roman Numerals Decoder" kata
    • 7 years ago

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar
    • SamuelMV
    • commented on "Welcome!" elixir solution
    • 8 years ago

    Beware! You should not convert unknown strings to atoms. Atoms are not garbage collected, so you could end with a memory leak or a security vulnerability

  • Custom User Avatar
    • unclesnottie
    • commented on "Convert string to camel case" elixir solution
    • 8 years ago

    FYI - You can split using a regex rather than doing a replace + split.

  • © 2025 Codewars
  • About
  • API
  • Blog
  • Privacy
  • Terms
  • Code of Conduct
  • Contact

Confirm

  • Cancel
  • Confirm

Collect: undefined

Loading collection data...