Ad
  • Custom User Avatar

    ternary better only for small,simple functions

  • Custom User Avatar
  • Custom User Avatar

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

  • Custom User Avatar

    In the company I work with, the way our project is set up in REACT is that nested ternary won't pass pipeline build.. Also Prettier will get upset I think.. Although this solution looks clever and damn good as hell, readabiliy is also important.

  • Default User Avatar

    because n is the number of hotdogs youre going to sell... so youre basically demonstrating if you sell more then a discount is applied

  • Default User Avatar

    I don't get why mine didn't work. Why are we multiplying?

  • Custom User Avatar

    Sorry bro, first comment ever T.T, my bad...

  • Custom User Avatar
  • Custom User Avatar

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

  • Custom User Avatar

    CW follows TDD (Test-Driven Development), so the spec is practically defined by the tests. If subpar solutions/cheese solutions passed because tests do not catch them, you should go yell at the kata author to fix the tests (by raising at issue), not at users for submitting such solutions ;-)

  • Custom User Avatar

    this Kata description is more akin to what developers may face in the real world

    Nope, this is far away from a real world mission. Actually all katas of CW, if they are what you say something that developers may face in the real world, are just a tiny subset of real world job.
    A more 'real world' version of this kata may contain

    • Multiple key info from one sentence
    • Configurable suffixes
    • Auto correction, like what search engines do
    • NLP
    • All lowercase input
    • Unicode support
    • OCR

    How many would you like to add to your solution. And what else can you think of a real world challenge may require?

    If we as developers understand what they're trying to achieve

    Nah, we can never ever understand what others trying to achieve, because we are using natural language to communicate. Just look at how many people cannot even ask a decent question on StackOverflow or else.
    What we can do is just guessing what they want actually, and, if we are going to grant their wish, guide them to express themselves more exaclty.

    I'd much rather be working with developers that see the bigger picture and ask questions than those who just blindly follow a specification, knowing it doesn't cover the outcomes that the business or customer want.

    You are right, and you are wrong.
    Real world prolem are much more complex than just a kata
    We'd like to add all fatasic features to our produces.
    We'd like to cover formal proof as much as possible to make our system bug-free.
    But time is limited, resources are limited.
    We are doing workarounds for coner cases one by one
    Not to metion that good/bad code does never directly lead to popular/shit products
    And again, you can never guess what your customers REALLY want.
    Also, if the 'specification' does not cover the outcomes, then how the hell it become a specification? Just a partial of requirement document.
    And isnt it your job to make it cover the outcome as much as possible at the very beginning?

    If you are seeking workmate on CW, then you are coming to a wrong place
    We have Anarchy Golf, Code Golf for playing code golfing
    We have IOCCC for obfuscation
    We have all OJ sites to test if we are good to solve algorithms problems
    We have LeetCode for job preparation
    We have Advent Of Code for speed coding competition
    ......
    Every site get their outstanding part, not just aiming a same goal.
    And CodeWars, WARS! It's a game, between authors and challengers. Solving puzzles! It's fun. What else are you expecting?

    And, after modification, the test still not covering all cases, file another issue if you actually wish to make this kata 'better'.

  • Default User Avatar

    My point is that this Kata description is more akin to what developers may face in the real world, there is a principle and vision that the end user has set out, to extract the data in the way they've described.

    If we as developers understand what they're trying to achieve and are deliberately ignoring that just because they've been unable to articulate it, then that is a failing of us as developers.

    As you point out, there are a lot of variables such as PM interaction and customers that can cause us issues, but ultimately, I'd much rather be working with developers that see the bigger picture and ask questions than those who just blindly follow a specification, knowing it doesn't cover the outcomes that the business or customer want.

  • Default User Avatar

    See Issue entered by FArekkusu and the reply to the resolve the Issue.

  • Default User Avatar

    Additional static tests with names were added.
    The random tests were updated by adding names to both the start and end arrays.

    Both the new static and the new random test values in the arrays have names that can appear at the beginning of the test string, the middle of the test string or at the very end of the test string with a period at the end or no period at the end.

    Thanks for pointing that out.

  • Custom User Avatar

    It looks like everyone wrote some code to resolve the case and then "upgrade" it to pass all the tests.

  • Loading more items...