Backend developer with +4 years of experience, continuously looking for learning new concepts and always looking for new challenges, trying to spread the knowledge I gain
One of the most salient features of our Tech Hiring culture is that there is so much bullshit. Everyone knows this. Each of us contributes his share. But we tend to take the situation for granted.
I wonder what other languages have a similarly good structure.
Not like switch case which don't return anything, something better.
Probably functional languages in general?
One of the most salient features of our Tech Hiring culture is that there is so much bullshit. Everyone knows this. Each of us contributes his share. But we tend to take the situation for granted.
One of the most salient features of our Tech Hiring culture is that there is so much bullshit. Everyone knows this. Each of us contributes his share. But we tend to take the situation for granted.
Tree patterns are used in some programming languages as a general tool to process data based on its structure, e.g. C#,[1] F#,[2] Haskell,[3] ML, Python,[4] Ruby,[5] Rust,[6] Scala,[7] Swift[8] and the symbolic mathematics language Mathematica have special syntax for expressing tree patterns and a language construct for conditional execution and value retrieval based on it.
In computer science, pattern matching is the act of checking a given sequence of tokens for the presence of the constituents of some pattern. In contrast to pattern recognition, the match usually has to be exact: "either it will or will not be a match." The patterns generally have the form of either sequences or tree structures. Uses of pattern matching include outputting the locations of a pattern within a token sequence, to output some component of the matched pattern, and to substitute the matching pattern with some other token sequence.
One of the most salient features of our Tech Hiring culture is that there is so much bullshit. Everyone knows this. Each of us contributes his share. But we tend to take the situation for granted.
Really good article thanks
Not that Kotlin when is not true pattern matching found in more fiftieth languages, it's a better switch case. Combined with static types and algebraic types it's 80% of that though
I'm a professional PHP, Python and Javascript developer from the UK. I've worked with Django, Laravel, and React, among others. I also maintain a legacy Zend 1 application.
Yes, good tip but i don't use Kotlin that much, it's language specific but the idea is to make code more readable.
I wonder what other languages have a similarly good structure.
Not like switch case which don't return anything, something better.
Probably functional languages in general?
Like switch expressions for Java v12 have a look
indeed yes, I didn't know they can return a value
Rust has a nice match statement too, even though it is not functional.
I believe it is something that most functional language have and newer languages are starting to adopt it.
Almost every modern language have pattern matching.
In computer science, pattern matching is the act of checking a given sequence of tokens for the presence of the constituents of some pattern. In contrast to pattern recognition, the match usually has to be exact: "either it will or will not be a match." The patterns generally have the form of either sequences or tree structures. Uses of pattern matching include outputting the locations of a pattern within a token sequence, to output some component of the matched pattern, and to substitute the matching pattern with some other token sequence.
The techniques above are called pattern matching. I wrote an article about it here:
dev.to/n1ckdm/pattern-matching-dec...
Really good article thanks
Not that Kotlin when is not true pattern matching found in more fiftieth languages, it's a better switch case. Combined with static types and algebraic types it's 80% of that though
Newer versions of PHP have
match.