Refactoring a Command Line Shell | Code Roast Part 1

preview_player
Показать описание
Today I'm refactoring a command line shell! Ready for a new code roast? Watch the video to witness the transformation from average to exceptional code in Part 1 of 2 videos.

🎓 Courses:

👍 If you enjoyed this content, give this video a like. If you want to watch more of my upcoming videos, consider subscribing to my channel!

👀 Code reviewers:
- Yoriz
- Ryan Laursen
- Dale Hagglund

🔖 Chapters:
0:00 Intro
1:12 Review
15:17 Refactoring
25:56 Outro

#arjancodes #softwaredesign #python

DISCLAIMER - The links in this description might be affiliate links. If you purchase a product or service through one of those links, I may receive a small commission. There is no additional charge to you. Thanks for supporting my channel so I can continue to provide you with free content each week!
Рекомендации по теме
Комментарии
Автор

I was worried that the Code Roast series is falling off because recently entries were pretty decent written code, actually. This episode truly bring back the good-old Code Roast, code that is written by someone who is obviously knowledgeable in programming and Python but has very questionable design choices, I love it! Shout out to the code author for the submission so us all can learn from your mistakes.

vuongviethung
Автор

Some people prefer light roast coffee, some people prefer dark roast coffee, but the only roast I like is a CODE ROAST!

MarkusSoruleus
Автор

I have been following the channel since its debut and got significantly better at coding in the meantime.

While it is more and more rare for me to find enriching concepts in the “I explain you something” kind of videos, I still learn a lot from the refactoring ones.

Bottom line is that I would like to see more of these videos!

Hope it helps in your audience targeting 😉

filippopisello
Автор

Great video as always Arjan. I'm looking forward to part two! In this code, it was absolutely right to replace "command" with a tuple but I think there is a case for using dataclasses like this. It can make code much more readable as you don't need to remember what each positional member is and if you want to add more members in the future, you don't end up with lots of tuple[0], tuple[1] code.

dannorris
Автор

I love refactoring as a hobby. You get raw ideas and wild code and make good art out of them. Until someone finds your ideas raw and your code wild.

hugo-onzakorderra
Автор

I was waiting for another code roast. thank you, Arjan. honestly, I don't mind if you make longer videos cuz they bring a lot of value.

horoshuhin
Автор

finally again!!!! the most i learn from are code roasts

yousofthelord
Автор

Could you please make another video about Asyncio with the advanced concepts and also learning videos about cloud design patterns?

soheylaranjbar
Автор

Ack-- I didn't notice this was a two-parter! Looking forward to the dramatic conclusion to this cliffhanger next week. So far, it's deeply satisfying to watch you ripping out huge chunks of code and seeing how much simpler things can be...

rrwoodyt
Автор

What i like about code review is the opportunity to improve and simplify code that (should) already work.
One of my mottos: First make it work, then make it better.
Thanks Arjan; another terrific start to a video.

thisoldproperty
Автор

Damn, the final version is looking really clean. I can't wait to see how you're typing the code into the editor and experience a free time travel 😂

marcotroster
Автор

I wish I had the confidence of deleting something when you don't know what it is, and deleting something for completeness such as @ 11:00 .

alexandarjelenic
Автор

I didnt know it was split into 2 videos 😆 I cant wait until the next video, great work!

natenatters
Автор

I felt like I was at the theater watching an action movie and right at the climax, they stopped the video and turned on the lights and I was pulled back into reality! Ok, maybe I’m exaggerating… looking forward to part 2!

JeremyLangdon
Автор

All I wanna do is watch your code roasts. Moar pls :)

nrm
Автор

@17:40: What is there to strip? More precisely, if you a string split on a space, will any part ever start/end in a space?

jeancerrien
Автор

'BASH'ing other people's code ++ Need more linux converts. ;)

digiryde
Автор

God I love Code Roasts hahah. And I loved the intro! 😂 Also, did you lose some weight by the way man; really fits you!

manomancan
Автор

For the shell component: why not use argparse from the stdlib or even better, typer from the same author of fastapi?

Unless it's a learning opportunity, a lot of the code could be golfed by using libraries that are battle tested and provide better functionality.

MMYSLF
Автор

Regarding the Command type, wouldn't it be better to use an explicit TypeAlias as per PEP 613?

guille.hoardings