Пікірлер
@RhythmButtons
@RhythmButtons 10 күн бұрын
hi
@carlmeyer96
@carlmeyer96 19 күн бұрын
Well done on putting your first dev vlog out there! Good luck on your development!
@Emmanuel-Pangan
@Emmanuel-Pangan 18 күн бұрын
Thank you for your wonderful comment!
@catprog
@catprog 4 ай бұрын
I like reporting all the errors and then exiting from the function. error = false; if(!isUsername){ error = true; console.log('bad username'); } if(!isPassword){ error = true; console.log('bad password'); } if(error) { return; }
@Emmanuel-Pangan
@Emmanuel-Pangan 4 ай бұрын
That's also a good way. Catching the errors first, sending the error message, and then exiting the function. This way, it prints all the possible errors before exiting the function.
@jonbondMPG
@jonbondMPG 5 ай бұрын
The refactoring you are carrying out results in less nesting, or flatter code, this may appear to be favourable and indeed that is how you've presented it. There is also benefit to keeping negative pathways insight at the top of a function for sure, however those cases where you have multiple pre-conditions you may end up with a large, buggy, hard to maintain single "If" at the top, or (my personal hate) you may end up with multiple return points within your function. Lets take a look at such an example, where we can clearly see there are multiple returns, how it affects a compiled optimized language like C++ (sorry, I don't have a C# example to hand). megalomaniacbore.blogspot.com/2019/01/c-coding-standards-dont-return-early.html We can see from that example that sure you get "flatter code", and this is talked about in the wikipedia entry for guard clauses, but really, do you want to have a bug where you forget to close a file, or deallocate some local resource because it's repeated N times in a multiple exit patterned function? I certainly don't. I'm a bit of a fan of having one nested root of truth to a function, and if there are two required, well that's an indicator I need to factor things into two functions.
@itachi2011100
@itachi2011100 5 ай бұрын
this is called early exit pattern
@Emmanuel-Pangan
@Emmanuel-Pangan 5 ай бұрын
Never heard of that, guess, you learn everyday! Thanks btw.
@Emmanuel-Pangan
@Emmanuel-Pangan 5 ай бұрын
0:57 The "Before" code is not the same to the original code. Sorry about this.
@Emmanuel-Pangan
@Emmanuel-Pangan 5 ай бұрын
Well a bit late but... Happy New Year everybody! Also, I won't use TTS anymore so I hope you're ok with my voice. And the video is recorded in low-quality settings because of OBS somehow, it should be 1080p but oh well. Best wishes!
@proton46
@proton46 5 ай бұрын
Informativ video as always... You're doing great... Can't wait for the next video!
@Emmanuel-Pangan
@Emmanuel-Pangan 5 ай бұрын
@@proton46 Thanks a lot Proton! I'm wondering if I should do Unity tutorials next... and probably shift this channel to the game development side, any takes on this?
@proton46
@proton46 5 ай бұрын
@@Emmanuel-Pangan I haven't used unity in the last 2 years... but I think shifting over to game development at least for now is a good idea... You can still make videos about more advanced c# features(e.g. delegates and events) as some of these features are probably useful for gamedev as well... :)
@joschaegloff
@joschaegloff 7 ай бұрын
17 subs already ;) 🎉
@Emmanuel-Pangan
@Emmanuel-Pangan 7 ай бұрын
Yeah, its crazy that this channel have 0 sub 2 months ago, and now we're at 17! 🥳🎉 And thanks for sticking this long! :^)
@joschaegloff
@joschaegloff 9 ай бұрын
Great video! :)
@Emmanuel-Pangan
@Emmanuel-Pangan 9 ай бұрын
Thanks!
@proton46
@proton46 9 ай бұрын
Well... what can i say?
@Emmanuel-Pangan
@Emmanuel-Pangan 9 ай бұрын
Hi, did you encounter a problem?
@proton46
@proton46 9 ай бұрын
@@Emmanuel-Pangan No, your videos are high-quality and also informative with is great!
@Emmanuel-Pangan
@Emmanuel-Pangan 9 ай бұрын
@@proton46 😭 Thank you so much for your kind words. It really helps a lot when someone appreciates the videos that I make which is a great feeling.
@Emmanuel-Pangan
@Emmanuel-Pangan 9 ай бұрын
Here's the summarize code that you can copy-paste to your Program.cs file: // Console.Write() Console.Write("Hello World!"); // Console.WriteLine Console.WriteLine("Hello World"); Console.WriteLine(); Console.WriteLine("Hello World"); // Console.ReadKey Console.WriteLine("What's your name?"); Console.ReadKey(); // Console.ReadLine Console.WriteLine("What's your favorite color?"); string? color = Console.ReadLine(); Console.WriteLine("My favorite color is " + color);
@proton46
@proton46 9 ай бұрын
Maybe you should put it in a GitHub gist...
@Emmanuel-Pangan
@Emmanuel-Pangan 9 ай бұрын
Thanks for that suggestion! Haven't setup this channel's GitHub yet. Will definitely make it and add this code snippet too.
@Emmanuel-Pangan
@Emmanuel-Pangan 9 ай бұрын
Thanos Twerking Answer is... ✅ Thanos Twerking Answer [ 3 ] + 1 = [ 4 ] The total of Thanos twerking clips in the video is 3. So, if we add 1 to it, and make it into an array. The answer would be [ 4 ]. Congrats to everyone who got it right. Happy coding!