|
i tried reading it but I’m pretty sure “uncle” bob martin hasn’t written production code since the tracy ullman simpsons. just terrible
|
# ? Dec 31, 2021 09:59 |
|
|
# ? May 5, 2024 22:26 |
|
it is kind of outdated going by the section "functions should do one thing", which seems like good advice, but he is thinking of avoiding functions that do *multiple* things, where the 2021 typical problem is rather functions/classes/proxies/abstractions that do zero things.
|
# ? Dec 31, 2021 10:46 |
|
BEAUTIFUL CLEAN CODE, JUST THE BEST
|
# ? Dec 31, 2021 11:37 |
|
here is the only clean code in existence, penned right here for you to witnesscode:
|
# ? Dec 31, 2021 15:51 |
|
the above code is released copyright YOSPOS under the affero gnu public license version 8
|
# ? Dec 31, 2021 15:52 |
|
Cybernetic Vermin posted:it is kind of outdated going by the section "functions should do one thing", which seems like good advice, but he is thinking of avoiding functions that do *multiple* things, where the 2021 typical problem is rather functions/classes/proxies/abstractions that do zero things. why just call a function that returns a result when you can have a big 'ol CQRS gateway call it for you??
|
# ? Dec 31, 2021 16:41 |
|
my favorite is when developers write all these abstractions to make automated testing possible but don't write any automated tests that benefit from it. then when you try to test it you find out the abstractions are kind of busted anyways.
|
# ? Dec 31, 2021 16:43 |
|
here is the only clean code:code:
|
# ? Dec 31, 2021 17:20 |
|
at my first programming job the boss once herded us into the meeting room for a "lunch and learn" where he played a recording of a conference talk uncle bob gave. literally the first 20 minutes or so were him going on some kind of strange tangent about how you have two parents, and four grandparents, and eventually there's a generation of your ancestors that is bigger than the total number of people alive at the time, isn't that weird? this didn't lead anywhere, that was actually how it concluded. the good blog post: https://qntm.org/clean
|
# ? Dec 31, 2021 17:40 |
|
Truman Peyote posted:
what, you don’t like “public class SetupTeardownIncluder”
|
# ? Dec 31, 2021 18:50 |
|
I'm disappointed this thread was posted in satire of the clam code thread, wth guys this isn't even funny
|
# ? Dec 31, 2021 19:18 |
|
iirc uncle bob also endorses doing "code kata," or typing out the same simple programs over and over in order to practice typing for loops and variable definitions
|
# ? Dec 31, 2021 20:14 |
|
And we then did the war on clean, beautiful code, and we are putting — and you see it better than almost anybody — our coders. They’re all back to work, and they’re going back to work. Clean code, clean code. Nobody thought that was going to happen so fast, either. I just left San Francisco, and I looked at those trains and they’re loaded up with clean code — beautiful clean code.
|
# ? Dec 31, 2021 20:31 |
|
Truman Peyote posted:iirc uncle bob also endorses doing "code kata," or typing out the same simple programs over and over in order to practice typing for loops and variable definitions he endorses a lot of terrible ideas, and not just terrible programming ideas
|
# ? Dec 31, 2021 21:32 |
|
Truman Peyote posted:iirc uncle bob also endorses doing "code kata," or typing out the same simple programs over and over in order to practice typing for loops and variable definitions For a good laugh, read the first chapter of Clean Architecture. He has someone do this with a Roman numerals serializer, writing out the same trivial function once per day for six days, alternating between TDD and non-TDD, in order to demonstrate that TDD is faster. TDD does indeed work out to be about 5 minutes faster, because after six days it's taking the guy ~20 minutes to write his function out with TDD, versus ~25 without.
|
# ? Jan 1, 2022 03:35 |
|
code katas are the sort of thing i would expect someone who has spent a lot of time talking to programmers but very little time actually themselves programming to come up with. the basic premise does kinda make sense: the most effective way to be able to solve a problem quickly is to have already solved it before, so practicing solving a wide variety of problems could potentially be useful? the actual problems that people propose solving for practice seem completely worthless and potentially counterproductive. doing the same one-hour task in five different ways might help you learn which approach is best for that sort of one-hour task, but that's unlikely to also be the best approach for something nontrivial. most of the time you'll have just spent five hours doing nothing useful and learning nothing. i've also seen people use the term "code kata" for timeboxed rabbit holing where you dive into something that you don't expect to be directly worth the time you spent on it, but you hope that you'll learn something useful in the process. this seems like a completely different idea to me and i dislike that it sometimes gets conflated.
|
# ? Jan 1, 2022 08:19 |
|
he’s like this peddler of vitamins that skew every problem as being solvable by taking vitamins. it’s technically correct but the impact is no where near what he promises. like, yeah, writing tests is good and can help when done properly but have you seen a bad test suite? it’s a black hole of productivity since no one trusts the test yet the devops god requires his coverage blood tithe so everyone puts in nonsense tests.
|
# ? Jan 1, 2022 11:30 |
|
i have never been even tangentially involved in a project where tdd was very successful, and to my eyes at least it always seems to create a vast number of tests at the wrong level of granularity. i.e. unit testing functions (or tiny classes) in isolation failing to reveal anything but the most trivial bugs you're very likely to find anyway, where in my experience the hard to find, subtle, and dangerous are ones of composition/layering. at the very least if unit tests get written at the *expense* of functional tests with a side of random testing/fuzzing then i think it is a bad idea.
|
# ? Jan 1, 2022 11:47 |
|
|
# ? Jan 1, 2022 12:13 |
|
one of the benefits of only writing code where it's reasonably expected that if someone gets arbitrary access to it they've already ruined all layers of security is that I don't have to wonder "what happens if a user sneezes on the fourth of march at 18:33:19 UTC when jupiter is in retrograde" and other insane frontend testing poo poo. if you've broken through everything and entered kernel mode then to say that you've won is an understatement
|
# ? Jan 1, 2022 13:02 |
|
Truman Peyote posted:the good blog post: https://qntm.org/clean was going to post this, thanks for saving my time
|
# ? Jan 1, 2022 20:43 |
|
why does he want us to call em uncle? thats weird as hell
|
# ? Jan 1, 2022 21:03 |
|
Cybernetic Vermin posted:i have never been even tangentially involved in a project where tdd was very successful, and to my eyes at least it always seems to create a vast number of tests at the wrong level of granularity. i.e. unit testing functions (or tiny classes) in isolation failing to reveal anything but the most trivial bugs you're very likely to find anyway, where in my experience the hard to find, subtle, and dangerous are ones of composition/layering. it’s the functional tests that get out of hand and become useless the fastest. eventually people are just asserting that no exceptions are thrown… ignoring and forgetting about all the side effects involved. the problem with unit tests is that people don’t understand what makes code easy or hard test. The purpose of unit tests for me is to be able to be able to have more confidence that my building bricks are stable, and my functional tests can focus more closely on the overall structure. that being said, Tests First has NEVER worked for me.
|
# ? Jan 1, 2022 23:16 |
|
TDD works pretty well in interviews.
|
# ? Jan 1, 2022 23:28 |
|
MrQueasy posted:that being said, Tests First has NEVER worked for me. its also great when you've got a bug and want to prove that you've reproduced, understood & fixed it, but that tends to be more functional/integration level
|
# ? Jan 2, 2022 01:28 |
|
being a 150 wpm wonder at typing your well practiced function doesn't make the code any better.
|
# ? Jan 2, 2022 01:59 |
|
|
# ? May 5, 2024 22:26 |
|
faster typing = faster execution speed, duh
|
# ? Jan 2, 2022 02:20 |