No video

This cli component was trickier to build than I thought

  Рет қаралды 81,918

Dreams of Code

Dreams of Code

Күн бұрын

To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/... . You’ll also get 20% off an annual premium subscription.
This was much more of a challenge than I initially thought.
Normally, I would reach for a third party dependency when building a terminal UI component. However, this time I decided to write it from scratch, and whilst I learnt an awful lot, it was definitely harder than I expected.
Github Project: github.com/dre...
Become a better developer in 4 minutes: bit.ly/45C7a29 👈
Join this channel to get access to perks:
/ @dreamsofcode
Join Discord: / discord
Join Twitter: / dreamsofcode_io

Пікірлер: 196
@dreamsofcode
@dreamsofcode Ай бұрын
To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/DreamsofCode . You’ll also get 20% off an annual premium subscription.
@luengelke
@luengelke Ай бұрын
Nice walkthrough of TDD in Go! To be nitpicky: your frameRate should correctly be called frameDuration. "Rate" implies a number of frames per unit time, so the inverse of your value.
@dreamsofcode
@dreamsofcode Ай бұрын
Thank you! It's a good nitpick, and I def agree with it.
@YarPirates-vy7iv
@YarPirates-vy7iv Ай бұрын
Yes you have to pick the nits or they'll grow up into adult lice.
@CielMC
@CielMC Ай бұрын
> Im gonna use TDD - Test passes - Had to run the app anyway to find problems I feel like this the main problem with TDD, you can’t anticipate problems you don’t know, so you necessarily has to break it manually first, at which point I don’t see how this is different from just writing tests and writing regression tests. TDD feels like fighting yourself, “do the minimum to make the test pass” okay, just print a backspace in the stop function. But you know damn well that’s not what you want to do, why not just do it the right way to begin with? And in addition to that, the test themselves have no guarantee of being right, as you have shown in your video, what now, write regression tests for the tests? Tests are just code and code will fail. This is what I don’t get about TDD, it seems to add so much unnecessary overhead and fluff. I support writing tests for every functionality, even during the development process and not just after it, but I feel like TDD is just not it.
@filipenicoli_
@filipenicoli_ Ай бұрын
I don't do TDD but perhaps it's a matter of scope. Maybe you don't need TDD for every single testable unit of code but for larger concepts like entire classes or even end-to-end behaviour.
@VictorMartinez-zf6dt
@VictorMartinez-zf6dt Ай бұрын
TDD is not about anticipating problems, it's about driving the design through tests which are like micro use case scenarios of the code in question. And you're right, tests do not guarantee that it'll be right, but that's not possible anyway, "Program testing can be used to show the presence of bugs, but never to show their absence!" - Edsger W. Dijkstra. The TDD approach is about the design, getting a design that is testable in a single unit and easy to reason about.
@mergenstudios8779
@mergenstudios8779 27 күн бұрын
totally agree with you Ciel, tjought the same while watchibg the video...
@mementomori8856
@mementomori8856 Ай бұрын
I love that you added how you came up with a solution and also the ones that didn't work and why they didn't instead of jumping to writing the working solution!
@henrylogan4384
@henrylogan4384 Ай бұрын
agreed
@chadyways8750
@chadyways8750 Ай бұрын
i feel like this video was made just to show off the keyboard with the amount of shots the keyboard was in
@dreamsofcode
@dreamsofcode Ай бұрын
This video was certainly a little different! I've been getting inspired from some other creators in different niches and wanted to try some more story telling this time. Mostly, software development is typing on a keyboard though 🤣. I thought the third party package was a good shot though.
@litfill54
@litfill54 Ай бұрын
@@dreamsofcode the package shot was so good
@turolretar
@turolretar Ай бұрын
@@litfill54 🤨
@Hellbending
@Hellbending Ай бұрын
Watching this the day after getting my ZSA Voyager 😂😂
@sweetbabyalaska
@sweetbabyalaska Ай бұрын
I learned Go entirely self-taught from reading source code on Github and I've picked up pretty much all of these conventions and patterns, but I was unable to put a name to any of it. This video helped all of that finally click.
@dreamsofcode
@dreamsofcode Ай бұрын
That's awesome to hear! I'm glad it was helpful.
@typecraft_dev
@typecraft_dev Ай бұрын
I thought TDD stood for "try driving drunk" and I thought, why would anyone do that? now I know, its way better
@goporororo7404
@goporororo7404 Ай бұрын
So after the video you know driving drunk is even better. Ehat a god vid
@Serizon_
@Serizon_ Ай бұрын
you make nice videos mate
@shapelessed
@shapelessed Ай бұрын
It depends on the project. Many projects simply aren't playing nicely with TDD.
@jamad-y7m
@jamad-y7m Ай бұрын
TDD is more like TDB. try driving blind
@shapelessed
@shapelessed Ай бұрын
@@jamad-y7m It's a good idea to assume what you want your API to look like, but often you realise half-way that some things can be made safer/faster if the API was slightly different.
@the_primal_instinct
@the_primal_instinct Ай бұрын
Wish there were more detailed videos like this one. Usually development project videos describe the process the author went through in very broad strokes. On the other hand, development streams being unedited makes it very inconvenient to watch them. The format you're going with is the perfect one.
@Moorteen
@Moorteen Ай бұрын
@dreamsofcode You need to introduce us to your Moonlander. I wanna know everything. Your cables (Kingscables?). You modifications. Your platforms. Spill the beans! :D
@dreamsofcode
@dreamsofcode Ай бұрын
Deal! I'll add a video to my backlog!
@Redyf
@Redyf Ай бұрын
"Wake up babe, new dreamsofcode vid just dropped!"
@a_maxed_out_handle_of_30_chars
@a_maxed_out_handle_of_30_chars Ай бұрын
I had always wondered about the loading animation and now I've a good idea about it's working. Will try to implement it at some point. Thank you :)
@socks5proxy
@socks5proxy 3 күн бұрын
absolutely love the way you describe how you're using tools like when you specficially said telescope. It's very helpful.
@MACAYCZ
@MACAYCZ Ай бұрын
I feel like it doesn't make any sense to run the spinning wheel in parallel because it doesn't give you any information about state of the main thread. The spinning wheel should have been incremented after every operation in the main thread so user can see if the main thread is still doing something.
@alexp6013
@alexp6013 27 күн бұрын
I thought it was going to have a channel with input updates so that the main thread could schedule frames every so often. Maybe an int so that the spinner knows how many frames it needs ?
@Tresla
@Tresla Ай бұрын
You could also return a "done" channel from "Start()", which would be closed in a defer inside the work goroutine. That way, you can still use context, but you can wait on the returned "done" channel for work to be completed, after cancellation, before continuing. I much prefer this way, as it doesn't require any state, and can be implemented in just a regular function. No need to have it be a method on a struct. It's also easier to avoid race conditions (because of the lack of state). func DoWork(ctx context.Context) (done
@Tresla
@Tresla Ай бұрын
Also, when you want something to be repeated on a schedule, like every 50ms, you should use time.Ticker instead of time.Sleep. If your work takes any reasonable amount of time, with time.Sleep you'll slowly drift away from the "every 50ms". You can also use time.Ticker's channel inside a "select" statement, with your context cancellation. So, you don't have to wait for the time.Sleep to finish before your context cancellation is received and acted upon. EDIT: I hadn't made it to the end of the video before I made this comment. My mistake!
@threee1298
@threee1298 Ай бұрын
I love this format, being along for the ride and trying to guess what’s coming next is so fun
@ustav_o
@ustav_o Ай бұрын
really nice well explained and edited video. will be surely applying that pattern in my next go project
@synnveolsdatter-bh9qc
@synnveolsdatter-bh9qc Ай бұрын
The longer I watch the more I want your vimrc 😅Nice video! My dad keeps recommending Go to me and it looks fun so I might give it a try, the pacing and really everything about it make it really nice to watch as well!
@spr3ez
@spr3ez Ай бұрын
Great video as always, but finishing the spinner and then using git to store the code instead of actually using the vcs and committing in the red, green, refactor process would have been a better way of utilizing git
@dreamsofcode
@dreamsofcode Ай бұрын
You are 100% correct. Git ended up being an afterthought as I was building it out. Def one of my bigger weaknesses.
@MCLooyverse
@MCLooyverse Ай бұрын
​@@dreamsofcode Same here. I often find myself bringing git in as an afterthought, when I should be noticing "This is a new Project, therefore I need git".
@elzabethtatcher9570
@elzabethtatcher9570 Ай бұрын
With the amount of money Brilliant has spent to shout at me from yt videos, I feel at some point I will be obligated to try them.
@rafaeltab
@rafaeltab Ай бұрын
Seeing all the mistakes, and the iterative approach to TDD really helps. When I do TDD I write all tests first, then write all implementation, but writing a test first, then writing a piece of the implementation might actually work better. Ill give it a try!
@kernel0verflow919
@kernel0verflow919 Ай бұрын
Nice video to see some real world examples for go programming. Thanks Elliott! Also, I really like your dotfiles and nix config :), I hope you will do a Video on that topic soon, I had some major mental breakdowns settings up nixOS ^^
@dreamsofcode
@dreamsofcode Ай бұрын
Thank you! Definitely coming soon! Hopefully I can make it easy to comprehend because it can be a lot!
@LimitedWard
@LimitedWard 10 күн бұрын
One way to avoid having to handle so much edge case logic is to implement 2 types: Spinner and StartedSpinner. Spinner only implements Start() and returns a StartedSpinner. StartedSpinner only implements Stop() and returns a Spinner. By implementing this way, you eliminate the edge cases entirely, since the consumer is physically incapable of creating invalid code.
@dreamsofcode
@dreamsofcode 9 күн бұрын
I like this idea! I may give it a go on another video!
@CielMC
@CielMC Ай бұрын
The package with the keep upright sign exactly up side down is my kind of humor
@approxahmed
@approxahmed Ай бұрын
the timing of this getting uploaded while i had your CLI stream playing on the background haha
@dreamsofcode
@dreamsofcode Ай бұрын
🤣
@atiedebee1020
@atiedebee1020 Ай бұрын
This is like fizzbuzz enterprise, except the irony is gone.
@comfysage
@comfysage Ай бұрын
0:42 wow that wallpaper is absolutely amazing, where would i be able to find it?
@dreamsofcode
@dreamsofcode Ай бұрын
I get all my backgrounds from freepik! I'll add a link to it when I'm at my desk :)
@Gandalf_Le_Dev
@Gandalf_Le_Dev Ай бұрын
@@dreamsofcode Up, I really like the wallpaper too :D
@ScriptCoded
@ScriptCoded Ай бұрын
Great walkthrough, if not one of the best on how writing test driven code works!
@JohnoScott
@JohnoScott Ай бұрын
Oh I love that you opened with a shot of your gear on your desk !
@orterves
@orterves Ай бұрын
I think the most important part of TDD and writing just enough code to get the test to pass, is to make sure the test is sophisticated enough to ensure the added code isn't just trivial or hacky.
@StraightCrossing
@StraightCrossing Ай бұрын
Very nice but I have a few small critiques with how you used some of the go primitives. Typically the context is passed in at a higher level outside of the component or you return a cancelFunc when running start/init. This moves all the power to the caller which is a good thing when concurreny is involved. Same idea goes for the stop function. You typically shouldn’t use the ctx cancel function here because you have all the struct data and can clean it up / stop it yourself. Just use a doneCh and then you don’t even need to bother with mutexes. Overall stuff like this is an excellent way to play around with the concurrency primitives. But sometimes it’s simpler to use one of them instead of all of them.
@1ups_15
@1ups_15 Ай бұрын
With the way you've implemented your spinner, what happens if you write to the stdout while the spinner is spinning? Won't it disappear and replace the last caracter that was output?
@Windeycastle
@Windeycastle Ай бұрын
I feel like there are too many subjects in this video: how to make a spinner (and why some things don't work), how to do tests, and how to do all the details in Go. I was interested in the spinner-aspect, but was completely overwhelmed by the Go-stuff (don't know the language). The test-concepts you touched on were also interesting, and could deserve a more higher-level video. In the end, I don't know what I saw you all do. You shared a story about how you struggled and succeeded coding something, but I don't really know what were the exact problems were with the spinning aspect, and how you solved it. I would love 2 more videos about the spinner and the test, where you go talk more abstractly about those subjects (no/minimal programming-language used), because I'm really interested in both!
@dreamsofcode
@dreamsofcode Ай бұрын
Hey! Thanks for the feedback. This video very much was more of a story rather than trying to teach anything concrete. I'm always playing with different ideas for videos and this was one I wanted to try. I'll definitely do some more dedicated videos on each of the subjects though as I think that's also valuable.
@Windeycastle
@Windeycastle Ай бұрын
@@dreamsofcode As a story video it was definitly a good one. I can't really pinpoint why I expected something different though.
@EinhornEnzoYT
@EinhornEnzoYT Ай бұрын
Nice video as always ! I worked with Go daily at my job for 2+ years and I personally wouldn't use a Context in such a case. Contexts are nice when you need to propagate state and cancellation events through a chain (or a tree) of related function calls. If you only need the cancellation part, just use a channel (that's what Contexts use under the hood anyways). The same advice applies if the thing you're trying to achieve has a small, well defined perimeter (like a single struct in your case). You could also get so your spinner to stop properly with a single channel, I wrote a simple example for those interested: package main import ( "time" ) type foo struct { stopCh chan struct{} } func (f foo) start() { tick := time.NewTicker(time.Second) go func() { for { select { case
@semmu93
@semmu93 Ай бұрын
amazing video, but the fact that you only made a single git commit at the end made me shiver :D i prefer small commits, even if they are work-in-progress - gives me peace knowing i can always revert back and branch out and etc. safely, and no work is lost
@barterjke
@barterjke Ай бұрын
I understand it meant to be an educational video about TDD and how to approach to coding projects, but it's a lot of code for such simple task. It's basically few lines of code in any verbose scripting language.
@4zv4l38
@4zv4l38 Ай бұрын
@@barterjke even in C it would be few lines of code
@LeonMarzahn-t6n
@LeonMarzahn-t6n Ай бұрын
The amount of lines actually has nothing to do with TDD, he is just writing code in a reusable, maintainable way
@jamesm4957
@jamesm4957 Ай бұрын
this is a cool introduction to golang's concurrency pattern
@bryceschultz7215
@bryceschultz7215 Ай бұрын
Great video, I know nothing about Go but I would definitely recommend moving the git step to the start!
@weekendforever
@weekendforever Ай бұрын
Thanks for taking us on that journey. going back to paper is shown seldomly and jet so effective. When you ended with "now I did git init" I was a little surprised. Every time you hit "green" and after each "refactor" my brain did a "git commit -am '!sqash init'" Maybe I'm just too bad at rolling back my changes manually or maybe there is something I'm not seeing. Could you explain why you did the init at the end and not at the start? (esp. no commit after each step)? thanks again =) edit: Already answered in another comment: Git was added as an afterthought.
@dreamsofcode
@dreamsofcode Ай бұрын
Thanks! I agree, git should have been there from the beginning, but having worked on the original approach and trying again with TDD + turning it into a video, I definitely forgot to do so. More practice with TDD needed on my end!
@juanmacias5922
@juanmacias5922 Ай бұрын
Thanks for the look into a cool project, and a great intro into TDD :D
@AlexanderYaremchuk
@AlexanderYaremchuk Ай бұрын
Thank you, I followed you along, it was a big fun for a Go-newbie. couple of moments: 1) it didn't work for me on FrameRate 20 - it was too unstable. It wrote at about 30ms rate. 2024/07/03 18:55:52 Before Start 18:55:52.834 2024/07/03 18:55:52 Writing frame: - at 18:55:52.835 2024/07/03 18:55:52 Writing frame: \ at 18:55:52.865 2024/07/03 18:55:52 Writing frame: | at 18:55:52.897 2024/07/03 18:55:52 Writing frame: / at 18:55:52.928 2024/07/03 18:55:52 After Stop 18:55:52.943 tests are ok on FrameRate 200 for me. 2) once you use s.Stop() just before defining it, which is a bit confusing, but ok
@AlexanderYaremchuk
@AlexanderYaremchuk Ай бұрын
Another thing is - if i comment out log outputs in the main.go then there is a symbol \ left from the spinner after main is finished. (it is ok with additional log outputs) ❯ go run ./spinner/example/main.go \
@Mintukumar-qz9qo
@Mintukumar-qz9qo Ай бұрын
I need to know your whole OS Setup
@julioau
@julioau Ай бұрын
Looks like he's using Hyprland as the window manager... Would also love a video like that
@wafinashwan8242
@wafinashwan8242 Ай бұрын
He has another channel called dreamsofautonomy
@sinakarimi2619
@sinakarimi2619 Ай бұрын
Would be nice to see a video on configuring NeoVIM for java
@tuna5618
@tuna5618 Ай бұрын
Seeing you and primeagen flaunt their ergonomic keyboards is temping me to check one out (although mechanical keyboards are a little bit overrated imo), so what keyboard is that?
@dreamsofcode
@dreamsofcode Ай бұрын
It's the ZSA moonlander! I've tried a few and this one is probably my favorite. I'll make sure to do a video on it soon
@natescode
@natescode Ай бұрын
Moonlander is great! Extremely easy to program custom key maps too.
@skyhappy
@skyhappy Ай бұрын
Get the iris instead. The moonlander thumb cluster is too big and unwieldy. Ben vallack says this in a vid he made
@selvammatthys
@selvammatthys Ай бұрын
Ok, I'm a total noob and didn't understand why you used such complex (for me) ways to accomplish a spinning cursor that can be stopped. So I started writing this my way with as little code as possible just to make the visual spinning the same as yours. Then I adopted the concepts that I, more or less understood and made the spinner struct, constructor, and composite option. Because I didn't know anything about the context package I didn't want to use it. So I made a label to get out of my ticker.C loop. Now I had it almost working. I had spinner start, spinner stop that both worked and looked visually the same. But for a reason that is still not clear to me, when I used: case
@benalbone8956
@benalbone8956 Ай бұрын
This might be the first time I've ever left a comment on a video having only watched 15 seconds of it but... This is one SICK Moonlander setup. Makes mine look like a scrub made it...
@CollinWilliams-by5cs
@CollinWilliams-by5cs Ай бұрын
I have to admit, I've never written a spec of go, but I still learned a lot from this video! Keep it up, @DreamsOfCode
@benchilcott6908
@benchilcott6908 Ай бұрын
This is a really good demonstration of TDD, although my one complaint would be that the first test should have been written once you’d come up with the design but before implementing anything, even if you were calling not yet defined functions.
@adamszalkowski8226
@adamszalkowski8226 Ай бұрын
Nice vid! Wonder if there's a way of mocking the ticker in order to not have to sleep in the test.
@dreamsofcode
@dreamsofcode Ай бұрын
Thank you! And I believe so. Not possible with the time.After func but def possible with the ticker
@auraSinhue
@auraSinhue Ай бұрын
Nice work. Showing the final spinner a few more seconds would be appreciated, though.
@martinmora5730
@martinmora5730 Ай бұрын
Great video!, it would be cool a video about programming books/resources recommendations
@leanghok120
@leanghok120 Ай бұрын
Love the new filming style!
@dreamsofcode
@dreamsofcode Ай бұрын
Thank you!
@Gustafonair
@Gustafonair Ай бұрын
This was a blast to follow
@noisetide
@noisetide Ай бұрын
What is that keyboard you are using? 0:20
@thecompanioncube4211
@thecompanioncube4211 Ай бұрын
I had once tried to do so in python at the start of my career to have a visual indication of process running. My god the multithreaded implementation it required had my head spinning like the progress bar. I quickly discovered tqdm and stopped pursuing implementing what's already out there
@qbojj
@qbojj Ай бұрын
If there are multiple threads in the application than the Start funcion is racy with itself. The spinner can be started twice at the same time, e.g when both execution contexts (threads) check isRunning and loose the processor right beforr the s.lock.lock(). After that, the code inside (and after) the lock, which includes starting and configuring the Spinner, is executed twice. To fix it You can just add a check isRunning -> return when you already have the lock acquired. Edit: commas PS: I am not familiar with the golang execution model (can there even be multiple threads?) so this comment only applies if multiple execution context can call (or rather execute) the same function on the same object at the same time.
@dreamsofcode
@dreamsofcode Ай бұрын
You are correct, there would probably be a race condition in that case!
@SoreBrain
@SoreBrain Ай бұрын
Loved the video and the showcase
@devkit_
@devkit_ Ай бұрын
your keyboard looks cool! which model is it?
@guitaripod
@guitaripod Ай бұрын
liking this video format a lot
@MystikNinja21
@MystikNinja21 Ай бұрын
"ctx" being used for "context" is such a hard thing for me to internalize as my work has burned ctx to mean Citrix and I hate it
@ja31ya
@ja31ya Ай бұрын
I feel like this is an example of why tests are not as important as actually making sure your code runs as expected, as you're writing it -- even though your tests passed, there was still a serious bug in your example implementation. The tests could have been added when they were necessary; instead, you arguably spent more time fiddling with tests, rather than iterating rapidly on a solution to the bugs that would've appeared, simply using your example implementation. I'm in favor of the approach: get it working as expected, refactor (or rewrite), write tests, fix any edge-cases, write final tests.
@dreamsofcode
@dreamsofcode Ай бұрын
I have to disagree. TDD made the implementation a lot more simple, focusing on what I wanted the code to do and validating that it was doing so. TDD is very much a way to write code in the most simple way possible, and by focusing on tests from the start, you make it easier to incorporate them than "fiddling" at the end.
@Miles-co5xm
@Miles-co5xm Ай бұрын
This looks okay until one change causes regression in another edge case
@VictorMartinez-zf6dt
@VictorMartinez-zf6dt Ай бұрын
For the configuration I would've used Functional Options pattern instead of having a config type.
@dreamsofcode
@dreamsofcode Ай бұрын
I really like the Options pattern! I'm going to be doing a video on it soon 😁
@Salloom99
@Salloom99 Ай бұрын
You explained TDD better than my professor at college ❤
@crancpiti
@crancpiti Ай бұрын
Great video on TDD. I feel the "context" approach is a bit complicated for this kind of project. Btw what kind of cable are you using to connect your moonlander? - looks nice and practical
@nicolas_gama
@nicolas_gama Ай бұрын
What's the model of your keyboard ?
@CielMC
@CielMC Ай бұрын
That’s a ZSA moonlander, I have one myself, and he has a video on it and similar keyboards
@prashlovessamosa
@prashlovessamosa Ай бұрын
Wow the presentation is soo good
@minecraftermad
@minecraftermad Ай бұрын
oh you mean a "throbber" ? that's what it's called. gl with this info.
@brandontv8289
@brandontv8289 Күн бұрын
Which window manager are you using?
@begga9682
@begga9682 Ай бұрын
What about the Start->Stop->Stop edge case
@MyroslavSuprun
@MyroslavSuprun Ай бұрын
Very interesting. Thank you.
@RuslanGonzalez
@RuslanGonzalez 24 күн бұрын
Client: I want a nice spinner to show feedback when something is loading 🤔. PM: Easy peasy, you’ll have it by this afternoon 😎. Developer: Absolutely, no problem 😏.Two weeks later...Developer: Here's the loading spinner 🥺Client: But… it crashes on loading for edge cases 😟. PM: Wait, what? 😳 Developer: Yeah… and it only works on certain terminals 🤕. Client: This is not what I asked for 😤. PM: We’ll fix it, no worries 😬.Developer: Thinking "Okay, let’s refactor. Time to implement TDD, use coroutines, manage contexts, and handle asynchronous implementation..."Several weeks of complex development later...Developer: Alright, I think I’ve handled all the edge cases. Here’s the spinner 😓.Client: Great! So it shows loading feedback on all terminals now? 😊. Developer: Yes, and it also handles various edge cases, different environments, and integrates smoothly with the entire system 😤.PM: Fantastic, well done team! 🎉Client: Perfect, now could we add a color change when it loads successfully? 🌈Developer and PM: 😳😵Spinner: still spinning in the CLI "I tried my best 😢🌀."
@Nahoc
@Nahoc Ай бұрын
what keyboard is that?
@Siger5019
@Siger5019 29 күн бұрын
Best anti-TDD video I've seen so far
@liamlouw4643
@liamlouw4643 Ай бұрын
What keyboard are you using?
@Rikaisan
@Rikaisan Ай бұрын
the fact that the commit came after the app was done... Do we all do that?
@moofymoo
@moofymoo Ай бұрын
I already hear my ex-colleague screaming and calling meeting because this is not how you are supposed to do TTD. You need to follow enterprise patterns as laid out in 5 academic papers he kept quoting.
@RazoBeckett.
@RazoBeckett. Ай бұрын
New keyboard ????
@srijanraghavula
@srijanraghavula Ай бұрын
@dreamsofcode can you make a video on youe terminal and how we can make one of our own? Im a student and i am sure toms of other students dont know this stuff, the very little makes it confising how to do such stuff
@a1mer06
@a1mer06 Ай бұрын
Great video as always boss
@dreamsofcode
@dreamsofcode Ай бұрын
Thanks home slice!
@dmitrylitovchenko2365
@dmitrylitovchenko2365 Ай бұрын
I did not get the last part about making the spinner thread-safe. In the Start method the locking is done around context creation and done channel instantiation. So if the Start method is called simultaneously from multiple goroutines they are going to skip over isRunning check and then create same context and done channel. I would wrap the isRunning check in with a lock because I do not see how the spinner can be used from multiple goroutines. Am I missing something?
@abpdev
@abpdev Ай бұрын
Great video!
@yuu-kun3461
@yuu-kun3461 Ай бұрын
Cool wallpaper!
@fahimferdous1641
@fahimferdous1641 Ай бұрын
Ngl, at first i thought you were on a cockpit, then realised it's just your setup....
@Eurotool
@Eurotool Ай бұрын
I'd love to be a CLI designer. I have ample experience in MUD coding. But alas it's not an actual job
@AcunPearce
@AcunPearce Ай бұрын
Well explained video. Can you share your tmux config?
@user-ot9fy8ym4g
@user-ot9fy8ym4g Ай бұрын
i rly love the start window animation. Is that a copmositor or just video editing?
@dreamsofcode
@dreamsofcode Ай бұрын
Both! I have my hyprland animations set to how I edit my videos now! You should be able to find it in my dotfiles.
@user-ot9fy8ym4g
@user-ot9fy8ym4g Ай бұрын
@@dreamsofcode nice but ahh hyprland… alright I use bspwm(I tried hyprland and found it troublesome). But ty for sharing
@AJMansfield1
@AJMansfield1 27 күн бұрын
17:25 Wait, only setting up VC _now_? Every time you switch phases in TDD, you should be creating a commit.
@arbellaio
@arbellaio Ай бұрын
Hi I would like to learn how you make your videos. Can you guide on what tools and softwares you use?
@auraSinhue
@auraSinhue Ай бұрын
What theme is that?
@johnfjeldberg7717
@johnfjeldberg7717 Ай бұрын
"Little bit confused" we have all been there..
@semiglassface
@semiglassface Ай бұрын
It's called a throbber
@MrProfizmus
@MrProfizmus 22 күн бұрын
they're also called throbbers, fyi :))
@animanaut
@animanaut Ай бұрын
while the presentation is top notch, some minor complaints about the TDD shown here: - lots of code written before the test - test tests implementation details not behaviour/intent(which should drive the design) - you skipped the red in red-green-refactor altogether tdd should drive the design and not be a implementation validator. as a result you should end up with a better design that is as a side effect also easier to test. so tdd should be better called test driven design imo. do not want to sound overly pedantic here but i reread "tdd by example" recently, so it was fresh in my mind.
@solinovo3219
@solinovo3219 Ай бұрын
it would be interesting to see this done in haskell
@dreamsofcode
@dreamsofcode Ай бұрын
Agreed! I think it's an interesting project in general due to the concurrency and thread sync.
@TheHTMLCode
@TheHTMLCode Ай бұрын
Is that a moonlander? How are you finding it? I’m using a custom kyria split keyboard at the moment and keep eyeing up the moonlander 😄
@dreamsofcode
@dreamsofcode Ай бұрын
It is a moonlander! It's my favorite of the split keyboards so far, just beating out the voyager. Mainly because I use the extra thumb key for video editing. If it were just pure coding, then I think the voyager might be better, but missing a wrist rest is upsetting as well. I'll do a video on each soon!
@TheHTMLCode
@TheHTMLCode Ай бұрын
@@dreamsofcode I can’t say I’ve heard of the voyager, I’ll be sure to take a look now, thank you very much 😄 Looking forward to your review video
@KravMcCalister
@KravMcCalister Ай бұрын
Curios to know how long the entire process took though 😅
@dreamsofcode
@dreamsofcode Ай бұрын
For TDD? Definitely quicker than the initial approach (especially as it ended up working) but I have decided I wanted to capture it as a video at that point which always adds time. Compared to using a third party package then yeah def slower haha
@sledgex9
@sledgex9 Ай бұрын
Where do you show the visual of what you coded/were trying to code?
@dreamsofcode
@dreamsofcode Ай бұрын
Unfortunately I had removed the code 😔. I wasn't expecting it to turn into a video and so I didn't record my original work.
@GegoXaren
@GegoXaren Ай бұрын
It's called a "throbber" not a "spinner". 😂
@sillytechy
@sillytechy Ай бұрын
Hi Can you give me the link to the keyboard you are using.
@dreamsofcode
@dreamsofcode Ай бұрын
Hey! It's the ZSA Moonlander! I don't have a direct link as on the move but google should.find it
@Daniel_Zhu_a6f
@Daniel_Zhu_a6f Ай бұрын
one of the worst cases for tdd (graphics is prob worse). you can just visually check if it spins correctly, but you can't check that the sequence you wrote to buffer renders as expected in the terminal.
@schmoris
@schmoris Ай бұрын
should of just added a jif
When RESTful architecture isn't enough...
21:02
Dreams of Code
Рет қаралды 272 М.
Function Iterators might just change the way we write loops in Go
11:35
Unveiling my winning secret to defeating Maxim!😎| Free Fire Official
00:14
Garena Free Fire Global
Рет қаралды 8 МЛН
Please Help Barry Choose His Real Son
00:23
Garri Creative
Рет қаралды 22 МЛН
Алексей Щербаков разнес ВДВшников
00:47
小丑把天使丢游泳池里#short #angel #clown
00:15
Super Beauty team
Рет қаралды 46 МЛН
Projects Every Programmer Should Try
16:58
ThePrimeTime
Рет қаралды 436 М.
This homelab setup is my favorite one yet.
21:30
Dreams of Autonomy
Рет қаралды 201 М.
Tactics & Keyframes: Visualizing Lean 4 Proofs in Blender
8:47
David Renshaw
Рет қаралды 7 М.
The standard library now has all you need for advanced routing in Go.
13:52
How principled coders outperform the competition
11:11
Coderized
Рет қаралды 1,6 МЛН
Turning the worst key on a keyboard into the most useful one
10:00
Dreams of Code
Рет қаралды 175 М.
Java Is Better Than Rust
42:14
ThePrimeTime
Рет қаралды 245 М.
10 weird algorithms
9:06
Fireship
Рет қаралды 1,2 МЛН
are we seriously STILL talking about this?
10:00
Low Level Learning
Рет қаралды 10 М.
Unveiling my winning secret to defeating Maxim!😎| Free Fire Official
00:14
Garena Free Fire Global
Рет қаралды 8 МЛН