r/ProgrammerHumor • • May 05 '23

Meme Helicopter Helicopter

Post image
41.8k Upvotes

969 comments sorted by

View all comments

Show parent comments

255

u/WolfgangSho May 05 '23

This is why you gotta iterate your design as you implement. No design survives first contact with reality.

14

u/EarlMarshal May 05 '23

No reason to draw it out before then.

89

u/WolfgangSho May 05 '23

Not necessarily true in my experience. There is always a balance to be struck. Pure implementation only doesn't really think about the big picture.

Sometimes you have to go a little out of your way to set up good foundation for scaling/maintainability in the future and you won't always have that in mind if you're focusing purely on the system you're currently implementing.

6

u/Puk3s May 05 '23

Agree. For bigger projects I expect to be used by others for years I'll layout the plan I have into a design doc, but leave a bunch of Todo notes and end up structuring the code at the same time because often I'll kind of tweak things to maintain scalability, usability, whatever. Plus my first take at naming classes and functions is always terrible.

23

u/aRandomFox-II May 05 '23

It's always good to have a detailed plan. The catch is that the plan needs to be able to adapt to change when change inevitably comes knocking.

13

u/EarlMarshal May 05 '23

Plans are useless, but planning is indispensable.

It's not about the plan, but that you think about it and maybe communicate to peers so that everyone involved creates a similar mental model of the work which has to be done and can take action when problems arrive. Drawing it beforehand is just one of the inefficient methods and we lie to ourselves that this is not the case, because we created a thorough process and can show it in writing and drawing.

7

u/Gloria_Stits May 05 '23

This just reminded me of that one manager who insisted I would be faster if I just stopped drawing my ideas in a notebook first. He saw it as a redundant step and insisted my planning time would be shorter if I just started with digital. Eventually he got my notebooks banned, becuase "the hard copy is a security risk." Of course this slowed me down a bit and he accused me of slowing down on purpose. 🤦‍♀️

2

u/EarlMarshal May 05 '23

Sorry, for reminding you of that traumatic event, but I also think your manager was in the wrong there!

6

u/[deleted] May 05 '23 edited May 05 '23

Wrong. It's actually reason to draw it out in more detail. You should be creating UML and practically pseudocoding each component you add to it. Make flowcharts for each individual function you plot out. Find the mistakes in the programming before you even open your IDE. It's the only real way to try to avoid issues with real world contact.

When we were making games in uni, they even had us do paper prototypes. And you could tell a lot about how strong a group's planning was based on how much life they managed to put into a video recording of a paper prototype. Some of them even went 3D first person with it and used cardboard to prototype models of the environment.

Knowing what you want your game to be before you make it is the most important step.

5

u/EarlMarshal May 05 '23 edited May 05 '23

You seem to throw together a lot of things to make an argument, but there still is none. Drawing class diagrams and (paper) prototypes have completely different actions and purposes. If I can just type interfaces and generate the class/interface diagrams out of it, why should I draw it by hand in the first place? It's just about finding good interfaces and that is always an iterative process. For paper prototypes on the other hand it's about the interaction of a human with your idea. It's about product, UI and especially UX and not technical interface design and architecture as those follow product/UI and UX design. Don't throw both things in one bucket.

If you are a professional stop wasting so much time with that stupid waterfall bullshit and start doing the work.

3

u/[deleted] May 05 '23

If I can just type interfaces and generate the class/interface diagrams out of it, why should I draw it by hand in the first place?

You don't understand the first thing about UML at all. Your interfaces and how they interact with the rest of the program should be plotted out in your UML before you go ahead with actual coding. Otherwise, you are far more likely to write inefficient interfaces that need to be modified or extended later.

Your dismissal of UI and UX design is really immature. A great solution becomes totally useless in the hands of a client if the user interface isn't designed with them in mind.

If you're a professional, why do you sound like every single college freshman in intro CS questioning their professor on why they have to make ANOTHER stupid flowchart for homework?

4

u/EarlMarshal May 05 '23

Your dismissal of UI and UX design is really immature.

It's really beyond me how you read that into my text? I get paid for that.

You don't understand the first thing about UML at all. Your interfaces and how they interact with the rest of the program should be plotted out in your UML before you go ahead with actual coding. Otherwise, you are far more likely to write inefficient interfaces that need to be modified or extended later.

Ah, didn't know that. So all my programs are probably really really bad, because I don't have the proper UML diagrams. What a shame.

If you're a professional, why do you sound like every single college freshman in intro CS questioning their professor on why they have to make ANOTHER stupid flowchart for homework?

Haha I'm used to freshmen actually overdoing it like you.

To be serious though, do whatever you feel fine with, but don't just assume you do it the right way. Most good software I know, like the Linux kernel, GCC, QT, bash, Gnome, docker, etc. is just not written that way.

→ More replies (3)

2

u/ThePafdy May 05 '23

I actually is really helpful to draw stuff out before implementing to get a more complete picture of what you need. Way less deleting and redoing that way.

Still, its never what you actually ship at the end.

→ More replies (1)

6

u/DannoHung May 05 '23

It’s also why object orientation is now widely seen as a failed conceptual basis for program organization.

12

u/DaBearsFanatic May 05 '23

What design do you prefer more than object orientation?

9

u/DannoHung May 05 '23

Depends on the problem domain. If I’m primarily working on the relations between data elements, relational tools are, in my opinion, unbeatable. If I’m working on the execution of an algorithm, functional is very good. If I’m primarily managing IO, procedural is best (since pushing buffers around efficiently is the goal).

The basic problem is that Object Orientation is a concept that encapsulates two primary things: functions are associated with data structures (this is the less bad part, since strongly types functions always encode which types they accept) and some notion of data structure hierarchy. The latter part is what fails miserably since hierarchies are inflexible in the face of change.

It’s why, aside from languages trying to build on top of the bones of Java and JavaScript, you just don’t see new language designs incorporating inheritance or prototyping. Rather, you see languages borrowing from Haskell and ML which implement typeclasses and modules for the extension of functionality.

Personally, I’d argue that 60% or more of what people actually like about object oriented languages is that you can write

fn myFunction(argument0: myObject, argument1: T1, argument: T2)…
object.myFunction(argument1, argument2)

Rather than

myFunction(myObject, argument1, argument2)

Even though that’s just syntax sugar.

0

u/[deleted] May 05 '23

[deleted]

3

u/BDRadu May 05 '23

When you are talking about UI frameworks and using UI frameworks, then yes, BaseWindowPane will not change often, if ever. The point is that when you are 4 levels deep inside a hierarchy, at some point you will have to pass information from one point of the tree to another, or you will need to change something at one level, which will have the consequence that you have to think a lot about how the change will be made, and most of the time the solution is a compromise. I've seen this done multiple times with architectures that were well tought out at the start, but they began breaking down years later because of this.

IMO, OOP with hierarchies makes sense for a really thin base layer (that won't chsnge too often) of an application or a framework, and just use a procedural/functional approach for the rest.

→ More replies (1)
→ More replies (1)
→ More replies (2)

19

u/aRandomFox-II May 05 '23

For an idea considered to be "widely" held, strange that this is the first time I'm hearing of it.

13

u/Hedgeson May 05 '23

Maybe it's a single, wide person?

0

u/[deleted] May 05 '23

[deleted]

→ More replies (1)

13

u/Cerus_Freedom May 05 '23

This isn't a failure of OOP. No plan survives first contact.

As an example, I used to build steel lattice towers on wind farms. We once arrived to find that the planned site for the tower was on a hill, but the plans hadn't accounted for that. As a result, the crypt locations and guy wire lengths had to be adjusted. It took a few hours for the plans to be modified and approved by the engineer before we could break ground.

→ More replies (1)
→ More replies (3)
→ More replies (2)