37
top 50 comments
sorted by: hot top new old
[-] stoicmaverick@lemmy.world 1 points 1 hour ago

People who don't give ass rats?... You have to give one or the other, dude.

[-] graynk@discuss.tchncs.de 36 points 1 day ago

This doesn't matter so so much that I don't even have the words for it

[-] sik0fewl@piefed.ca 8 points 1 day ago
[-] douglasg14b@lemmy.world 3 points 19 hours ago

It's only bike shedding if the people arguing over it don't know enough about the topic to actually make cohesive arguments.

Things like how we name things and the grammar we use are quite important in cognitive psychology. And we can take advantage of research into cognitive psychology to better improve how we write software.

[-] graynk@discuss.tchncs.de 3 points 20 hours ago

I can never remember which one's bikeshedding and which one is yak shaving... but yeah!

bikeshedding: Futile expenditure of time and energy in discussion of marginal technical issues.

Not a term I was aware of. Thanks!

[-] phutatorius@lemmy.zip 4 points 20 hours ago

There was a pub in my town called the Bike Shed. I spent many happy hours there in futile discussions of marginal technical issues.

Alas, they're now gone, I no longer drink alcohol, and the people I bikeshedded with have either died or moved away. I still occasionally shave a yak at work, though. Sometimes doing so is a necessary evil.

[-] SCmSTR@lemmy.blahaj.zone 7 points 1 day ago

It does kiiiiinnnnda matter, but I just don't care and it doesn't affect me. Problem solving and remaining mentally flexible and able to switch gears is just kind of part of the field. But yeah, it feels like the "tabs or spaces" thing, in that, I have a preference, but I'm so used to encountering way, way dumber and worse bs that I don't even care about tabs v spaces.

[-] MangoCats@feddit.it 9 points 1 day ago

The choice doesn't matter - consistency does a bit.

[-] kevincox@lemmy.ml 15 points 1 day ago

declaring multiple variables is less error-prone than in C. In C, the following declares x to be a pointer, but (surprisingly at first!) y to be a normal integer:

int* x, y;

Whereas the equivalent in Go does what you’d expect, declaring both to be pointers:

var x, y *int

I don't think this is a related at all. C could have easily decided that the definition makes both x and y pointers. They just decided not to so that you can declare more variables on one line by being able to do int x, *y, **z, .... It is more flexible.

Similarly that Go line could have been parsed like var x, (y*) int if they wanted to. They just made a different choice.

[-] mEEGal@lemmy.world 2 points 19 hours ago

That's because declaring several variables on the same line is syntactic sugar, although I agree it makes little sense this way

[-] jdr@lemmy.ml 7 points 1 day ago

That's why you write

int *x, y, **z;

C doesn't write like "x is an int-pointer", rather it says "dereferencing x will get you an int".

[-] anotherandrew@lemmy.mixdown.ca 12 points 1 day ago

100% and why I think int* should be at the least a compiler warning, perhaps an outright error with pedantic enabled.

[-] tal@lemmy.today 3 points 1 day ago* (last edited 1 day ago)

By the popularity of type inference in variable declarations, a feature that’s included in most languages now: var in C# and Java, := in Go, auto in C++, and so on.

I don't really like type inference, because I think that it makes it more-obnoxious to read code. That being said, I will concede that if you want a lot of static type information


and compilers can do things with more information


it does make for more concise code.

EDIT: Hmm. I was trying to think what would make it better. Maybe I'd be more okay with it if all compilers for languages that did this had a trivial way to just run the type inference step and output code with inferred types present.

[-] luthis@lemmy.nz 44 points 1 day ago

Hard disagree. Is that a joke? Type is far More important than name. Just ask the compiler.

[-] Armand1@lemmy.world 26 points 1 day ago* (last edited 1 day ago)

As other users have said, we aren't compilers.

Types are important for type safety, so you don't access properties that don't exist, can use polymorphism etc. However, having worked in both duck-typing and hard typing languages, I believe the most important part of a type is it's name.

Classes are are arbitrary constructs we create to help us understand and manage code. They are inherently organisational structures.

That may sound like an argument FOR putting the name of the class first. "If I know it's a ConnectionCredentialsQuery, I don't need to know it's name, the use-case is evident!" Classes often get reused though, like a CartesianPoint. You may create several instances of them. Which of the name and type below are more indicative of use?

CartesianPoint PlayerPosition; 

Types are, to some extent, implementation detail. The name tells you what the variable is for, which is more important.

Another point: You will always need to name variables well, because after declaration, whenever you see a variable, you will only see its name. You want to be able to fully understand what you are looking at without having to mouse over or go back to the declaration of a variable.

Additionally, many typed languages will allow you to use a syntax to altogether avoid declaring the type of a variable if derived from somewhere else.

var result = a + b;

var customer = new Customer();

Given that the type can be inferred, and therefore specifying it explicitly is optional, why make it the first thing you see? That means you need to move your eye back and forth when looking for the names of things. Which of these two are better for legibility:

var result = a + b;
CartesianCoordinate playerPosition;
const result = a + b;
let playerPosition: CartesianCoordinate; 

Finally, you say that types are more important because they are important to the compiler, but compilers don't care about the order of these definitions. Compilers exist to allow us to write easier to read code. They exist to convert high level languages to low level byte code. They exist to enable more readable code.

Thank you for coming to my TED talk.

[-] theneverfox@pawb.social 16 points 1 day ago

Counter argument - putting the type first makes it easier to see where it is declared. Which is more important than the name or the type

load more comments (2 replies)
[-] gnutrino@programming.dev 17 points 1 day ago

Controversial take: it doesn't matter in the slightest.

[-] stardreamer@lemmy.blahaj.zone 9 points 1 day ago* (last edited 1 day ago)

Breaking News: local dev argues peanut butter on jam is the same as jam on peanut butter.

[-] MolochHorridus@piefed.social 1 points 1 day ago* (last edited 1 day ago)

Try to write some code and see if it matters. Try to argue against a compiler, please.

load more comments (7 replies)
[-] Yoddel_Hickory@piefed.ca 5 points 1 day ago* (last edited 1 day ago)

Type is more important? So if the first argument of a function is minAge, which is an int, the important part is that it is an int? Just feed it any int?

No, the important part is the meaning, what the variable actually is, if you use a compiled language the compiler will handle types for you anyway. You'll get a error if you feed it a string, or an water heater object, no surprises.

Leave the machine work to the machine (compiler in this case), and concentrate on the real work, which is the meaning here.

[-] victorz@lemmy.world 9 points 1 day ago
[-] luthis@lemmy.nz 10 points 1 day ago

Maybe, but i speak English that follows adjective - noun pattern. So I'm already conditioned to type - name

load more comments (3 replies)
[-] Joelk111@lemmy.world 9 points 1 day ago

Maybe this comes from a non-typed language perspective... As someone who learned in Java, I do not like it because yeah, type is way more important. If someone was coming from Python, I can see why they might think this...

[-] faintwhenfree@lemmus.org 4 points 1 day ago

I learned C++ first, have been using python for the last decade almost daily for various one off tasks. I like python, but if I had to build something that will be used even hundred of thousand times, I wouldn't do it in python.

Anyway point being, despite me using for decades, I still yearn for C++.

load more comments (5 replies)
load more comments (3 replies)
[-] chrash0@lemmy.world 7 points 1 day ago

a lot of modern languages explicitly disagree, eg Kotlin and Rust

[-] andallthat@lemmy.world 7 points 1 day ago

I think that's so type inference can work by just omitting the type, instead of having to use "var" or "auto" in front of the variable name

load more comments (1 replies)
load more comments (1 replies)
load more comments (1 replies)
[-] it_depends_man@lemmy.world 23 points 1 day ago

This suggestion was made by the year-day-month dateformat gang.

[-] phutatorius@lemmy.zip 1 points 20 hours ago

Say what you like about that gang, it definitely makes lexical sorting of dates easy.

[-] ranzispa@mander.xyz 0 points 6 hours ago

I would say this is one of the worst dates formatting possible.

[-] it_depends_man@lemmy.world 4 points 19 hours ago

Read my comment again. 😜

[-] MangoCats@feddit.it 7 points 1 day ago* (last edited 1 day ago)

That's year-month-day hour:minute:second.millisecond +/-TZ, you heathen!

[-] Pissmidget@lemmy.world 16 points 1 day ago

Was about to write a post asking what the beverage dispenser in the authors workspace provided.

Then my brain snapped out of vacation mode and remembered that I mainly use var (mainly C# backend dev) which is effectively the same, and I've never had an issue with it.

Now I'm left torn and confused, and in work mode on vacation... What a day, and it's not even 08:30.

[-] vrighter@discuss.tchncs.de 7 points 1 day ago

name before type makes it easier for compiler writers. Not the language users imo.

load more comments (1 replies)
[-] palordrolap@fedia.io 5 points 1 day ago

This is just arguing about whether the surname goes before or after the given name.

If you think int x makes the most sense, you might be Chinese. Or Hungarian. Or English speaking if you grew up with characters like Fireman Sam or Postman Pat... erm...

[-] MountingSuspicion@reddthat.com 1 points 21 hours ago

This is my take as well. I will add that I think I'm more likely to notice an issue with the type if the type is first though since it preps me to expect a certain thing after it.

int firstName will likely trigger more alarms than firstName int but maybe thats just my perception due to familiarity. I feel like once I see the type my mind is looking to make the next part make sense whereas if I see the name first then I just assume what comes next makes sense and mentally move on.

[-] mercano@lemmy.world 3 points 1 day ago

If you think of int as an adjective, the whole situation changes. It makes sense to an English speaker, but is backwards to a Spanish speaker.

[-] mercano@lemmy.world 2 points 1 day ago

Number one thing that screws me up when moving between the TypeScript client-side code and the Java server-side code: how variables are declared. Java is type first, TypeScript is name first.

load more comments
view more: next ›
this post was submitted on 26 Jul 2026
37 points (73.4% liked)

Technology

86651 readers
3522 users here now

This is a most excellent place for technology news and articles.


Our Rules


  1. Follow the lemmy.world rules.
  2. Only tech related news or articles.
  3. Be excellent to each other!
  4. Mod approved content bots can post up to 10 articles per day.
  5. Threads asking for personal tech support may be deleted.
  6. Politics threads may be removed.
  7. No memes allowed as posts, OK to post as comments.
  8. Only approved bots from the list below, this includes using AI responses and summaries. To ask if your bot can be added please contact a mod.
  9. Check for duplicates before posting, duplicates may be removed
  10. Accounts 7 days and younger will have their posts automatically removed.

Approved Bots


founded 3 years ago
MODERATORS