• 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
IvanIvan Avatar
Name:Unknown
Clan:Drang nach Java
Member Since:Dec 2015
Last Seen:Mar 2016
Profiles:
Following:0
Followers:1
Allies:0
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (13)
  • Replies
  • Authored
  • Needs Resolution
  • Custom User Avatar
    • markus.benko
    • commented on "Building blocks" java solution
    • 8 years ago

    It's a typical immutable value object, the fields are effectively final and compared to object instantiation overhead those simple calculations are negligible regarding impact on performance. Indeed, the fields could have been made final and the equals() and hashCode() methods could have been overridden.

    Beware of superfluous POJO usage where objects degrade to simple data containers with fields and getters + setters for all of those. This is not OOP.

  • Custom User Avatar
    • Voile
    • resolved an issue on "Counting Characters" kata
    • 8 years ago

    Not anymore ;-)

  • Custom User Avatar
    • nuzyly
    • commented on "Building blocks" java solution
    • 8 years ago

    Well, the description doesn't ask for setters, that's why I would even suggest to mark the instance variables as final, and thus make the whole class thread-safe. Unless, of course, mutability is a strict requirement.

    If you really care about the very last bit of performance, you could even consider to do the computation once and only once (see my solution).

  • Custom User Avatar
    • Seeven
    • commented on "Building blocks" java solution
    • 9 years ago

    Moreover, if we change one dimension of the Block with a simple setter, the Surface Area and Volume become wrong.

  • Custom User Avatar
    • allenCao
    • commented on "Triple trouble" java solution
    • 9 years ago

    The description says "... also a straight double of the same number in num2.", so ...

  • Custom User Avatar
    • Gerrit-K
    • commented on "Triple trouble" java solution
    • 9 years ago

    Maybe because it's not a valid solution regarding the task? It is not checking whether the double is of the same digits as the triple. Unfortunately there are no hardcoded test cases for this and it's quite rare that it appears in a random test case.

  • Custom User Avatar
    • IvanIvan
    • created an issue for "Counting Characters" kata
    • 9 years ago

    it's not enough tests. And it would be nice to add
    a few examples in description

  • Custom User Avatar
    • IvanIvan
    • commented on "Number of trailing zeros of N!" kata
    • 10 years ago

    Very interesting kata!

  • Custom User Avatar
    • IvanIvan
    • commented on "Triple trouble" java solution
    • 10 years ago

    Why didn't I think of that?

  • Custom User Avatar
    • qiankanglai
    • commented on "Roman Numerals Encoder" java solution
    • 10 years ago

    You're absolutely right :D
    I wrote this just for convenice and it is somehow a bad habbit keeping using string...

  • Custom User Avatar
    • IvanIvan
    • commented on "Roman Numerals Encoder" java solution
    • 10 years ago

    With frequent use concatenation, it would be better to use class StringBuilder.

  • Custom User Avatar
    • IvanIvan
    • commented on "Vowel Count" java solution
    • 10 years ago

    it's really cool!

  • Custom User Avatar
    • IvanIvan
    • commented on "Building blocks" java solution
    • 10 years ago

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

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

Confirm

  • Cancel
  • Confirm

Collect: undefined

Loading collection data...