So instead of nesting conditions, you're repeating code How is that cleaner?
@omarfarouk01Күн бұрын
very useful content
@awesomemantroll1088Күн бұрын
Store all conditions as booleans at the top of the code (you can cast if you need to). Use the booleans in the if-statements. Now there's no nesting, and there's also only one return value
@privilledgeКүн бұрын
Great tutorial 👏, I highly recommend
@zero_asdКүн бұрын
Ah the "six line if statements" hell😂
@legowyn24Күн бұрын
Remember, there is no right or wrong method when it comes to coding. If it works that's what matters
@riantix2 күн бұрын
When you're trying to figure out alignment of your widgets (particularly, at 1:45:00), you can do Ctrl-Shift-P (not sure about mac) in VS Code and type "Toggle Debug Painting" to enable "Flutter: Toggle Debug Painting". This will let you see how big the columns/rows are, how much space they're using, why things are located at certain places and so on. Also thanks for the tutorial, it helps a lot!
@Dystisis2 күн бұрын
It's not that important for your code to be easy to read. Much more important that it runs well.
@mohammadfekri49873 күн бұрын
tanx for video
@mohammadfekri49873 күн бұрын
tanx for nice video
@prash_sh3 күн бұрын
Why not do (condition && condition && condition)
@imuw54084 күн бұрын
Decorator pattern
@Me_Jawad4 күн бұрын
Simplify more &&
@KorruptorK4 күн бұрын
While nested ifs is never a solution, having a lot of return blocks is not that good either (not sure as of right now, but Sonar also had a "clean code" rule that enforced a single return value per function, and I also recall cyclomatic complexity was affected by the amount of returns. I'd rather have a single "isUserLoggedInAndAdmin" which wraps all the required logic (and can be used everywhere else) abd a single if/else block. Much more readable and easier to debug as specific logic is wrapped where is actually belongs, imho You could even have two functions if you want to enforce maximum modularity: "isUserLoggedIn" and "isUserAdmin". This may look overkill because your example is using basic booleans, but try fetching those statuses out of a token or a db every time on your code and it quickly becomes a copy/paste smell on unexperienced hands..
@karansuthar33374 күн бұрын
now i know more of what is possible in flutter. nice work👌
@generallhud4 күн бұрын
This code still ugly, you can use &&, or why the hell you need to check if logged in while you are able to check user role?
@jayabegglen46655 күн бұрын
Orrrrr: If (WiFi and login and admin): //do stuff Else //do something else
dart library 'dart.ui' is not available on this platform ????? what should i do i m really annoyed
@ThomasVWorm5 күн бұрын
This example shows, that the language lacks the "unless" keyword.
@joeydicastro6 күн бұрын
Amazing, thank you.
@PlayBASIC-Developer6 күн бұрын
Its funny how often wrong gets redefined in programming. Way...back When I was a kid, functions have a single exit point. So you had to nest by definition.
@hoangkietvo57906 күн бұрын
Thanks for this toturial
@_Nitrous_6 күн бұрын
1.this is just an example, everybody need to calm down with the "security" stuff... 2.early return is not necessarily a better option 3.try to avoid big nested IF statement.. obviously 4.nobody cares about your unit test, except maybe at university 5.Vive le Quebec !!
@user-ou7hd1zi2i7 күн бұрын
I really appreciate you guys taking your time to explain this to us. Thanks so much.🙏🏾🙏🏾
@MarcosOliveraZapata7 күн бұрын
That is poor software design, not following OOP principles, SOLID, etc.
@amairanifox13327 күн бұрын
Fine
@user-wv9pw9tq1g7 күн бұрын
Can’t say for RefactorGPT to crawl through my code and do this + security all for me 😂
@xushidjonismatov41817 күн бұрын
rahmat
@codewithsanta10547 күн бұрын
Please create video for flutter web nav menu with submenu like we use in bootstrap
@tiziprince8 күн бұрын
Thank you so much. You made me understand Flutter within a twinkle of an eye. God bless!!!
@UltraFiero8 күн бұрын
Better yet, use an assertion and handle the exception. Why have a function that is supposed to do something and just silently fails while printing a log. Thats just bad code right there. Best bet here is 3 assertions and then a if (wifi && login && admin) to further protect it
@syzore28 күн бұрын
Is it possible to change the buttons text? And is it possible to close all the steps? (too bad the current step is not nullable..)
@ancienttech46039 күн бұрын
I guess you've never heard of, "one way in, one way out." There is also the problem of lazy coders throwing a quick line of code at the end of a function, thinking it will be run when the function exits. There are uses for early returns, but I don't think readability is a good one.
@easyelectronics43649 күн бұрын
Legends think of function pointers💪💪
@jessejackman97069 күн бұрын
So its the same
@FranklinLokki9 күн бұрын
don't you have a french channel for the same content ?
@aldoalexisurtusuasteguicar749310 күн бұрын
very well explanation of clean architecture using a cone. thank you!
@KosmicK110 күн бұрын
This video is wrong
@7atab10 күн бұрын
I'm not a programmer but I know for sure that must be there's "or" "and" "not"statement?
@crimsonlion10012 күн бұрын
If you encounter this problem with YOUR hand written code. Close it up, set down that keyboard big man. This ain't the industry for you. You should ALWAYS write code to be more smart, rather than just what is easiest. If you're starting out, never do this. This shows others reading your work that you make spaghetti code.
@NikiRahmadiWiharto12 күн бұрын
I like this video, it simple to understand the hole of clean architecture things
@Zytron12 күн бұрын
how about this: if (wifi && login && admin) seeAdminPanel(); else { if (!wifi) debugPrint("Must be connected to WiFi"); if (!login) debugPrint("Must log in to your account"); if (!admin) debugPrint("Must be an administrator"); // this will also print more than one of these if more than one is true }
@ThomasVWorm5 күн бұрын
Duplicate code. You test the same conditions twice.
@user-ks1xl3qy9h13 күн бұрын
This was actually a usefull vid I might use it
@xsanos258613 күн бұрын
I think in python it would be like: if (wifi): pass else: print("error") return