Thanks for sharing. But you don't get the power of match statement. or may be just your example doesn't show that - it just like the same code with little bit different syntax from c/c++. The real power is in structural unpacking and type checking like functional languages do. I suggest you to write a function that get a Coloe - tuple of 3 or 4 numbers - r,g,b and optional alpha channels. and this function should for example increase some channel if there is no alpha otherwise add alpha and print the color. and try to write such function with match-operator and without and compare the code.
🔴 - If you enjoyed this video. Leave a like and subscribe :)
Back with another nice video!
Also, great to see Iran's name there 🙂
Thank you! Had to include it ;)
Thanks for sharing. But you don't get the power of match statement. or may be just your example doesn't show that - it just like the same code with little bit different syntax from c/c++. The real power is in structural unpacking and type checking like functional languages do. I suggest you to write a function that get a Coloe - tuple of 3 or 4 numbers - r,g,b and optional alpha channels. and this function should for example increase some channel if there is no alpha otherwise add alpha and print the color. and try to write such function with match-operator and without and compare the code.
The Ternary Operators are an arse to read and not great for a beginner if they come across it.
You have a valid point here. Even if you’re not a beginner, can be funny to read