|
of course people abstract stuff incorrectly. people make mistakes everywhere. one of the most common mistakes is not reusing code that should be reused. his claim is you cant know that code needs to be reused until you need to reuse it but of course that's retarded. I mean maybe its true for really weird poo poo, but for something like "create a user in the database" theres only one correct way to do that and if you aren't enforcing it through a central entry point to the db (which you should and which is code reuse) you should be enforcing it through a shared data library. If user creation changes in the future, every application that uses that shared code needs to be updated. Not because you made a mistake in reusing code, but because there is only one correct way to create a user and it has changed.
|
# ? Aug 7, 2018 18:18 |
|
|
# ? May 20, 2024 04:43 |
|
i take tef's point to be roughly the same as mine: 1) your code is exactly as reusable as your abstractions are, and 2) you should never design your abstractions to facilitate your code.
|
# ? Aug 7, 2018 18:21 |
|
tef posted:i am also arguing with gimmick posters so tef posted:perisitent unbounded queues are a mistake
|
# ? Aug 7, 2018 18:21 |
|
Shaggar posted:of course people abstract stuff incorrectly. people make mistakes everywhere. one of the most common mistakes is not reusing code that should be reused. his claim is you cant know that code needs to be reused until you need to reuse it but of course that's retarded. I mean maybe its true for really weird poo poo, but for something like "create a user in the database" theres only one correct way to do that and if you aren't enforcing it through a central entry point to the db (which you should and which is code reuse) you should be enforcing it through a shared data library.
|
# ? Aug 7, 2018 18:33 |
|
Volte posted:"create user in database" is a fine abstraction. the hazardous abstraction would be something like "create Creatable in database" with the assumption that all Creatable can be implemented by filling in Blank A B and C abstract methods. that might feel nice in the same way it feels nice to put together a jigsaw puzzle but it is a nonsensical structural abstraction. these are the abstractions and instances of forced reuse that people have disdain for because it adds structural complexity without abstracting the underlying problem. i'd start with just "create user in database" too, but what about after i've written "create table in database", "create view in database", "create function in database" plus 10 more, and there is a bunch of code in each of them, and it's all the same except for the parts that would go in A, B, and C? do i abstract further at this point, or stop because it would be harder for someone who didn't go through the same exercise to initially understand? imo what i would probably do is use the additional abstraction to keep my code easier to maintain, but present a simpler interface without it, so the caller still just does "create user in database"
|
# ? Aug 7, 2018 18:39 |
|
Plorkyeran posted:either tef’s or my (or both!) experience with dealing with production systems is atypical it ain't you
|
# ? Aug 7, 2018 18:44 |
|
DELETE CASCADE posted:i'd start with just "create user in database" too, but what about after i've written "create table in database", "create view in database", "create function in database" plus 10 more, and there is a bunch of code in each of them, and it's all the same except for the parts that would go in A, B, and C? do i abstract further at this point, or stop because it would be harder for someone who didn't go through the same exercise to initially understand? "harder for someone who didn't go through the same exercise to initially understand" is not something that can be intuited by a priori anything. it is a creature of pure empirics presumably, you aren't working alone. even if you are working alone, you're working on a thing that takes a nontrivial amount of time if you're not working alone, you can literally go talk to someone and say, "i'm thinking of this abstraction. would this help you understand blah blah blah" if you are, then write down the possible abstraction you can make and then revisit it in a day or so and see if it's crap. you may also try the alleged traditional persian practice of looking at it once sober and once drunk
|
# ? Aug 7, 2018 18:48 |
|
DELETE CASCADE posted:i'd start with just "create user in database" too, but what about after i've written "create table in database", "create view in database", "create function in database" plus 10 more, and there is a bunch of code in each of them, and it's all the same except for the parts that would go in A, B, and C? do i abstract further at this point, or stop because it would be harder for someone who didn't go through the same exercise to initially understand? maybe you want to support different storage engines, at which point you would need to start modeling abstractions related to that, but i mean...i think that's what people talk about when they mean "over-abstraction". it's like an overfitting problem.
|
# ? Aug 7, 2018 18:48 |
|
code reuse for reuse's sake is real bad
|
# ? Aug 7, 2018 19:38 |
|
what a hot take!
|
# ? Aug 7, 2018 19:41 |
|
are your abstractions leaky? loose? failed? do you have a class body you want to show off on your blog, but you're afraid what other programmers might say? then we have just the product for you! 8 minute abstractions! That's right, folks: in just 8 minutes, you can tone, sculpt and DRY your code! and, if you call now, we'll throw in our latest hit, 8 minute monads! In just 8 minutes, you'll learn to lift, fold and reduce your code with no side effects! That's right! No obvious side effects! call now and you'll be showing off those function bodies just in time for the summer blog rush!
|
# ? Aug 7, 2018 19:45 |
|
Bloody posted:code reuse for reuse's sake is real bad code is real bad
|
# ? Aug 7, 2018 19:51 |
|
MALE SHOEGAZE posted:are your abstractions leaky? MALE SHOEGAZE is marriage material y'all
|
# ? Aug 7, 2018 19:56 |
MALE SHOEGAZE posted:The PL (Programming Language) thread: if you call now, we'll throw in our latest hit, 8 minute monads!
|
|
# ? Aug 7, 2018 20:04 |
|
talking to peeps or waiting for abstractions also helps you create fewer, riper abstractions pauca sed matura friendoes
|
# ? Aug 7, 2018 20:07 |
|
DELETE CASCADE posted:i'd start with just "create user in database" too, but what about after i've written "create table in database", "create view in database", "create function in database" plus 10 more, and there is a bunch of code in each of them, and it's all the same except for the parts that would go in A, B, and C? do i abstract further at this point, or stop because it would be harder for someone who didn't go through the same exercise to initially understand? setting aside the abstractions discussion, the specific case of creating tables, etc. programmatically shouldn't come up unless you're writing a (non-internal) orm or db management tools like ssms. and you probably aren't, so... Fiedler fucked around with this message at 22:32 on Aug 7, 2018 |
# ? Aug 7, 2018 20:14 |
|
fritz posted:code is real bad teaching sand to think was a mistake
|
# ? Aug 7, 2018 20:20 |
|
Shaggar posted:you said code reuse is bad which is retarded. you shouldn't force code that isn't reusable to be reused sure, but theres plenty of code that should be reused. Shaggar stop posting like an ableist piece of poo poo pls. I get talking past people is your gimmick but you can do it without sounding like king of the incels in the process.
|
# ? Aug 7, 2018 22:31 |
|
anyway like not that anyone cares but if you want the edited verison of my point https://programmingisterrible.com/post/176657481103/repeat-yourself-do-more-than-one-thing-and i literally wrote it down elsewhere
|
# ? Aug 7, 2018 22:47 |
|
jit bull transpile posted:Shaggar stop posting like an ableist piece of poo poo pls. I get talking past people is your gimmick but you can do it without sounding like king of the incels in the process. ?
|
# ? Aug 7, 2018 22:51 |
|
Stop using the R word as a pejorative, ding dong.
|
# ? Aug 7, 2018 22:54 |
|
Volte posted:"create user in database" is a fine abstraction. the hazardous abstraction would be something like "create Creatable in database" with the assumption that all Creatable can be implemented by filling in Blank A B and C abstract methods. that might feel nice in the same way it feels nice to put together a jigsaw puzzle but it is a nonsensical structural abstraction. these are the abstractions and instances of forced reuse that people have disdain for because it adds structural complexity without abstracting the underlying problem. yeah those are bad abstractions for sure. ORMs/entity layers promote that kind of bad abstraction and its a core reason why you should always avoid them.
|
# ? Aug 7, 2018 22:56 |
|
CPColin posted:Stop using the R word as a pejorative, ding dong. why?
|
# ? Aug 7, 2018 22:57 |
|
Shaggar posted:why? it makes you a dipshit
|
# ? Aug 7, 2018 22:59 |
|
ok
|
# ? Aug 7, 2018 23:00 |
|
Thank you.
|
# ? Aug 7, 2018 23:13 |
|
Ploft-shell crab posted:most of the hardons people have for code reuse and “abstraction” just go back to the usual focus on qualities of source code instead of qualities of artifacts that every dev seems to suffer from. we’ve somehow managed to convince developers their value to the business is the production of (“elegant”) code most developers are smart* people doing boring, repetitive work that is, at best, of net zero value to the world. there's nothing to take pride in in the product - is it any wonder they take pride in the code they write instead? * [citation needed]
|
# ? Aug 7, 2018 23:24 |
|
Shaggar posted:why?
|
# ? Aug 7, 2018 23:27 |
|
Shaggar posted:theres plenty of code that should be reused. in the compost sense, perhaps
|
# ? Aug 7, 2018 23:40 |
|
i have used a number of abstraction to good effect in my programming career not monads, tho. "this is actually a monad" is at best a curiosity
|
# ? Aug 8, 2018 00:36 |
|
redleader posted:most developers are smart* people doing boring, repetitive work that is, at best, of net zero value to the world. there's nothing to take pride in in the product - is it any wonder they take pride in the code they write instead?
|
# ? Aug 8, 2018 00:39 |
|
tef posted:anyway like not that anyone cares but if you want the edited verison of my point https://programmingisterrible.com/post/176657481103/repeat-yourself-do-more-than-one-thing-and i literally wrote it down elsewhere this is a good post thanks
|
# ? Aug 8, 2018 01:20 |
|
CPColin posted:R word is this like the N word but even worse?
|
# ? Aug 8, 2018 02:00 |
|
Max Facetime posted:is this like the N word but even worse? Why don't we just go with "all slurs are bad" and not be babies about it.
|
# ? Aug 8, 2018 02:18 |
|
it's a good article tef and good advice. not your fault if people who approach reuse on rigid ideological terms can't accept it
|
# ? Aug 8, 2018 03:01 |
|
Bloody posted:this is a good post thanks unlike in here, i tend to think before posting on my blog, usually
|
# ? Aug 8, 2018 03:03 |
|
i'm just literally mad 100% of the time, that's my problem
|
# ? Aug 8, 2018 03:04 |
|
fwiw; i'm aware that my experience is atypical, most people i know only burn out once, rather than five or six times depending on how you count it it's five times if you count the number of places where a doctor told me working there was physically destroying my body, it's higher if you count the jobs that have done that
|
# ? Aug 8, 2018 03:15 |
|
jit bull transpile posted:Why don't we just go with "all slurs are bad" and not be babies about it. because we don’t go all “ALL lives matter” about it either, now do we?
|
# ? Aug 8, 2018 03:16 |
|
|
# ? May 20, 2024 04:43 |
|
Max Facetime posted:because we don’t go all “ALL lives matter” about it either, now do we? Wtf are you doing
|
# ? Aug 8, 2018 03:18 |