r/programming • • Jun 22 '22

The Grug Brained Developer

https://grugbrain.dev/
460 Upvotes

78 comments sorted by

57

u/[deleted] Jun 23 '22

given choice between complexity or one on one against t-rex, grug take t-rex: at least grug see t-rex

lol

102

u/DrunkensteinsMonster Jun 23 '22

grug want filter list:

"Did you convert it to a stream?"

fine, grug convert to stream

"OK, now you can filter."

OK, but now need return list! have stream!

"Did you collect it in a list?"

grug hand reaching for club yet again, control

put common thing like filter() on list and make return list big brain java api developer!

One of the funniest things I’ve seen on here

1

u/cshrp-sucks Jun 23 '22

One could use Collection::removeIf(Predicate) - but be cautious, as it modifies collection instead of returning a copy

30

u/DankerOfMemes Jun 23 '22

The complexity demon arises again

0

u/[deleted] Jun 23 '22

[deleted]

4

u/yawaramin Jun 24 '22

Kotlin is following in the footsteps of Scala and Clojure on the JVM ;-)

4

u/DrunkensteinsMonster Jun 23 '22

This is true. I am also a Kotlin believer. Praise be.

141

u/mtbkr24 Jun 23 '22

In theory I love the idea of making a prototype, learning from it, then improving it; but every fucking company I've worked for deploys the MVP straight into production and then we have to deal with shapeless grug code forever. Although I agree that trying to write the the perfect big brained interface on the first try is also a bad move.

31

u/cat_in_the_wall Jun 23 '22

"Demo driven development"

11

u/huntsvillian Jun 23 '22

"Protoduction"

66

u/nilamo Jun 23 '22

Use a different db engine. "To use this in prod, it'll have to be reworked to interface with our mssql stack." Magic words that let you do whatever you want lmao

63

u/Plorkyeran Jun 23 '22

Five years later: "Why are we running five different DB servers when SQL Server could easily handle everything we're doing?"

6

u/NullOfUndefined Jun 23 '22

Seems to happen no matter what so no one will ever catch on!

2

u/yawaramin Jun 24 '22

That's not a problem if you use SQLite ;-)

16

u/jjh47 Jun 23 '22

It's a nice idea, but the counter point are the millions of mission critical applications in production running on Access DBs.

9

u/[deleted] Jun 23 '22

Yeah this is why the idea of prototyping in e.g. Python and then rewriting it later in a decent language doesn't really sound plausible to me.

"Boss, we've got a prototype that has most of the features we want to demonstrate and it's almost responsive with our 100 test users. Please can we now rewrite it from scratch in a fast and robust language?"

"No way! This works now and we need to ship! We still haven't got feature X. If we need it to be faster we'll just buy more servers."

A few years later you have a gazillion lines of untyped Python or PHP or whatever and have to resort to writing your own runtime to make it perform better.

6

u/Middlewarian Jun 23 '22

I have an arbitrary limit of 10 lines for interpreted languages to avoid that trap.

23

u/Stoic_stone Jun 23 '22

I think in general your MVP should be deployed to prod. It's a product after all, and it's viable. But the MVP is meant to be a tool for learning. And that learning might mean you need to create a new product, or it might mean you need to change the existing product. But it doesn't mean it was wrong to put the MVP in prod

13

u/[deleted] Jun 23 '22

Broke: put your mvp in prod to learn from the use of it

Woke: put your mvp in prod and forget about it until 3 years later when it breaks and causes a massive outage since it’s now a core foundational service and everyone who worked on it has left the company

15

u/[deleted] Jun 23 '22

I agree. The main problem is that people do not understand what a MVP is. A shitty demo that barely works is NOT a MVP.

7

u/rockthescrote Jun 23 '22

Yup. The crucial part is that there’s different definitions of “V” in “MVP” for different stakeholders at different times. And people have a habit of assuming that “V” for one case implies “V” for all cases

6

u/JRandomHacker172342 Jun 23 '22

One of the projects I was on started with a month-long PoC during the month of March - then we went into an extensive planning session with everything we learned from the PoC. We came out of it with a long-term architecture we really liked - and then got told "that'll take too long - clean up the March version and we'll ship that". My team called the new version "March++", and we kept adding pluses (and collapsing pluses into sharps - thanks for the tip, Microsoft) for every subsequent release. For the next three years or so, we kept running into major structural issues - and would always point back and say "this would have been accounted for in the long-term architecture"

2

u/poo_tan Jun 23 '22

It's hard to put into perspective the benefit of refactoring an MVP to benefit future development to those who don't actually write the code.

2

u/Thing342 Jun 23 '22

I think the whole point of the MVP is to ship something usable to the customer so they can start using it to solve real-world problems and offer usable feedback to the development team. To me this necessarily requires a prod-quality deployment to define the total interface of the system. Stuff can be easily refactored behind the scenes when you have a full end-to-end vision for the product implemented.

1

u/mtbkr24 Jun 23 '22

Yeah I agree. I meant to say that it sucks when you never get to address the issues with the MVP. Once in production, it's considered working – no need to waste time refactoring, let's work on adding new features instead 🙃

97

u/Matheusbd15 Jun 23 '22

"javascript developers call very special complexity demon spirit in javascript "callback hell" because too much closure used by javascript libraries very sad but also javascript developer get what deserved let grug be frank" - the last line made me sneeze

41

u/[deleted] Jun 23 '22

Grug has Grug community Grug no know about. Grug happy

16

u/[deleted] Jun 23 '22

I'm hitting that point in my career where I've realized there are better programmers out there than me, but I'm a pretty damned good software developer and that's ok.
Besides, if I'm dumb but write clean code, smarter people can still work on it. Doesn't work the other way around.

39

u/Takeoded Jun 23 '22

Microservices

grug wonder why big brain take hardest problem, factoring system correctly, and introduce network call too

seem very confusing to grug

that hits home

11

u/pcjftw Jun 23 '22

Because micro services was always about company politics and it's the easiest way to segment and divide teams up so that they all have ownership over a specific section of the business.

From a business organisation perspective, it solves lots of problems for them, even if the boundaries are actually artificial in reality.

11

u/[deleted] Jun 23 '22 edited Jun 23 '22

The popularity of microservice architectures at startups has always been confusing to me. Seems like cargo-cult development to me more than anything else. "Well Amazon and Facebook do it this way", yeah, but those companies have hundreds of development teams working on dozens and dozens of different products, your 3 man development team shouldn't try to be them.

5

u/renaissancetroll Jun 23 '22

mainly resume driven development, engineers want to put it on their resume for the next job. Plus many leaders mix cause and effect and assume microservices are why the major companies are successful, rather than seeing that they adopted microservices to help deal with their success and need to scale

same thing with Leetcode style interviews, the big companies use them to deal with so many applicants in a uniform style. For a startup it doesn't make sense

4

u/pcjftw Jun 23 '22

100% cargo cult for start ups, it's basically "monkey see, monkey do"

5

u/[deleted] Jun 23 '22

Because micro services was always about company politics

Nah, microservices have their place.
I worked at a company that had a web-based product. Part of that product was sending emails when certain things happened. It worked fine for them for years until suddenly a power user figured out a way to do an update for all their clients at one button press.
Fast forward to it being the peak operating hours and the whole website is slowed to a crawl because 5,000 emails are trying to send out (they also didn't have an email provider).

A week later we had an early version of the "Messaging" microservice and that problem was solved. A year later when they wanted to add text messaging to the system it was an easy add to the Messaging microservice.

8

u/pcjftw Jun 23 '22

Yeah that just sounds like a terrible system design and not related to needing micro services.

For example in the example you have given, most architects would have the front end web application call an API as normal, and then that API would then place that email "send" into some kind of job queue, now one can Jerry rig a database as a job queue for small scale but for bigger loads, there is loads of message/jobs "MQs" that one could employ. Then one would simply have "workers" that consume the jobs. There normally would also be some kind of of audit + job status, to allow things like failures.and retry etc.

Once again that kind of approach has nothing to do with "micro services", which suggests that each feature/function has its own independent database, its own authentication, its own APIs etc, the idea then is you wire up a bunch of independent "micro services" that would normally be part of a monolith.

2

u/[deleted] Jun 24 '22

Your definition of micro service in your 2nd paragraph is a very strict definition that doesn't fit with the real world discussions of micro services.
So you're saying a different company I worked at that had 23 "micro services" that all shared a main database (but different schemas) wasn't "micro services"?

Yeah that just sounds like a terrible system design

100% correct. It was a very badly designed system. 1 guy built it by himself over 4 years and he didn't even know how to program. Somehow he got successful and retired with millions of dollars.

1

u/pcjftw Jun 24 '22

that all shared a main database yes that would not be considered a micro service in the strictest sense.

1

u/pcjftw Jun 24 '22

that all shared a main database

it would not be a micro service in the strictest sense if they all shared the same database.

1

u/[deleted] Jun 24 '22

Yeah that's what I just said. It's not "in the strictest sense" but imagine telling a company "sorry you can't use the words microservices to talk about what you develop because you don't fit the strict definition so when you talk to other developers you have to come up with new words for that".

1

u/pcjftw Jun 24 '22

Yeah but it's not just having separate databases, a micro service is a complete application that is free standing, they way you have described is not a micro service, strict or not.

You could call it "half arsed, sorta kinda, but not really micro service"

86

u/rep_movsd Jun 22 '22

Grug many shiney advice

16

u/Gibgezr Jun 23 '22

I am definitely, 100%, a Grug.

15

u/skulgnome Jun 22 '22

Grug solve all problem ahead of time

25

u/lwl Jun 22 '22

Hails Grug

35

u/djangodude786 Jun 22 '22

"grug code good to start but modify with non-grug code when needed in future" - That's my approach

11

u/poo_tan Jun 23 '22

"yes" is magic word for more shiney rock and put in charge of large tribe of developer

true

59

u/tarquinnn Jun 22 '22

why no many upvote, too many big brain redditer?

-11

u/[deleted] Jun 23 '22

Because he just labelled most developers over 30?

20

u/[deleted] Jun 22 '22

That was funny. I could not help reading the whole thing.

10

u/ehaliewicz Jun 23 '22

This is one of my favorite things now

9

u/bigjseph Jun 23 '22

OSGi is definitely full of demons

8

u/revereddesecration Jun 23 '22

you may not like, but this peak grug testing

6

u/defietser Jun 23 '22

I couldn't resist reading it throughout the day and had to hold back tears of laughter. Although hard to follow at times, the humour makes it a lot easier to want to read than the really dry stuff with the same message.

6

u/kernel_task Jun 23 '22

Oh geez, I agree with so much of this. Guess me am grug.

6

u/agent8261 Jun 23 '22 edited Jun 23 '22

Absolutely the best advice I've ever read. Bravo Sir. Bravo!!

Like are you psychic, because you are reading my mind. I can't find a single point that I disagree with.

complexity bad

complexity very bad

complexity very, very bad

Yes. A million times yes.

6

u/Matheusbd15 Jun 23 '22

Also if grug thinks erlang is too weird grug should check out elixir

3

u/Weak-Opening8154 Jun 23 '22

That's funny but are people relating or cringing at grug?

19

u/_htmx Jun 23 '22

grug say: know what most cringe?

worry if cringe

8

u/falconfetus8 Jun 23 '22

Relating, I would hope.

4

u/[deleted] Jun 23 '22

I highly relate.

1

u/art-solopov Jul 02 '22

A bit of both TBH. I like the message but the style gets old really quickly IMHO.

5

u/ZoeyKaisar Jun 23 '22

I like the intent but this is too hard to read. Can we get an English version, for people who got the joke after the first or second line?

64

u/ourlastchancefortea Jun 23 '22

take club

apply club to your big brain

become grug

understand grug language

8

u/danskal Jun 23 '22

Read it in grug's neanderthal voice. Makes it much easier to understand.

3

u/pastachef Jun 23 '22

That was hard to read

1

u/pcjftw Jun 23 '22

first blub now grug?

1

u/falconfetus8 Jun 23 '22

Blubble sort

-1

u/somebodddy Jun 23 '22

I find it fitting that Grug considers complexity a demon. The thing with demons, is that demons are not real. Like all superstitions, maybe the original belief that started it was an actual issue (I suppose it makes sense to worry about black cats when your village has a conflict with some nearby panthers), but the knowledge got so deformed over the generations that heeding it is a waste of time and effort at best and in some cases actually damages self and others.

Code complexity is not millennia old, and the root idea is yet to be lost in time, but it has already begone the transformation to superstition. You don't need to explain why an idea is complex or why it'd be hard to work with - just yell "heresy!" "complexity!" and anyone who disagrees is not taking their job seriously and just tries to overengineer everything because they enjoy complexity for complexity's sake.

Complexity for complexity's sake is indeed bad, but this is not usually the case. Certainly not as often as the Simplicity Sect claims. John von Neumann once said:

“If people do not believe that mathematics is simple, it is only because they do not realize how complicated life is.”

Code complexity is often about addressing real problems. Could there be simpler solutions? Maybe. But simplicity advocators don't want to find a simpler solution that also works - they want to pretend that the problem does not exist, or at the very least that having some complexity in the code is so much worse than having an unsolved problem in your product.

Of course, once actual users actually use the software and complain about the actual problem, you are going to need to solve it anyway - with less time, without the privilege of properly designing it before writing code, and bounded by all the restrictions the "simple" solution inflicted across the code the uses it and external dependents that rely on its behavior.

The end result usually turns out so much worse and so much more complicated than the initial "complex" approach...

I've even witnessed this happen several times during refactors, when the problem being ignored is something that happened in the original version. I think when that happens, you can't just yell "YAGNI!" - the burden of proof is on you to show why it's no longer a problem even though you do nothing to address it. And no - "We upgrade to .NET 3.0 which probably manages memory better so our severs won't crash anymore even though this new version is still modifying huge XMLs with string concatenation and even does it more times per request than our old version" does not cut it. Sorry. Do better.

22

u/snarfy Jun 23 '22

big brain comment, reaching for club

19

u/[deleted] Jun 23 '22

I find it incredibly ironic how many words you had to use to explain that complexity isn't bad.

5

u/somebodddy Jun 24 '22

Funny how much effort opinions take to convey when one can't just smack the adversary with a proverbial club.

2

u/[deleted] Jun 24 '22

...I had to read your sentence 3 times to understand what you were saying.

You are not good at simple communication. I see why you love complexity.

5

u/Ahhmyface Jun 23 '22

Big brain overconfident understand shape problem before finding problems. Reach club, teach self. Assume grug humility. Easy more club complex problem demon when first see than than ride complex problem spirit whole time.

1

u/somebodddy Jun 24 '22

Bold of you to assume people only ever cry "simplicity!" and "YAGNI!" before the problem becomes visible and starts to hurt...

-10

u/jmat83 Jun 23 '22

This has to be the cringiest thing I’ve read on this sub in a while, and that includes articles written by people who have absolutely no clue what they’re talking about but write articles complaining about things anyway.

-3

u/this-some-shit Jun 24 '22

Jesus Christ. It was funny for the first paragraph. You kinda get the sense the author is low key arrogant, hiding behind that stupid grug shit.

8

u/Franks2000inchTV Jun 24 '22

Big brain too heavy for laugh? It ok. Club make brain small.

-2

u/this-some-shit Jun 24 '22

He so funneh. Talk in weird way about thing I do for living. Ha ha.

No key insights. If hating this mean big brain then bar very low.

Ha ha.