[Shell] Help us improve #cz2 Handle invalid commands

Hi everyone! I’m working on enhancing the experience for stage 2 of the Shell challenge.

If you’ve found anything confusing or unclear while tackling this stage, please share your feedback here. I’d love to hear your thoughts and suggestions!

Thanks in advance for helping us improve. :blush:

1 Like

code example shown in Python is incorrect. You cannot have “continue” stmt under “if” condition.

Hi @learning-dev, thanks for the feedback! Could you share a screenshot of the incorrect code example so I can take a closer look?

I’m doing this in ‘C’ , and I’m sure i’m writing the correct thing, and there’s only a difference of a space (’ ') between expected output and result output, and it’s not troubleshooting.

Hi @fraxard, the code in your screenshot looks correct, and there seems to be a disconnect between your code and the test results.

To debug, try deliberately printing something incorrect:

and see if it reflects in the test output. Let me know how it goes!

Hello, I am completing this challenge in C. It’d be great if there was more on what level of error handling you wanted for this level. I know C doesn’t have exception or error handling per se but if it was just simply appending an invalid command string at the end of the users input; that could have been explicitly stated and saved me some time. Thankfully @umar006 commented that this was the case.

2 Likes

@1Dedios Thank you for the suggestion! I’ve incorporated it as part of our ongoing experiment in this PR.

Hi, should this print from standard output or print from stderr ?

Hi there! So maybe I am overestimating my python abilities, I am tackling this challenge from the intermediate understanding of python, but I wish there was a little more direction to complete these steps. At least without having to reveal the solution that is provided. I understand the solution and its implementation once it is revealed, however, I feel like getting there is pretty abstracted from the instructions. Thanks!

Hi @pxp9, you can print to either stdout or stderr. Since it’s an error message, stderr is more appropriate. However, our tester is accommodating in this early stage and accepts both.

Hi @ny5us, thanks for sharing your feedback! I completely understand your perspective and will consult with the team to improve the instructions for this stage.

Please feel free to share any additional feedback on other stages as well. We appreciate your insights!

Hi @andy1li ! I have a question referring to Rust, is it posible to add dependencies for this challenge (or all challenges in general? Or there some that you can and some other you don’t?). I would like to add clap for easy an easier parse of the commands!

Thanks!

Oh nevermind, I got it wrong for this challenge hahaha, command comes in input hahaha. But I still would like to know for future challenges!

Hi @ragranados You can use cargo add as usual, and our tester should detect and apply the changes. Let me know if you run into any issues!

The most confusing parts are configuration and a lot of questions from scratch.

Why codecrafters wants to install to root and asks for my password? (I’m not sure I trust it in that current stage)
Why my run script is named “your_program.sh” instead of just “run.sh” (it’s so toxic and unfriendly behaviour).

And that run log on submit

[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.
[tester::#CZ2] Running ./your_program.sh // OK, you named your version with correct name “run.sh”, so why you do symlink in your_program.sh?

Naming is everything for every business and you’ve just failed.

I assume you’ve focused on expirienced devs wanting to learn new language and skills and wants big money cost for wat?
I’m not sure I wanna pay you after all that behaviour

Hi @rxqd thanks for your thoughtful feedback! It’s incredibly helpful! :handshake:

This isn’t a definitive answer from the team, but just my personal observation:


Why codecrafters wants to install to root and asks for my password? (I’m not sure I trust it in that current stage)

You can inspect the content of the CLI installation script, or use an AI tool to analyze it.

The script contains this step:

sudo -k mv "$TEMP_FOLDER/codecrafters" "$INSTALL_PATH"

It requires your password to move the CLI binary to /usr/local/bin, making it accessible from anywhere in your terminal.

An alternative would be to install the CLI in a non-root directory, but that would require users to manually update their PATH.


Why my run script is named “your_program.sh” instead of just “run.sh” (it’s so toxic and unfriendly behaviour).

your_program.sh represents the software you’re building in a challenge. For example, in the Redis challenge, it’s a placeholder for your_redis.

Naming it run.sh can be technically incorrect, for languages that require compilation, since it would need to both compile and run your program.

If you check the .codecrafters folder in your repo, you’ll find two scripts:

  • compile.sh
  • run.sh

your_program.sh is designed to encapsulate both.


Naming is everything for every business and you’ve just failed.

We’re always open to alternative suggestions! :handshake:


I assume you’ve focused on expirienced devs wanting to learn new language and skills and wants big money cost for wat?

We strive to make CodeCrafters accessible to a wide range of developers, including beginners. If it feels otherwise, that’s something we’d love to improve.


I’m not sure I wanna pay you after all that behaviour

Hopefully, we can continue improving the platform to better meet your expectations in the future. Thanks again for your feedback!

Hi Andy

I’m only dipping my toes in and honestly very impressed. I particularly like the git workflow.

In terms of this particular exercise, I found the syntax of the instructions a little elliptical. Perhaps it might be more clear especially for those with less experience if you were to write something of lines of “Now extend your code to handle…” It’s a small change but it makes it a little more readable. (I cannot recall the original wording as it is no longer visible.)

You’re blending set up instructions with the exercises themselves which is a nice approach because set up is boring and many people like to dive in to the fun bit right away. Nonetheless it is a little confusing at times especially given that the page changes dynamically depending on where you are in the exercise.

I completed an exercise then suddenly found a suggestion to install codecrafters cli appearing. It felt a little incongruous.

I felt uncomfortable with the advice to pipe a remote script through the shell and don’t think this is something you should be recommending people do, especially given that it asks for root access.

These are minor points. Feel free to ignore them as they may be a question of taste.

1 Like

Hi Andy,

I don’t know if you saw my post from earlier, but I am having issues with my code executing after the tester has given me a fail. I have attached a screenshot and you can find my git here. Please let me know if you find a solution!

Changed the text a bit and changed it back and decided to work? I don’t really understand, but I can move on now!

Hi @twoangrybears, thanks for taking the time to share your feedback. We really appreciate it!

I’ll share them with the team, and we’ll be discussing ways to improve your experience.