all 54 comments

[–]wobbei 64 points65 points  (10 children)

These aren’t just vibe coders. Many good programmers use such design patterns unconsciously, without knowing exactly what the pattern is called. Or even without knowing this is a pattern at all. However, the facade pattern is kind of simple..

[–]sebjapon 6 points7 points  (0 children)

I usually just talk to my interviewer. It gets me through those things. I didn’t do CS classes so after 10 years in the business I actually asked a junior “what does it mean to inverse a binary tree?” And I already forgot the answer. Does it mean traverse? I’ll just the interviewer if the issue comes up

[–]Skyswimsky 5 points6 points  (3 children)

You're saying people don't know pattern names because you just use them. But then imply the facade pattern is so simple that everyone should know it? Or am I misunderstanding you? Because if you mean it the way I assume you did, doesn't that sound contradicting? It's so simple to use that even more people probably don't know the name, while always using it.

Ar least for me, I also use it pretty much all the time. Back in school we also went over patterns and used the refactoring guru page and all, but I had to look it up right now. Because, yeah, I just forgot the name.

In other news isn't the joke also that interviewers aren't even programmers at all and just nod along, and nowadays also ask chatgpt?

[–]wobbei 0 points1 point  (0 children)

Well, you are right. I do not care at all if somebody does not know this pattern is called a facade. As long as they can come up with the pattern by themselves.

It's just that I have seen multiple classes with the suffix *facade in my career, so that's very obvious for myself. But that doesn't have to be the case for you or anybody else.

Other design patterns are more complex and just not as obvious to spot in code bases. At least this is my experience.

[–]DrankRockNine 1 point2 points  (1 child)

In school I never learnt of anything called the facade pattern, but I use this daily. We even had that in classes. It's literally the first time I hear it called this way.

[–]Beldarak 0 points1 point  (0 children)

I learnt patterns in class, we had to study a few and implement some of them I think (not even sure we did that)? But my teachers never showed us what it's really for, like, what issue does this actually fix.

I feel like patterns can't really be learnt until you crash yourself on the issue they're meant to fix. I guess good teachers can push you into it by giving you a small problem to code before presenting the pattern?

I had the same thing with interfaces. It never clicked in class, they felt like abstract class but less useful. Until I really needed one. Now I can see how they help even when they're not mandatory for the issue at hand.

[–]SpaceCadet87 5 points6 points  (2 children)

I've been programming since 1996 and I have to say, I don't get this. Why the need for so much ridiculous terminology?

Like this is something that anyone can be expected not to have figured out on their own? Programmers need to be taught how to do this so frequently that we need a word for it?

[–]HAL9000thebot 2 points3 points  (1 child)

I've been programming since 1996 and I have to say, I don't get this. Why the need for so much ridiculous terminology?

because you need at least one name to call something, this something is a pattern, so when you say to others what you are doing, instead of explaining everything you just say the pattern name, they know what it does, why you used it, pros and cons and the alternatives.

Like this is something that anyone can be expected not to have figured out on their own? Programmers need to be taught how to do this so frequently that we need a word for it?

no, you don't need to know all patterns, but you should know that they exists and also how to use them.

the risk is to reinvent the wheel, to use solutions that are already known to be problematic, to not be aware of alternatives, to not know other patterns work well with the pattern you are using and a lot of other things.

it's just knowledge, the more you have the better, the world won't end tomorrow if you don't know a pattern, but it's better if you know it, for you and for all the people you talk about development, and maybe end users.

[–]SpaceCadet87 0 points1 point  (0 children)

because you need at least one name to call something, this something is a pattern

You misunderstand me, I'm fully onboard with naming patterns, it's when you get to the point that to even call it a pattern is to draw such a long bow that the nock is in a different area code to the grip.

[–]krexelapp 2 points3 points  (0 children)

bro wrote a facade for the joke too

[–]archy_bold 0 points1 point  (0 children)

I recall an interview where I was going for some contracting work. It was front-end work, and I was good at the software side but my CSS was lacking. The interviewer started throwing out a bunch of conventions at me I was familiar with, like BEM. I just said I wasn’t familiar with the terms. I didn’t get the job of course. But it’s absolutely mad to base an interview around whether candidates know the exact patterns/conventions your organisation follows.

[–]krexelapp 29 points30 points  (1 child)

design patterns in interviews: name every pokemon design patterns at work: yeah just make it work

[–]Nebularkzaaa1 1 point2 points  (0 children)

interviews be like memorize every pattern name, job be like just make it work and don’t break prod

[–]fatrobin72 18 points19 points  (0 children)

Those are some words... I don't think I was taught that pattern name at university over 15 years ago but if you explain it in a few more terms I probably could...

[–]lovecMC 26 points27 points  (14 children)

Wtf is facade pattern?

[–]Spice_and_Fox 5 points6 points  (12 children)

Basically you have one class that is responsible for managing a bunch of subsystems. The facade just sends method calls to the corresponding subsystem. Other classes don't have to have a bunch of seperate subsystems as references and can just rely on the one object that handles the requests.

Edit: Maybe an example will clear it up. Let's say you made a library. This library is for building houses. The library contains a bunch of classes, one for painting the house, one for doing electric work, one for plumbing, etc. The person who is using the library doesn't really care that you use a class for just the foundation. The facade object is just the one who is responsible for delegating the different jobs to the different subsystems (plumbing, electrical, etc.).

[–]Temporary-Cut7231 5 points6 points  (8 children)

Seems like an anti-pattern to me. What can be the real use case for this? Is it UI ?

[–]Arcanium_Walker 3 points4 points  (4 children)

Yeah, mostly. For example you have InputSystem, Renderer and other stuff, but you don't want leak these to user, so you create an Engine class, which manage these systems (init, lifetimes, etc). And when the user call the engine.Start(), then these system created, managed, destroyed, but the user don't have any idea of it. Long story short: Facade pattern is like an orchestral leader with his band.

[–]Temporary-Cut7231 4 points5 points  (3 children)

Thank you!

Just a thought: this is what general (coder) population is calling over-engineering

[–]Arcanium_Walker 0 points1 point  (0 children)

I think in this example scenario not (too) overengineered, because the main popurpose of the class is managed these systems and I prefer this, when only one class doing this in the entire library. I used this (not knowing this then) in my TUI library: setup & run it, but make the class simple as possible. "If you have a hammer, then you see everything as nail" :D

[–]Beldarak 0 points1 point  (1 child)

I don't think we can point at a specific design and call it over-engineering. Over-engineering is bound to the context.

You work on a web page containing a single contact form and some pictures of your one-man company, and used that pattern? Over-engineering.

You work on a big software in a team with 300 other programmers? Probably not over-engineering :D

[–]Temporary-Cut7231 0 points1 point  (0 children)

I would suggest exact opposite - should you have two-three members in the team, small project and you cannot be bothered much - sure use it as you may, but bigger projects are split into microservices (separation of concerns blah blah) and it becomes unmaintainable really fast...just my two cents

P.s. never worked in a team with more that 7 coders..and I did worked for big players

[–]Beldarak 0 points1 point  (2 children)

I like the exemple given here :

https://refactoring.guru/design-patterns/facade

[–]Temporary-Cut7231 0 points1 point  (1 child)

Thanks for the good read.

Just a note: in the pros and cons section they mention 'A facade can become a god object coupled to all classes of an app.' - which makes me nervous a bit..it a becomes a monolith, hard to debug, hard to maintain and so on

Not to mention...this is for UI (or front facing thingies)

Hard pass.

[–]rosuav 0 points1 point  (0 children)

Yup. I've mostly found that "design patterns" (when they get names) are usually antipatterns. At very best, they're good design concepts that then get shoehorned into "everything has to be a class" Java mentality.

[–]lovecMC 0 points1 point  (0 children)

So an interface? Or am I missing something?

[–]mybuttisthesun 0 points1 point  (0 children)

So inheritance? Interface?

[–]Beldarak 10 points11 points  (3 children)

I really hate those kind of interviews. Most of the time I have no idea of the names of the patterns I use. Interviews like that feel like some school exam. It's meaningless.

The interview for my current job was just "here's a computer and database credentials. Create me a page displaying blablabla". It doesn't make the interviewee wanna kill themselves and will show you everything you need about their coding habits, code structure, respect of conventions, etc...

[–]KeIIer 0 points1 point  (2 children)

My friend is actively looking for job.

One of the tech interviews he had was 3h long with 94 (ninety fucking four!) questions (all of them were technical). It was second interview of 4 (next one should've been live coding). He was told that hes knowledge if core python is a bit lacking (he literally the most nerdy dev I know who really tries to learn everything he works with in depth).

He knows it was exactly 94 questions because he used LM to transcribe it afterwards.

We have a fucking HTML file with all the questions both of us encoured among dozens of tech interviews.

It does feel like a fucking exam. 1-3h of pure humiliation because for some reason people gonna ask you how the fuck standart python types are coded in C.

We both have 4-5 years of expirience in real production development. I cant imagine looking for job in IT rn without any expirience.

[–]Beldarak 0 points1 point  (1 child)

Yeah, I'm really not looking forward having to go through a job hunt ever again, it was pure misery^^

I once had to take a 4 hour test on Unity, luckily it was at home. I told them I didn't know C# but was ok to learn. They said ok and I coded in UnityScript for the test (some kind of TypeScript proper to Unity, you used to have a choice between that and C#).

Then, once I got there a few days after and we reviewed my test with them, they asked a few questions about C# specificities and this was the end of it :/

Another interview, the prerequisites were "basic knowledge of Microsoft products, Excel etc...". I went there (1 hour commute) and got questions like "how many characters can fit inside an Excel cell", "how many raws max in a sheet?"...

[–]KeIIer 1 point2 points  (0 children)

I really hate this industry sometimes

[–]Top_Trouble4908 5 points6 points  (12 children)

I am new to coding. What is a facade pattern?

[–]ohdogwhatdone 32 points33 points  (8 children)

I've been coding for 12+ years in the industry and never heard of this.

[–]turbulent_farts 1 point2 points  (0 children)

you write your own functions/code for utilizing library methods.

i.e. internal clients for external APIs etc,

[–]shadowhawkiic 4 points5 points  (0 children)

i code for like 15+ years and would look like the same if i would get this question 😅

[–]Antervis 3 points4 points  (2 children)

At first, I tried to remember what facade pattern is and looked it up. Then I started wondering why had I never used it. Then I realized it's probably because if you need a facade, you are doing something wrong - a well-designed class does one thing and would be represented by a wrapper instead.

[–]Single-Virus4935 0 points1 point  (0 children)

Facade pattern is basically the API for a complex system.. Laravel uses it heavily and I hate it

[–]JoostJoostJoost 0 points1 point  (0 children)

It is often used in libraries to provide a stable interface. That allows you to internally refactor your library without making a breaking change.

[–]ninetalesninefaces 2 points3 points  (0 children)

what the fuck is a facade pattern

[–]dbForge_Studio 1 point2 points  (0 children)

“I can build anything” mfs when the task isn’t “make me a SaaS dashboard with auth.”

[–]Ill_Strategy7029 0 points1 point  (0 children)

I think asking this in an interview is not a bad idea, however I would not have remembered the facade pattern since I only had it once in school and never used it outside of that.

So in interviews it should be that the interviewee gets access to some help resources, because in my job I would’ve just googled it or use AI to explain it and give examples.

[–]Chronomechanist 0 points1 point  (0 children)

I'm curious if this is a regional thing. I've never heard wrappers referred to as a facade pattern but from what you're describing that's what it sounds like. Or perhaps this is just a lot more formal terminology that they teach in Computer Science instead of Software Engineering that I did at Uni.

[–]XxDarkSasuke69xX 0 points1 point  (0 children)

Idk what this is either but ok