326
submitted 2 days ago* (last edited 2 days ago) by HiddenLayer555@lemmy.ml to c/programmer_humor@programming.dev

Made with KolourPaint and screenshots from Kate (with the GitHub theme).

you are viewing a single comment's thread
view the rest of the comments
[-] pivot_root@lemmy.world 16 points 2 days ago* (last edited 2 days ago)

Rust is verbose, but C++ might still take the cake with its standard library templates. Especially when using fully-qualified type names...

auto a = ::std::make_shared<::std::basic_string<char, ::std::char_traits<char>, MyAllocator<char>>>();

A reference-counted shared pointer to a string of unspecified character encoding and using a non-default memory allocator.

[-] jlh@lemmy.jlh.name 1 points 1 day ago* (last edited 1 day ago)

Yeah, I mean Rust is only verbose if you want it to be. let foo = "bar"; is valid rust too, no need to declare the type and definitely no need to declare the lifetime.

For that matter, if you ever declare something as explicitly 'static in code that isn't embedded or super optimized, you're probably doing it wrong.

[-] calcopiritus@lemmy.world 5 points 1 day ago

fully qualified type names make any language awful.

Here's the same example in rust:

let a = std::rc::Rc::new(std::vec::Vec<u8, MyAllocator>::new());

I believe u8 also comes from a module, so it would be something like std::u8::u8, but I'm not sure.

[-] theacharnian@lemmy.ca 1 points 1 day ago

I don't understand why verbose is bad. Verbose is maintainable.

[-] kuberoot@discuss.tchncs.de 10 points 1 day ago

Not when taken to such an extreme so as to obfuscate the meaning and behavior of code, and make it difficult to understand how you would arrive at that code.

Sane defaults serve to reduce verbosity without obfuscating meaning, simpler syntax with different ordering and fewer tokens reduce verbosity to make the code easier to read by reducing the amount of text you have to pay attention to to understand what the result is.

I imagine there's also a distinction to be made between verbosity and redundancy - sometimes extra text might fail to carry information, or carry information that's already carried elsewhere. I'm not sure where the line should be drawn, because sometimes duplicate information can be helpful, and spacing out information with technically meaningless text has value for readability, but I feel like it's there.

[-] theacharnian@lemmy.ca 1 points 1 day ago* (last edited 1 day ago)

Frankly, I have way more often ended up scratching my head for some cryptic piece of syntax than the opposite. Sure I could sit down and spend the rest of my life learning each language designer's favourite syntax optimisations, but I kinda don't want to. I'm a human, not a parser.

And frankly, a good IDE editor should be able to fold/unfold verbose syntax. Better for it then to be there and folded, than for it to not be there and for someone to have to work backwards the intendrd meaning of every single line of code.

this post was submitted on 19 Jun 2025
326 points (90.1% liked)

Programmer Humor

24374 readers
866 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS