Click here to Skip to main content
15,888,461 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Dear Apple, Why do you hate grandma? Pin
pkfox9-Apr-24 10:23
professionalpkfox9-Apr-24 10:23 
GeneralRe: Dear Apple, Why do you hate grandma? Pin
David O'Neil9-Apr-24 14:41
professionalDavid O'Neil9-Apr-24 14:41 
GeneralRe: Dear Apple, Why do you hate grandma? Pin
Jeremy Falcon9-Apr-24 16:01
professionalJeremy Falcon9-Apr-24 16:01 
GeneralRe: Dear Apple, Why do you hate grandma? Pin
David O'Neil9-Apr-24 16:36
professionalDavid O'Neil9-Apr-24 16:36 
GeneralRe: Dear Apple, Why do you hate grandma? Pin
Jeremy Falcon10-Apr-24 3:41
professionalJeremy Falcon10-Apr-24 3:41 
GeneralRe: Dear Apple, Why do you hate grandma? Pin
David O'Neil10-Apr-24 5:08
professionalDavid O'Neil10-Apr-24 5:08 
GeneralRe: Dear Apple, Why do you hate grandma? Pin
jochance10-Apr-24 5:16
jochance10-Apr-24 5:16 
GeneralLocality of Behavior: term you've been looking for Pin
raddevus9-Apr-24 4:06
mvaraddevus9-Apr-24 4:06 
I was watching a commentary video (Scams In Software Engineering[^]) by Primeagen (funny youtuber who really understands dev and comments on development ideas).

While watching that video he mentions:

“The primary feature for easy maintenance is locality: Locality is that characteristic of source code that enables a programmer to understand that source by looking at only a small portion of it.”
The behaviour of a unit of code should be as obvious as possible by looking only at that unit of code


This is actually something I have been interested in for a long time and why I wrote a recent article here on CP: Is Dependency Injection the Missing Technique That's Holding Your Career Back? [^]

In that article I discuss how that DI causes a redirection of code (lack of Locality Of Behavior) so bad that DI can be quite terrible.
Two Issues
1) Seeing a call to a method DoThatThing(), only to discover that the implementation is in an injected class that is in another assembly and then you have to jump into that assembly to even see what it is doing, is a terrible part about DI.
2) Added on top of that, you have to know how all of the associated classes work to understand how the small piece of code works.

EDIT
Also, this idea of getting Locality of Behavior could be a naive one also. Meaning that only simple problems can have simple code and advanced coding for larger systems may require more obscurity in the code due to necessity of DI, patterns etc.

What do you think?

modified 9-Apr-24 10:17am.

GeneralRe: Locality of Behavior: term you've been looking for Pin
Greg Utas9-Apr-24 5:04
professionalGreg Utas9-Apr-24 5:04 
GeneralRe: Locality of Behavior: term you've been looking for Pin
raddevus9-Apr-24 5:12
mvaraddevus9-Apr-24 5:12 
GeneralRe: Locality of Behavior: term you've been looking for Pin
Greg Utas9-Apr-24 5:18
professionalGreg Utas9-Apr-24 5:18 
GeneralRe: Locality of Behavior: term you've been looking for Pin
jochance9-Apr-24 9:10
jochance9-Apr-24 9:10 
GeneralRe: Locality of Behavior: term you've been looking for Pin
raddevus9-Apr-24 9:37
mvaraddevus9-Apr-24 9:37 
GeneralRe: Locality of Behavior: term you've been looking for Pin
Sander Rossel9-Apr-24 23:24
professionalSander Rossel9-Apr-24 23:24 
GeneralRe: Locality of Behavior: term you've been looking for Pin
raddevus10-Apr-24 1:59
mvaraddevus10-Apr-24 1:59 
GeneralRe: Locality of Behavior: term you've been looking for Pin
jschell10-Apr-24 12:07
jschell10-Apr-24 12:07 
GeneralQuestion about english Pin
Nelek9-Apr-24 1:00
protectorNelek9-Apr-24 1:00 
GeneralRe: Question about english Pin
Jo_vb.net9-Apr-24 1:30
mvaJo_vb.net9-Apr-24 1:30 
GeneralRe: Question about english Pin
Nelek9-Apr-24 2:32
protectorNelek9-Apr-24 2:32 
GeneralRe: Question about english Pin
GKP19929-Apr-24 2:09
professionalGKP19929-Apr-24 2:09 
GeneralRe: Question about english Pin
Nelek9-Apr-24 2:32
protectorNelek9-Apr-24 2:32 
GeneralRe: Question about english Pin
GKP19929-Apr-24 3:02
professionalGKP19929-Apr-24 3:02 
GeneralRe: Question about english Pin
Nelek9-Apr-24 5:30
protectorNelek9-Apr-24 5:30 
GeneralRe: Question about english Pin
RickZeeland9-Apr-24 2:29
mveRickZeeland9-Apr-24 2:29 
GeneralRe: Question about english Pin
Nelek9-Apr-24 2:32
protectorNelek9-Apr-24 2:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.