Thread 105997192 - /g/ [Archived: 34 hours ago]

Anonymous
7/23/2025, 11:39:01 AM No.105997192
golang
golang
md5: 2662cdfc565169f858932f5c2ef8dc29🔍
>having a fight with teammates
>they want to use prefix/suffix "I" to name interfaces in Go
>I am against it because it doesnt make sense to mix subhuman patterns into already superior and clean Go
god damn fucking Java and C# subhumans I swear
why do they do this?
Replies: >>105997359 >>105997396 >>105997464 >>105998136 >>105998274 >>105998286 >>105998506 >>105998557 >>105998651 >>105998755 >>105999109 >>106000387 >>106001405 >>106003061 >>106003842
Anonymous
7/23/2025, 11:58:04 AM No.105997292
>interface Foo {}
>class FooImplementation {}
Replies: >>105997445 >>105998755 >>105998840
Anonymous
7/23/2025, 12:00:37 PM No.105997301
Inheritance should be banned. Interface should be the only option. Problem solved.
Anonymous
7/23/2025, 12:11:52 PM No.105997359
>>105997192 (OP)
The problem with Go is that nobody bothers to learn the idioms, so every code base I've worked on is just ported from Java and it's pure shit. These design patterns don't work well with Go at all, so it's like: what was the point? I fucking hate indians, man.
Replies: >>105997421
Anonymous
7/23/2025, 12:22:11 PM No.105997396
>>105997192 (OP)
A type is not an implementation

Interface IFoo
Type Foo
Anonymous
7/23/2025, 12:29:33 PM No.105997421
>>105997359
and these fucking indians are bombarding me with articles and blogposts and docs from the web as to prove me wrong I guess? i dont get it
they cling to blogger authority
should i make an article how I dont agree with their shit and they will they accept it? is this how NPC brain work?
Replies: >>105997733
Anonymous
7/23/2025, 12:35:20 PM No.105997445
>>105997292
Dealing with this shit is my life, and I don't get paid enough, and I am going to quit soon.
Anonymous
7/23/2025, 12:38:01 PM No.105997464
>>105997192 (OP)
link them the recommended golang practices and they will abide
Anonymous
7/23/2025, 12:45:43 PM No.105997512
ok Go people, but how do I then differentiate between a struct and interface just by looking at a function or whatever?
Anonymous
7/23/2025, 12:52:53 PM No.105997546
>using interfaces instead of discriminated unions
ngmi
Anonymous
7/23/2025, 1:15:58 PM No.105997678
Just the fact that you have the neural pathways that conjure up the words for "subhuman" and "teammate" so closely connected in your brain says it all anon. You're an arrogant retard and your sense of superiority is unwarranted
Replies: >>105997970 >>105998402
Anonymous
7/23/2025, 1:23:43 PM No.105997733
>>105997421
Link them the official docs
https://go.dev/doc/effective_go#interface-names
Replies: >>105997970
Anonymous
7/23/2025, 1:59:41 PM No.105997970
>>105997733
that doc is only for one-method interfaces subhuman
>>105997678
>t.subhuman
Replies: >>105998243
Anonymous
7/23/2025, 2:19:44 PM No.105998136
>>105997192 (OP)
>god damn fucking Java and C# subhumans I swear
>why do they do this?
the convention predates Java and C#, you absolute mouthbreather.
it comes from C++, where there are no "interfaces", only classes, thus the need for the prefix.
Anonymous
7/23/2025, 2:31:55 PM No.105998243
>>105997970
No it's not jeet.
It's for describing what the interface does by appending -ER at the end
ClientManagER
MessageRoutER
EventHandlER
Anonymous
7/23/2025, 2:34:22 PM No.105998268
For quicker readability and distinction especially when browsing massive codebases. Isn't hard to do at all you're just a prick.
Replies: >>105998412
Anonymous
7/23/2025, 2:34:38 PM No.105998274
29d09b463db7ef73c8d636abeae94565
29d09b463db7ef73c8d636abeae94565
md5: eb5a720d278d39852704eb1ccbfa1d26🔍
>>105997192 (OP)
>Rust's type system filters OOJeets
>tfw as a Rust programmer I don't have to deal with this retardation
I won.
Replies: >>105998769 >>106000673
Anonymous
7/23/2025, 2:35:21 PM No.105998286
>>105997192 (OP)
>be jeet
>britishers introduce railways and electricity
>seethe at them
this is literally gojeets at every other language lmao
Anonymous
7/23/2025, 2:50:18 PM No.105998402
>>105997678
he is right though.
Anonymous
7/23/2025, 2:51:48 PM No.105998412
>>105998268
>For quicker readability and distinction especially when browsing massive codebases.
YOU DUMB FYUCKING NIGGER THERE WAS NEVER A POINT IN YOUR LIFE WHEN THAT DISTINCTION EVER MADE ANY MEANINGFUL DIFFERENCE IT DOES THE EXACT OPPOSITE BY MAKING EVERYTHING UGLIER AND HARDER TO READ STOP SHITTING UP MY CODEBASE REEEEEEEEEEEEEEEEEEEEEEE
Replies: >>105998535
Anonymous
7/23/2025, 3:03:08 PM No.105998506
>>105997192 (OP)
Pick your battles and make compromises to build goodwill.
Naming conventions are rarely a hill worth dying on. Let your teammates have their way and fight for more important things.
Anonymous
7/23/2025, 3:06:21 PM No.105998535
>>105998412

Incorrect and this is exactly what I mean, you're a narcissist that can't understand other perspectives. "Readability" is general, for all engineers that touch the codebase, not just yourself. And you personally aren't that good at it you just posture because your entire ego is predicated around being "the most special engineer" that doesn't have any use for all of the practical conventions the larger industry has created.
Replies: >>105998595
Anonymous
7/23/2025, 3:09:10 PM No.105998557
>>105997192 (OP)
>Gotards seething for no reason when others want to use sensible naming patterns
Anonymous
7/23/2025, 3:13:23 PM No.105998595
>>105998535
no u fucking moron there was never a point in your life where the distinction between a class or an interface on the name ever mattered
>oh so this is an interface and not a class good that someone put this ugly "I" there now i saved myself an incredible amount of time and will have to rethink my entire approach
said no one ever

NAMES ARE HOLY
DON'T FUCK WITH NAMES
god fucking damn it i hate you more than you can imagine fucking up an entire codebase because your stupid ass is apparently still coding in the notepad text editor. if you want to smear your dumb mind smegma all over the code do it on YOUR OWN END AND DON'T FUCK WITH THE NAMES
Replies: >>105998611
Anonymous
7/23/2025, 3:15:55 PM No.105998611
>>105998595

Of course there is, this isn't even a debate in normal SWE circles. You're a pedantic moron. When you're working with both classes and interfaces you don't want them to share names.
Replies: >>105998669
Anonymous
7/23/2025, 3:20:28 PM No.105998651
>>105997192 (OP)
>starting interfaces with I
>starting private vars with _
This shit is carried over from languages where an lsp/type system didn't save you and you had to encode what the type/var was meant for in it's name
Unless you are working in a legacy codebase there is no reason to do this shit in a language that actually supports these features
Anonymous
7/23/2025, 3:22:57 PM No.105998669
>>105998611
i'm sorry i can't help you anymore. i don't care if some old farts just mindlessly repeat things that make no sense anymore. if you want the distinction between a class and an interface then you can install a plugin that makes the screen rapidly flash whenever there are both classes and interfaces on your screen BUT DON'T FUCK WITH THE NAMES. SERIOUSLY. names are the most important thing in code and you don't fuck with them for no reason.

you are suggesting to deface an entire code base because you're even too lazy to simply hover over the relevant name and have your ide tell you EXACTLY what kind of thing you're dealing with. jesus christ.

also think for yourself chucklenut. even if turns out you're wrong you at least learned something. you'd be surprised how many times people are simply doing nonsensical stuff and no one ever questions it because they think it makes sense. you don't have to change the world but please stop fucking with names.
Replies: >>105998698 >>105998722
Anonymous
7/23/2025, 3:25:55 PM No.105998698
>>105998669

>don't add a single letter to create a quick and easy distinction anon just hover over it every single time and wait for the IDE to tell you

Do you fucking listen to yourself? This is why you're unemployed faggotron
Replies: >>105998714
Anonymous
7/23/2025, 3:28:49 PM No.105998714
>>105998698
install a plugin to color code it or have it add your favorite letter on your screen. we have the technology my man. it's like the distinction between view and model. the model is the code shared by everyone and the view is your local copy. you can even start adding letters to your variables that tell you about their types like "sName" and "iNumber". i know you'd like that you sick fuck
Replies: >>105998751
Anonymous
7/23/2025, 3:29:42 PM No.105998722
>>105998669
so like what do I propose to my mental teammates how to name their structs and how to name their interfaces without using the fucking golem "I"
Replies: >>105998729
Anonymous
7/23/2025, 3:30:33 PM No.105998729
>>105998722
sorry i only deal with high level languages. i guess if you want to program a toaster it doesn't really matter either way
Replies: >>105998749
Anonymous
7/23/2025, 3:31:47 PM No.105998746
Why are you coding in a dying language? Python is the way to go.
Anonymous
7/23/2025, 3:32:11 PM No.105998749
>>105998729
but Go is a high level language jeetoid zoomer
Replies: >>105998803
Anonymous
7/23/2025, 3:32:14 PM No.105998751
>>105998714

>just get this IDE and then install this plugin and then add this other decoration

Or just add an "I" like everyone always does because it's extremely easy simple and quick to mentally parse, you're spiraling now
Replies: >>105998803
Anonymous
7/23/2025, 3:32:54 PM No.105998755
>>105997192 (OP)
>>105997292
Scala needs none of this niggerlicious nonsense

trait Foo {
val bar: String = "xyz"
}
object Foo extends Foo
Anonymous
7/23/2025, 3:35:14 PM No.105998769
>>105998274
Im considering transitioning to become a rust sister. AI can't into Rust and neither can jeets. maybe the trannies were right all along?
Anonymous
7/23/2025, 3:39:30 PM No.105998803
>>105998749
tell them then to name their totally-not-classes and their interfaces like their actual function. you can maybe even have a noun-adjective separation where a class is a noun and an interface is an adjective. like "Car" and "Driveable".

>>105998751
fuck off i don't care about the opinions of plebs. go to your job, collect your paycheck and shut the fuck up. i'm actually having fun
Replies: >>105998811
Anonymous
7/23/2025, 3:41:10 PM No.105998811
>>105998803

>I'm having fun!!!!

Uh huh, whining about naming conventions as if that's a serious issue in our space
Replies: >>105998828
Anonymous
7/23/2025, 3:43:14 PM No.105998828
>>105998811
>our space
hahahahahaha

anyway naming is the most important thing and i'll leave it at that
Anonymous
7/23/2025, 3:44:42 PM No.105998840
IMG_6891
IMG_6891
md5: ca3fe2676e97bb252ce1d3634665a807🔍
>>105997292
>interface FooRepository extends FooRepositoryCustom
>class FooRepositoryImpl implements FooRepository
>interface UnsafeFooRepository extends UnsafeFooRepositoryCustom
>class UnsafeFooRepositoryImpl implements UnsafeFooRepository
Replies: >>106000335
Anonymous
7/23/2025, 4:22:32 PM No.105999109
>>105997192 (OP)
I want to learn some Go, but I have been focusing my time on learning Java instead. Java is not that bad once you get used to it. Hearing about the Go idioms has me interested. Also, its popularity in China.
Replies: >>105999114
Anonymous
7/23/2025, 4:23:08 PM No.105999114
>>105999109
love me some Go
Replies: >>106000335
Anonymous
7/23/2025, 4:43:23 PM No.105999288
Foo_Interface
-- or package
Foo_Interfaces.Foo

Simple as
Replies: >>105999325 >>105999363
Anonymous
7/23/2025, 4:46:24 PM No.105999310
The convention is some kind of -er or a generic container name like Store
Replies: >>105999353
Anonymous
7/23/2025, 4:47:41 PM No.105999325
>>105999288
This calls for lynchings
Anonymous
7/23/2025, 4:51:00 PM No.105999353
>>105999310
Example:

type UserFetcher interface {
Fetch(string) (User, error)
}

type PostgresUserFetcher struct{}
type RedisUserFetcher struct{}

Or

type KVStore interface {
Set(string, string) error
Get(string) (string, error)
}

type InMemStore struct{}
type RedisStore struct{}
Anonymous
7/23/2025, 4:52:40 PM No.105999363
>>105999288 (Me)
Or, of course, Fooable where applicable if you're not an NPC that has to follow shitty style guides.
Anonymous
7/23/2025, 4:57:36 PM No.105999409
Hercules-fighting-achelous-transformed-into-a-snake-bronze-sculpture
I remember the book says the go good practice is to append "er" to the interface.

Stringer
Reader
Analyzer
Sneeder
Replies: >>105999433 >>105999648 >>106000387
Anonymous
7/23/2025, 5:00:47 PM No.105999433
>>105999409
Brapper?
AromaPonderer?
Replies: >>105999464
Anonymous
7/23/2025, 5:05:42 PM No.105999464
>>105999433
Cunner
Anonymous
7/23/2025, 5:26:06 PM No.105999648
>>105999409
Sneeder? Post code?
Anonymous
7/23/2025, 5:27:24 PM No.105999658
Interface: InterFooBarFace
Struct: StruFooBarCt
(or alternatively: ClaFooBarSs)

that way you know exactly what you're dealing with on the first glance and since the pre and suffix encapsulate the word you can quickly estimate the length of the name by only looking at "Inter" and "Face" or "Stru" and "Ct" and then measuring the distance between the last letter of the prefix and the first letter of the suffix. that way you can calculate the time it takes you to write the code and give a more accurate story point estimation
Anonymous
7/23/2025, 5:32:16 PM No.105999695
What's the newest on Go structuring? Do you do the same way as java slop with Controller, Service and Repository layers? I've found it works okay though plumbing deps is more annoying.
Anonymous
7/23/2025, 6:44:38 PM No.106000335
>>105998840
>gojeet projecting
>saar, your language is overengineered corpolang slop, unlike my language which was designed by rob kike and ken trannyson who stripped everything out of the language because they know everything and designed the language for low IQ jeets to learn in a week and tard wrangle them from fucking up

>>105999114
good morning sir
Anonymous
7/23/2025, 6:51:23 PM No.106000387
>>105997192 (OP)
Go is the most retarded language I've seen in the last... 10 years? "Yeah, let's throw away every single good thing about modern language". Just the fact that they are such anally retentive faggots that they refuse to add proper error handling to their retarded parody of Java is laughable. Even C++ has proper error handling now with Expected. They're so obsessed with backwards compatibility they can't even recognize their fuckups
>>105999409
Nigger
Anonymous
7/23/2025, 7:22:05 PM No.106000673
>>105998274
>>as a Rust programmer I don't have to deal with this retardation
By not having a job?
Replies: >>106000748
Anonymous
7/23/2025, 7:29:19 PM No.106000748
>>106000673
Do Gojeets get jobs outside of India?
Replies: >>106001812 >>106002196
Anonymous
7/23/2025, 7:47:41 PM No.106000905
the only redeeming (pun intended) feature of go is green threads
Anonymous
7/23/2025, 8:47:41 PM No.106001405
>>105997192 (OP)
>they want to use prefix/suffix "I"

GOOD MORNING SAAR
Replies: >>106001519
Anonymous
7/23/2025, 8:59:07 PM No.106001519
>>106001405
The I prefix comes from C++, where it was necessary because C++ has no interfaces, you retarded gojeet.
Replies: >>106001591
Anonymous
7/23/2025, 9:05:24 PM No.106001591
>>106001519
Am brahmin saar.
Anonymous
7/23/2025, 9:31:55 PM No.106001812
>>106000748
It's a fairly in-demand language these days
Whether or not you'll get hired over an H1B is another matter I guess
Anonymous
7/23/2025, 10:11:49 PM No.106002196
>>106000748
pathetic projection.
Anonymous
7/23/2025, 10:19:28 PM No.106002268
hungarian notation is completely discredited, and the very suggestion should just be laughed at until the suggester backs down
Anonymous
7/23/2025, 11:49:21 PM No.106003061
>>105997192 (OP)
nigger
it's not a Java convention to add prefixes/suffixes to interface names
Anonymous
7/23/2025, 11:52:56 PM No.106003085
>procedular shitters acting tough
totalkek
Replies: >>106003121
Anonymous
7/23/2025, 11:56:45 PM No.106003121
>>106003085
GOOD MORNING SIR OOP IN REVERSE IS POO
Replies: >>106003930
Anonymous
7/24/2025, 1:26:57 AM No.106003842
>>105997192 (OP)
>having a fight with teammates
There is your real problem.
Anonymous
7/24/2025, 1:39:25 AM No.106003930
>>106003121
GOOD MORNING SAAR GO IS BRAHMIN LANGUAGE BRAAAAAAAAAAAAP