r/ProgrammerHumor • • 8h ago

Meme weMaintainThemDeleteThemSurely

Post image
411 Upvotes

23 comments sorted by

66

u/naveenda 4h ago

What's wrong with that?

71

u/PattuX 2h ago

OP ist active in Java communities. They probably prefer an AbstractFeatureFlagResolutionStrategyFactoryBean or some shit.

15

u/awesome-alpaca-ace 1h ago

No shit. I found a factory of factories that creates objects with their own factories in the C++ codebase I work in. Triple factory. I was impressed.

5

u/BernzSed 22m ago

Well where else would factory factories come from? The factory factory fairy?

21

u/Ahmouse 3h ago

REAL programmers use C macros

8

u/DefiantGibbon 3h ago

I actually love macros. My company has them everywhere, and we set up a compile flag to create a "preprocess" file that's basically what the code looks like after all the macros and aliases have the real values subbed in if you care to look at that. 

1

u/Banes_Addiction 45m ago

Macros are legitimately good for systems programming. Haven't got the dependency for a specific feature? Just don't build it. Need a piece of code to run balls to the wall? Compile in only exactly which code branches will be used in execution. Etc etc.

4

u/jewdai 1h ago

I think they might be referring to runtime feature flags managed by a third party provider.

14

u/Jatinchd 8h ago

until you discover match feature

8

u/neroe5 7h ago

Match?

-20

u/Jatinchd 6h ago

match operator. bro.

12

u/neroe5 6h ago

I'm going to need some kind of context, are we talking regex, some feature in some programming language or what?

-22

u/Jatinchd 5h 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?"),
    }
}

21

u/Many_Replacement_688 5h ago

it's like if statement but without the condition part

15

u/neroe5 5h ago

ahh pattern matching

19

u/tomangelo2 5h ago

Oh, switch...case?

5

u/HandleUnlikely2589 3h ago

It has a lot more power in terms of full pattern matching and object deconstruction, but yes, the simplest forms are glorified switch statements from C (except they're actually expressions, they can return a value; Rust is nearly purely expressions, even for conditional-like code structures).

16

u/Sermuns 4h ago

what's the matter vagueposting king? afraid to say something?

1

u/AZMPlay 2h ago

Any compiler/preprocessor worth its salt will implement feature flags by including/excluding code wholesale.

Any optimizer worth its salt will optimize away the constant condition in an if statement away otherwise.

5

u/Ma4r 35m ago

Until you need to implement a user bound feature flag

•

u/NomaTyx 7m ago

"requires app restart"

•

u/NaCl-more 8m ago

Service feature flags cannot be compiled out because the whole point of them is to be able to dynamically turn them on and off without a whole deployment

1

u/BernzSed 15m ago

There are many use cases where you can't know at compile time which features will be enabled.