Submitted by trekhleb t3_xvum4n in InternetIsBeautiful
Comments
Beretta_errata t1_ir3nrbq wrote
Posted in 25 subreddits, probably his/her site.
RockstarArtisan t1_ir3wddm wrote
It does speak volumes about the quality of Martin's advice if many people get it wrong, don't you think?
IsntDoingScience t1_ir3wjjq wrote
As someone still in my first year of being a professional computer hammer, this is helpful to look at.
Eluvatar_the_second t1_ir40zyh wrote
Not sure what's so interactive about this, maybe it's because I'm on mobile but couldn't this have just been done with pictures?
DamagedFreight t1_ir42fiq wrote
I thought the same thing too. I think it’s purposely a tiny bit more difficult to glance at so you feel like you have to read it before going back to see the next one.
I think it does work but meh.
Cogadh t1_ir45y9u wrote
This was a great read, thank you! Separation of concerns, or rather lack thereof, has been the downfall of way too many orgs. Hurts thinking about all the times I've seen "unintended consequences"
Cogadh t1_ir4663c wrote
You're not wrong to ask it, but how many people are just as guilty of "skimming"? None of us ever have enough time, but patience to read thoroughly directly impacts comprehension
Ok-Farmer-2695 t1_ir482m8 wrote
polarphantom t1_ir4bvdm wrote
Shame that mobile responsiveness wasn't a principle for this site
PoorlyAttired t1_ir4d44q wrote
That's useful, though the example for interface segregation could be tweaked because I appreciate that both my laptop and phone are charged by USB-C.
itjy t1_ir4el2h wrote
You can click a link, very interactive!
[deleted] t1_ir4ep4n wrote
[deleted]
29979245T t1_ir4f3y2 wrote
It might be referring to the fact that the pictures are made in some kind of cute drawing engine that records every shape and penstrokes and allows them to be manipulated in a pretty intuitive way. So you could easily redraw part of one if you thought it was a bad explanation, for example...except they're locked in readonly mode and I don't even see a way to make a copy to play with.
daedalus91 t1_ir4ij0a wrote
I've read the article. Can you elaborate on why is OP's example wrong?
So according to the article, it's all about the people requesting the changes. Spoon users try to use that spoork, and they realize it's not deep enough to spoon a soup. The developer redesigns it, makes the spoork deeper to enable it to spoon a larger amount of soup. Then the fork people try to stick their vegetables onto their spoork, but now due to the increased curvature of the spoork, it isn't straight enough, and the vegetables will fall apart and won't stick onto the spoork.
If you create a separate spoon and a fork, each user has their perfect tool.
P12oooF t1_ir4qlou wrote
Great chapter in half life... which got me into computers in the 90s. Now I program.... MeTa!
Rwagstaff84 t1_ir4th5x wrote
Long time software developer and I get all these solid concepts but …. it doesn’t really change how I write code. I just write what I think is best based on experience. I never stop and think “does this meet the liskov substitution principle” or any of the other SOLID principles. Why is this brought up as the gold standard so much? Just seems like a way to claim you are a good coder because you “understand” solid. Is that just me? coding is so much more than just 5 generic concepts that you probably do almost always by default by following good patterns.
notmexicancartel t1_ir4ubbk wrote
Click on "Start drawing" and now you can build things interactively
trekhleb OP t1_ir4uskq wrote
Yeah, the interactivity is pretty minimal, but it is still there in form of "Click to go deeper to the nested image with further details".
You're also right that all illustrations could be put on one page. But with the current approach, there is a possibility to add more details to the nested pages (to each S O L I D letter separately) without making the entry page bulky.
trekhleb OP t1_ir4ve77 wrote
Yes, that's true that going back and forth not always convenient. I was trying to find this balance between "Staying focused on one principle at a time" and "Having all info be easily accessible at glance". Probably I didn't find the perfect balance yet :D
But, there is also the extensibility aspect. With the current approach, I may add more details to each letter in the future while keeping the entry page still readable. Technically it is possible to even add more nested sub-sketches to each letter if needed
trekhleb OP t1_ir4vocd wrote
Thanks for the feedback. Yes, currently the okso.app Showcase examples are served in a read-only mode. But this is a good idea to have the possibility to clone the current showcase and play with it locally in the browser. I've added it to the roadmap https://feedback.okso.app/
trekhleb OP t1_ir4w2ls wrote
I guess the illustration with the "Spoon" + "Fork" instead of the "Spoork" still works, doesn't it? I mean if you want to change the "Spoon" functionality you just change the "Spoon" but not touching the "Fork", whereas the "Spoork" is going to be changed for two different reasons: when we want to change either the "Spoon" functionality or the "Fork" one.
trekhleb OP t1_ir4w3jq wrote
Yes, you got me :D
trekhleb OP t1_ir4wr7e wrote
If you mean the "Fit to screen" zooming feature it is there (bottom right corner).
But if you're talking not only about scaling but also about re-arranging the sketch elements based on the screen size (in a classing web-app manner), then yes, it doesn't work.
This is a bit challenging to do for the free-hand drawing of absolutely-positioned and scaled elements since the app might not have enough context of how to re-arrange. I.e. there is a free-form arrow that goes from the exact word of the sentence to the exact Attachment of the Mixer (it is not clear how to redraw it from horizontal to vertical form-factor).
trekhleb OP t1_ir4x3qs wrote
Sorry to hear that.
There is a lot of work that needs to be done yet to make the app faster and more stable, yes.
Lampshader t1_ir4x3tr wrote
> 5 generic concepts that you probably do almost always by default
You probably do. I assure you that not everyone does, and giving these concepts names and descriptions is a good way to teach those who don't just intuitively "get it"
Beretta_errata t1_ir4xba6 wrote
I am surprised this account is not a bot.
trekhleb OP t1_ir4xj7s wrote
Nah, this is just my, probably perverted, way of sharing the info
Beretta_errata t1_ir50ifk wrote
Busy, busy, busy, is what we Bokononists whisper whenever we think of how complicated and unpredictable the machinery of life really is.
trekhleb OP t1_ir50p7e wrote
Yes, that “double-click” not user-friendly. I need to change that 👌🏻
[deleted] t1_ir52429 wrote
[deleted]
RockstarArtisan t1_ir52lwr wrote
This is not a programming subreddit, but I assume you're familiar with the subject.
The job of a book author and advice merchant is to convey their advice in a manner that people can follow. People who are bad at this shouldn't be selling the advice. In this case, the problem isn't the writing style, it's just that there's nothing behind it.
Have you seen how "principled" this principle is? The author struggles to come up with the description himself. In his videos he says stuff like "Single responsibility principle is actually not about single responsibility, it's about a single reason for change" (I guess he did change his blog to say it's both now). This is the vaguest shit possible. Basically, Martin is a boomer consultant, who makes up acronyms to sell his shit. He needed some rules to make a nice acronym, so he picked 5 things arbitrarily, one of these happened to be "make stuff simple, not complicated". This is clearly meaningless padding, so he needed to convert this rule to be something that people will think is insightful - he came up with "single responsibility" which is the same non-advice, just with more plausible deniability.
I'm tired of having to write the same shit over and over again whenever another person get's caught up in this and posts on the programming subreddits about it so here's my latest brief description: https://old.reddit.com/r/programming/comments/xvu3gc/solid_principles_sketches/ir3uhyx/
DramaticChipmnk t1_ir531r8 wrote
r/UnexpectedVonnegut
RockstarArtisan t1_ir53gm6 wrote
No, there's just no insight in the principle whatshowever (see my other comment in this thread). This is engineering, not bible studies, if you need to repeat the wording exactly for it to sound convincing, there's probably an issue with the advice.
Ok-Butterscotch-6829 t1_ir56t5n wrote
This is actually really helpful. I’m starting to interview again and want to be able to intelligently answer using SOLID principles.
Ok-Butterscotch-6829 t1_ir572rd wrote
How so? Seems like it makes sense to me.
Ok-Butterscotch-6829 t1_ir57i4x wrote
It’s probably your phone/wifi/data because it’s running fine for me
RockstarArtisan t1_ir57u2i wrote
There're reasons why this got upvoted in a nonprogramming subreddit and downvoted in r/programming :P
rainindrain t1_ir59748 wrote
Clickable links are already here!? I must be living in the past.
i_got_skrimps t1_ir5axyw wrote
I like it. I think people are getting hung up on interpretation and semantics here. It's a great site.
TheBeardofGilgamesh t1_ir5bvia wrote
Ah yes uncle Bob a guy who has not done any software development in decades is the perfect person to listen to.
Ok-Butterscotch-6829 t1_ir5c4cc wrote
Why was it downvoted there? I thought SOLID was accepted as good practice in OOP?
TheBeardofGilgamesh t1_ir5c9yr wrote
Worst code based I have ever encountered where people with a Clean Code book on their desks. Uncle Bob has no real experience in software development he just does the conference circuit and gives lectures.
AndrewZabar t1_ir5em70 wrote
They finally did it. The sons of bitches.
AndrewZabar t1_ir5f0q6 wrote
Hisssssssssss! You work for Black Mesa!
Smiffsten t1_ir5ivr5 wrote
Is it? What is your take on it?
klesus t1_ir5kc37 wrote
So if there's more than one reason to change a module then you shouldn't change it?
RockstarArtisan t1_ir5q7om wrote
Well, it is widely known and established, but many people disagree about being good. Some of the advice is applicable in the context of a framework, but the author insists it should be used everywhere which results in bloated designs that people hate. The popularity of this in the Java community is mostly what's responsible for all the hate Java gets online - bloat, overabstraction, complicated designs exemplified by the most SOLID frameworks of them all - Spring - with it's AbstractSingletonProxyFactoryBean https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/aop/framework/AbstractSingletonProxyFactoryBean.html
jobe_br t1_ir5rts1 wrote
The analogy is gonna be strained, but the real problem is the way SRP is stated as “only one potential change in the software’s specification” - this is not person centric. The way OP started this is more the way SRP was initially misinterpreted as a module should do one thing and only one thing. That’s actually more the Unix cli philosophy of “do one thing and one thing well” — but it’s not SRP.
Internally, we don’t try to pre-determine if a module follows SRP, we use actual changes being made to the system to identify modules that are changing as a result of different actors/people. We then refactor a module to split it so that it once again is aligned to one axis of change.
Ok-Butterscotch-6829 t1_ir5rulv wrote
Good to know thanks
TheGerk t1_ir5sa78 wrote
Yeah. Maybe I just have a bone to pick, but I've always thought solid was pretty awful programming. There's some good ideas in there, but largely I've seen this make code bases worse.
jobe_br t1_ir5slha wrote
You’re going to have a strained analogy either way, but you might be able to come up with something that is more person centric. Your analogy focuses on the functionality of the spoon, fork, and spork, not the person’s needs - I could argue that a single person’s concerns are encapsulated by the spork, and as such it doesn’t need to be split up. Realistically, the existence of the spork gives credence to this - it wouldn’t exist if a separate spoon and fork were superior for all user needs.
Definitely change the text, though, either way.
jobe_br t1_ir5ssti wrote
I’m not gonna defend Uncle Bob, but I’d advise against attacking his technical mettle, personally.
jobe_br t1_ir5t25l wrote
Is what?
jobe_br t1_ir5t5df wrote
You’ll want to read the article I linked in full.
billwoo t1_ir6bnxc wrote
Its web 4.0
ghostryder333 t1_ir6d7b7 wrote
I don't want to come off as offensive, but I believe if you don't just "get it" intuitively when writing code you're not gonna be able to work in the industry.
After all you still want to be able to read your code as it grows. You codebase will become more complex with each passing day, and if you don't actually get an intuitive grasp on how to structure things you'll become unable to maintain your code pretty soon.
billwoo t1_ir6d8tw wrote
Don't overdo it. I guess it depends what sort of company you are applying to, but describing every answer in terms of SOLID will make it sound like you just discovered SOLID and think its the answer to everything.
Ok-Butterscotch-6829 t1_ir6ds9t wrote
There’s so much conflicting advice in programming I don’t know who and what to believe anymore. 🤷♂️ It seems to me that much of the time it’s just programmer’s own opinions. 🤷♂️
billwoo t1_ir6e306 wrote
Well we can ignore what the author insists on, and just use them as handy short hands for describing architecture decisions. All the principles are sound architectural advice without further context, but software design is mostly striking a balance between pragmatism and "perfect" architecture (extensibility, generality, low coupling etc.). That some Java libraries get that wrong isn't really evidence that "SOLID is a bunch of bs".
Only things that nobody uses don't get complained about.
billwoo t1_ir6expy wrote
Experience is the only thing that will really make you a good programmer. Until you get it, don't over commit to principles. There IS no golden bullet, or perfect paradigm.
mouse_8b t1_ir6q00h wrote
If it's your only book, yeah it's lacking. It doesn't teach how to be a good developer. But as a self-taught coder, having a reference like that was useful to increase my code quality and readability.
mouse_8b t1_ir6qkll wrote
You figured it out. There are so many aspects of software to balance, that it depends on what you are focused on as to what the best way forward is. And in many cases it's not the best, just good enough.
TheBeardofGilgamesh t1_ir7227x wrote
It’s less his technical ability that I question, it’s his advice for designing maintainable code bases. How can someone who has not worked on large code bases or large teams have the experience of trail and error know how well his methods work in practice. It’s like if a person wrote a book on commanding an aircraft carrier yet has no experience in the navy.
TuringC0mplete t1_ir752yi wrote
I preach SOLID pretty hard, but I think after a certain point it just becomes second nature and a "Yeah, that's just how you do it" kind of mindset. Not all of these principles are applicable to every scenario, but for the most part they're a good guide to writing clean code. Some languages don't even have interfaces to do a lot of SOLID things with (looking at you, python -.-)
But I agree that just because you understand the concepts doesn't mean you know how to affectively apply them. Hell, even for preaching them so much, the architect on my team explained to me a few months ago how I was using LSP completely wrong.
Ultimately to me, it's a great teaching tool; but you definitely need to know when to apply it.
draculamilktoast t1_ir764mj wrote
This would have been better as a single image.
feinerSenf t1_ir789ad wrote
Hi what library are you using for the free drawing implementation?
trekhleb OP t1_ir78nkf wrote
Adverpol t1_ir7d6pw wrote
The thing is that if you focus on solid it's easy to forget that often you shouldn't have had inheritance in the first place, that's my problem with it anyway. OOP is a tool that should be used when appropriate, which for me means when you actually need polymorphism e.g. store a list of different types of entities in a list.
NerdFoundryGaming t1_ir7dsj8 wrote
I found this UI to be very difficult to navigate.
It'd be better off as a proper slideshow. Literally no reason to have a weird breadcrumb navigation with movable entities on screen that serves no purpose other than to confuse the user as to what is even going on. Also, really hated the font used.
But the content was simple and decent.
Lampshader t1_ir7dvlc wrote
It's definitely possible to learn and internalize new things.
jobe_br t1_ir7jihx wrote
Tell me you don’t know his work history without telling me you don’t …
Once you’ve written as much code as he has, check back.
ImTheTechn0mancer t1_ir7nrku wrote
>good practice in OOP
A vacuous statement because OOP is not a good practice.
feinerSenf t1_ir91koi wrote
Nice i was trying to get this to work a while back but I did not manage to finalize. Did you create an react app in the end?
trekhleb OP t1_ir98mf5 wrote
Yes, I’ve made it in React. So, for free-hand drawing I was using the perfect-freehand library above, and for the “canvas” I used tldraw/core https://www.npmjs.com/package/@tldraw/core
Ok-Butterscotch-6829 t1_ir9wbvh wrote
Well, I kept seeing SOLID come up for interviews and what not but it sounds like many programmers dislike it.
ImTheTechn0mancer t1_ir9xyp1 wrote
Of course! Companies love acronyms and buzzwords. SOLID! CRUD! Synergy! Bobody!
They make the business-oriented folks feel like they know what they're talking about with the senior devs.
jobe_br t1_ir3gb60 wrote
Cool, but they got SRP wrong (as many do) -
> The Single Responsibility Principle (SRP) states that each software module should have one and only one reason to change.
See https://blog.cleancoder.com/uncle-bob/2014/05/08/SingleReponsibilityPrinciple.html for more.
Edited: removed “you” - not sure if this is OP’s site.