Page 1 of 1

Coding Hot Takes

Posted: Wed Jul 30, 2025 4:23 pm
by lilpaladin1
I'm fairly sure this retro themed forum filled with furries have a lot of coders amongst the userbase, so why not start a thread talking about some hot takes that revolve around coding.

I'll start:
I think people can be too anal about magic numbers sometimes. I'm not calling random ass numbers good, in fact I do like it when numbers are explained as variables, but I feel like sometimes an unexplained number in a function can be explained by hovering over the function in the ide or text editor and seeing what the parameters are called. Plus sometimes the parameter has different numbers when called multiple times so having to declare constants for that can ironically make it more confusing as you'd have to go back and forth going "ok what's the number of this constant again". It's a balance thing.

Re: Coding Hot Takes

Posted: Wed Jul 30, 2025 5:11 pm
by NovaSquirrel
In communities where assembly language is prominent I see a lot of people be very vocally against the use of macros. They can cause problems for beginners and make it difficult for them to get help with or fully understand the code they've written, but people talk as if all assembly programmers are beginners? Though I wouldn't be surprised if a lot of the people in those communities that try to help out and give advice haven't actually like, had real experience making games.

My position is that when you're not a beginner and you can remember what the macros you make actually stand for, they're extremely helpful for reducing the amount of mental load involve with assembly language programming, and they make it easier to think in a more abstract way with less noise. More importantly (and this is a benefit I don't think you'll really realize until you do actual complex projects), you can have an optimization in the code that can change itself based on changes elsewhere in the program, without having to go through the whole program and change every instance of the optimization to suit the new needs (like a new layout for a data structure, or new constants). Game development calls for rapid iteration as you adjust the game design, and the tooling you use needs to accommodate that.

Re: Coding Hot Takes

Posted: Wed Jul 30, 2025 7:03 pm
by beeps
Using JavaScript is good actually.

Not the way that probably-too-many websites use it, where it's required to do virtually anything or make anything work. That sucks and is bad.

But JavaScript itself is fine. CSS hacks based on hovers and focus states and checkboxes are often not as accessible as using JavaScript, and JavaScript was literally designed for building UI behaviours, use it for its job!

JS being loosely duck typed is also a good thing when you realise that its initial role was entirely for UI behaviours. When everything in the HTML DOM is a string, of course you want the only language that can interact with it to change the types of variables according to need.

Re: Coding Hot Takes

Posted: Wed Jul 30, 2025 9:12 pm
by NovaSquirrel
beeps wrote: Wed Jul 30, 2025 7:03 pm Using JavaScript is good actually.
I remember you managed to nudge me into going ahead and using JavaScript where it's a good fit on a previous forum. That and also realizing that my phone was having trouble with CSS tabs. Of course I'm still making sure the site isn't just totally broken without scripting, like using a media query to change the layout into a single column with section headings if it can't have JavaScript tabs.

Re: Coding Hot Takes

Posted: Thu Jul 31, 2025 12:33 am
by hanalei
This is probably a lukewarm take in the grand scheme of things, but I remain convinced that it's almost never a good idea to omit parentheses, even when the language's syntax explicitly allows for it.

Case in point: Ruby's syntax is extremely forgiving. You don't need parentheses surrounding the arguments to a method in many cases. But that doesn't give you permission to use parentheses as little as possible. I'm a longtime Rubyist (15+ years experience), but this example bogs me down as a reader largely due to the lack of parentheses.

TL;DR: As a reader AND as a writer of code, I don't want to ever have to rely upon knowledge of operator precedence. Just use extra parentheses to spell out what you mean!

Re: Coding Hot Takes

Posted: Wed Aug 13, 2025 5:09 am
by dogbold_system
🔴 we find if/fi a bit annoying to type in shell script conditionals. it's just easier this way, even if it's slightly less readable

Code: Select all

if [ "condition" ]; then
	eat my ass
fi

Code: Select all

[ "condition" ] && { 
	much better 
}

Re: Coding Hot Takes

Posted: Thu Aug 28, 2025 4:45 am
by gaiety
HTML should never have added the option for links to open I'm a new tab (_blank target). As a user it leaves me guessing how a website will behave. It only takes control away from users who are done with a site and want the link to open in the same tag.

Unrelated but also, I kind of wish forms (and form elements) couldn't accept onchange events. They get abused so often by improperly coded forms, or product/design unintentionally asking for a form to behave in an unexpected way against spec.

Re: Coding Hot Takes

Posted: Sat Aug 30, 2025 1:45 pm
by quartz
My hottest coding take: `goto` statements are actually perfectly fine to use in a modern context (esp. for algorithms), if you know what you are doing with your control flow, and the sentiment against using it is way misunderstood and blown out of proportion.

I've had this take for well over a decade now, but this blog post I stumbled upon about a month ago pretty much sums it up perfectly: https://jerf.org/iri/post/2024/goto/

Re: Coding Hot Takes

Posted: Sat Aug 30, 2025 5:06 pm
by NovaSquirrel
quartz wrote: Sat Aug 30, 2025 1:45 pm My hottest coding take: `goto` statements are actually perfectly fine to use in a modern context (esp. for algorithms), if you know what you are doing with your control flow, and the sentiment against using it is way misunderstood and blown out of proportion.
I've had situations pop up in C programs where if I didn't use "goto" it would make the program harder to maintain, harder to understand, and make me likely to introduce subtle bugs later on. I think most of my own "goto" use could be replaced with exceptions and features like RAII but I don't have them in C.

Re: Coding Hot Takes

Posted: Sun Aug 31, 2025 8:04 pm
by silverhawke
NovaSquirrel wrote: Sat Aug 30, 2025 5:06 pm I've had situations pop up in C programs where if I didn't use "goto" it would make the program harder to maintain, harder to understand, and make me likely to introduce subtle bugs later on. I think most of my own "goto" use could be replaced with exceptions and features like RAII but I don't have them in C.
had similar situation too when dealing with C code in particular! i could just make a wrapper class for RAII in C++ but no such thing in C so i would have to make do using gotos to avoid repeating the disposal code.

not sure if this is a hot take or not but i feel like OOP/inheritance in C++ is absolutely awful. it's either that or i'm not doing it properly. genericism via base class sounds cool until i realize that i need to be handling pointers to derived class and dynamic_cast it into the correct class. at that point i'd rather just have genericism via templates...

Re: Coding Hot Takes

Posted: Mon Sep 01, 2025 7:25 pm
by natosaka
silverhawke wrote: Sun Aug 31, 2025 8:04 pm not sure if this is a hot take or not but i feel like OOP/inheritance in C++ is absolutely awful. it's either that or i'm not doing it properly. genericism via base class sounds cool until i realize that i need to be handling pointers to derived class and dynamic_cast it into the correct class. at that point i'd rather just have genericism via templates...
No no, you're right. C++ is just a terrible language. It feels very much slapped together. Do you really need 3 kinds of strings, a very strange way to deal with text streams (std::cout/std::cin), strange class formatting, and a general nightmare to work around in? C in general is much more thought out. C++ feels like it's struggling to adopt OOP principles. And I realize it was very early on, but I feel like C++ is pretty half assed. Oh, and it takes much longer to compile than C, at least with g++.

Re: Coding Hot Takes

Posted: Tue Sep 02, 2025 9:09 am
by silverhawke
natosaka wrote: Mon Sep 01, 2025 7:25 pm No no, you're right. C++ is just a terrible language. It feels very much slapped together. Do you really need 3 kinds of strings, a very strange way to deal with text streams (std::cout/std::cin), strange class formatting, and a general nightmare to work around in? C in general is much more thought out. C++ feels like it's struggling to adopt OOP principles. And I realize it was very early on, but I feel like C++ is pretty half assed. Oh, and it takes much longer to compile than C, at least with g++.
maybe i'm not quite yet ready to admit it's Bad since i still work with C++, but i do agree with you on a lot of points there hah. C++ is Weird in many aspects but i'd rather deal with some of that (since i can always opt out of doing OOP there) than deal with, say, resource acquisition/disposal in C 😭

i guess in that regard, it is a matter of the levels of Bullshit Tolerance you have w.r.t. what you're using the language for... (silently looks over at PHP users)

... or perhaps, maybe i should consider picking up Rust (?)

Re: Coding Hot Takes

Posted: Tue Sep 02, 2025 11:32 am
by natosaka
silverhawke wrote: Tue Sep 02, 2025 9:09 am ... or perhaps, maybe i should consider picking up Rust (?)
Programming is what you make of it. I think trying new languages, new libraries, new ideas, is all part of the fun. You can still learn different stuff, even from working in clunky languages, so I don't think it's a bad idea to try out something like Rust. Even if you don't end up using it too much, you'll certainly learn a lot about proper memory management without garbage collection, which can be applied to other languages. So I'd say go for it.

Re: Coding Hot Takes

Posted: Tue Sep 02, 2025 3:10 pm
by a_random_fox
quartz wrote: Sat Aug 30, 2025 1:45 pm My hottest coding take: `goto` statements are actually perfectly fine to use in a modern context (esp. for algorithms), if you know what you are doing with your control flow, and the sentiment against using it is way misunderstood and blown out of proportion.

I've had this take for well over a decade now, but this blog post I stumbled upon about a month ago pretty much sums it up perfectly: https://jerf.org/iri/post/2024/goto/
A thing i found funny about the linked page is that i work with a language that still uses the kind of goto declared dead in it and it is not a low-level language like assembler. It is called "Flexible Oberfläche" or FO for short, a proprietary language used by the ERP system that the place i work at has. You can just jump right into loops, because loops are made with a combination of jump marks and conditional gotos. Similar for if blocks.

There is a modernized version (FO2) which has proper loops and if-blocks, but i haven't seen that used at my job at all. Part of it is probably inertia and i also guess that FO2 was released relatively close to the point where they started to allow Java to be used, which has been used for most of the new stuff since, but there is still a lot of legacy stuff using FO. That legacy stuff isn't even that old sometimes, a lot of it is from the 2010s.

I do agree that goto isn't inherently bad though, i just have a lot of experience with cases where it wasn't used well.

Re: Coding Hot Takes

Posted: Thu Sep 04, 2025 12:52 am
by gaiety
quartz wrote: Sat Aug 30, 2025 1:45 pm My hottest coding take: `goto` statements are actually perfectly fine to use in a modern context (esp. for algorithms), if you know what you are doing with your control flow, and the sentiment against using it is way misunderstood and blown out of proportion.

I've had this take for well over a decade now, but this blog post I stumbled upon about a month ago pretty much sums it up perfectly: https://jerf.org/iri/post/2024/goto/
really interesting take and article thanks for sharing!

Re: Coding Hot Takes

Posted: Tue Sep 09, 2025 9:00 pm
by Micolithe
In languages that use curly braces like C++, Java, Javascript, etc I am team newline curly brace

In python I am team tabs

I am a big proponent of commenting *everything* you fucking do. I'm not currently in the overnight on-call rotation, but when I was I had to debug stuff at 3 AM while sleep deprived - I need to know what me or my coworkers were thinking in plain straightforward sentences.

Re: Coding Hot Takes

Posted: Wed Sep 10, 2025 8:37 pm
by beeps
I'm team tabs generally. They're more customisable for end users (you can change their widths!) and better for accessibility, in cases where users need to use screen readers (imagine having to listen to 'space' being read out 4x times instead of just the word 'tab')

Re: Coding Hot Takes

Posted: Sat Sep 13, 2025 5:05 am
by hanalei
Got another hot take for y'all:

There's literally no reason to invent a new, bespoke domain-specific language (DSL) or config file format anymore. You REALLY don't need to reinvent that wheel for your project.

Want to embed a scripting language? You've got plenty to choose from: Lua, Tcl, Ruby, Janet and more. Need to parse a configuration file? Plop in an INI parser, or a JSON reader, or a TOML library if you have to, or -- heck -- just read a text file one line at a time and split the key and value on the '=' character.

Re: Coding Hot Takes

Posted: Sat Sep 13, 2025 4:26 pm
by LugiaBerry
hanalei wrote: Thu Jul 31, 2025 12:33 am This is probably a lukewarm take in the grand scheme of things, but I remain convinced that it's almost never a good idea to omit parentheses, even when the language's syntax explicitly allows for it.

Case in point: Ruby's syntax is extremely forgiving. You don't need parentheses surrounding the arguments to a method in many cases. But that doesn't give you permission to use parentheses as little as possible. I'm a longtime Rubyist (15+ years experience), but this example bogs me down as a reader largely due to the lack of parentheses.

TL;DR: As a reader AND as a writer of code, I don't want to ever have to rely upon knowledge of operator precedence. Just use extra parentheses to spell out what you mean!
Not quite the same, but I have a similar opinion with always using curly braces for if statements as well, if the language technically allows you to omit them for single line statements. The Apple goto fail; bug was caused by the "single line only" evaluation of a brace-less if statement: https://www.blackduck.com/blog/understa ... ity-2.html

Re: Coding Hot Takes

Posted: Tue Sep 16, 2025 6:44 pm
by silverhawke
LugiaBerry wrote: Sat Sep 13, 2025 4:26 pm The Apple goto fail; bug was caused by the "single line only" evaluation of a brace-less if statement: https://www.blackduck.com/blog/understa ... ity-2.html
i feel like this would've been caught (or way more likely to be caught) if autoformatting is applied before commit... speaking of, do you guys use autoformatters? i personally use Black for Python and Clang-Format for C/C++
hanalei wrote: Sat Sep 13, 2025 5:05 am Got another hot take for y'all:

There's literally no reason to invent a new, bespoke domain-specific language (DSL) or config file format anymore. You REALLY don't need to reinvent that wheel for your project.

Want to embed a scripting language? You've got plenty to choose from: Lua, Tcl, Ruby, Janet and more. Need to parse a configuration file? Plop in an INI parser, or a JSON reader, or a TOML library if you have to, or -- heck -- just read a text file one line at a time and split the key and value on the '=' character.
this i am down with. TOML seems like a better INI. JSON is great too, and is my personal go to. there's also YAML but for some reason i don't really like it. this should cover everything tbh

Re: Coding Hot Takes

Posted: Wed Sep 17, 2025 9:15 pm
by NovaSquirrel
There's always going to be new use cases that lead to needing to make new things. For instance, the major scripting languages I've seen don't try to support safely running user-provided code while limiting resource usage. Usually the sandboxing support, if any, only amounts to restricting what functions can be called, and no tools are provided to limit RAM usage or preempt a script that's running too long, or other features you might want (Second Life has a whole article about the different options here). The only publicly available language I've seen that really tries to tackle that is Roblox's Luau, but before I knew about Luau, making my own for this use case was something I was seriously considering.