Clear, nice and everything ok, but no one explains practical use!Look at the code. It's a little changed. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 12

Clear, nice and everything ok, but no one explains practical use!Look at the code. It's a little changed.

https://code.sololearn.com/c9iZSbd7sitM/?ref=app

26th Mar 2018, 8:15 PM
Vučko/Вучко/Vuchko
Vučko/Вучко/Vuchko - avatar
3 Answers
+ 6
All they are trying to teach is possibilities. Practical use isn't their concern. If you know what can be done and have a practical usage for it, you will be able to solve it. It is a hugely powerful pattern matching syntax. I've never used some things I've learned. However, I have always been able to uniquely select my target strings and process them the way I want. That is the goal of the lesson. Make you understand the possibilities so you too can always solve your practical problems.
27th Mar 2018, 4:59 PM
John Wells
John Wells - avatar
+ 2
For this specific code, there is very little practical use. The idea is the concept of pattern matching though, and that is useful all over the place. Validating email or phone numbers, finding patterns of text in large strings, etc. Lots of uses.
27th Mar 2018, 5:00 PM
Adam
Adam - avatar
+ 1
The practical use of that code is to inspire people to watch the associated Monty Python sketch: https://www.youtube.com/watch?v=anwy2MPT5RE Enjoy! :-)
2nd Apr 2018, 1:12 AM
Emma