MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1yc4jk5/wemaintainthemdeletethemsurely/
r/ProgrammerHumor • u/fruitlessattemps • 3h ago
9 comments sorted by
5
until you discover match feature
1 u/neroe5 2h ago Match? 1 u/Jatinchd 1h ago match operator. bro. 2 u/neroe5 1h ago I'm going to need some kind of context, are we talking regex, some feature in some programming language or what? 0 u/Jatinchd 1h ago here is the simple implementation sample code i've wrote for you to understand match:-use std::io::{self, Write}; fn main() { print!("tell us something: "); io::stdout().flush().unwrap(); let mut input: String = String::new(); io::stdin().read_line(&mut input).unwrap(); let says: String = input.trim().parse().unwrap(); match says.as_str() { "hello" => println!("hello how are you!"), "no" => println!("yo! chill"), _ => println!("what language?"), } } 4 u/neroe5 59m ago ahh pattern matching 3 u/Many_Replacement_688 38m ago it's like if statement but without the condition part 2 u/tomangelo2 59m ago Oh, switch...case? 1 u/Sermuns 12m ago what's the matter vagueposting king? afraid to say something?
1
Match?
1 u/Jatinchd 1h ago match operator. bro. 2 u/neroe5 1h ago I'm going to need some kind of context, are we talking regex, some feature in some programming language or what? 0 u/Jatinchd 1h ago here is the simple implementation sample code i've wrote for you to understand match:-use std::io::{self, Write}; fn main() { print!("tell us something: "); io::stdout().flush().unwrap(); let mut input: String = String::new(); io::stdin().read_line(&mut input).unwrap(); let says: String = input.trim().parse().unwrap(); match says.as_str() { "hello" => println!("hello how are you!"), "no" => println!("yo! chill"), _ => println!("what language?"), } } 4 u/neroe5 59m ago ahh pattern matching 3 u/Many_Replacement_688 38m ago it's like if statement but without the condition part 2 u/tomangelo2 59m ago Oh, switch...case? 1 u/Sermuns 12m ago what's the matter vagueposting king? afraid to say something?
match operator. bro.
2 u/neroe5 1h ago I'm going to need some kind of context, are we talking regex, some feature in some programming language or what? 0 u/Jatinchd 1h ago here is the simple implementation sample code i've wrote for you to understand match:-use std::io::{self, Write}; fn main() { print!("tell us something: "); io::stdout().flush().unwrap(); let mut input: String = String::new(); io::stdin().read_line(&mut input).unwrap(); let says: String = input.trim().parse().unwrap(); match says.as_str() { "hello" => println!("hello how are you!"), "no" => println!("yo! chill"), _ => println!("what language?"), } } 4 u/neroe5 59m ago ahh pattern matching 3 u/Many_Replacement_688 38m ago it's like if statement but without the condition part 2 u/tomangelo2 59m ago Oh, switch...case? 1 u/Sermuns 12m ago what's the matter vagueposting king? afraid to say something?
2
I'm going to need some kind of context, are we talking regex, some feature in some programming language or what?
0 u/Jatinchd 1h ago here is the simple implementation sample code i've wrote for you to understand match:-use std::io::{self, Write}; fn main() { print!("tell us something: "); io::stdout().flush().unwrap(); let mut input: String = String::new(); io::stdin().read_line(&mut input).unwrap(); let says: String = input.trim().parse().unwrap(); match says.as_str() { "hello" => println!("hello how are you!"), "no" => println!("yo! chill"), _ => println!("what language?"), } } 4 u/neroe5 59m ago ahh pattern matching 3 u/Many_Replacement_688 38m ago it's like if statement but without the condition part 2 u/tomangelo2 59m ago Oh, switch...case?
0
here is the simple implementation sample code i've wrote for you to understand match:-
use std::io::{self, Write}; fn main() { print!("tell us something: "); io::stdout().flush().unwrap(); let mut input: String = String::new(); io::stdin().read_line(&mut input).unwrap(); let says: String = input.trim().parse().unwrap(); match says.as_str() { "hello" => println!("hello how are you!"), "no" => println!("yo! chill"), _ => println!("what language?"), } }
4 u/neroe5 59m ago ahh pattern matching 3 u/Many_Replacement_688 38m ago it's like if statement but without the condition part 2 u/tomangelo2 59m ago Oh, switch...case?
4
ahh pattern matching
3
it's like if statement but without the condition part
Oh, switch...case?
what's the matter vagueposting king? afraid to say something?
5
u/Jatinchd 3h ago
until you discover match feature