this post was submitted on 31 Aug 2025
29 points (100.0% liked)
Programming
24135 readers
332 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities !webdev@programming.dev
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Functional language developers are obsessed with side effects but I rarely ever see problems with it in real code. Like I can remember once in maybe 10 years setting a developer write a "get" method that also wrote to a file. Caught during code review, rewritten easily.
Also - it's sad to see languages still using whitespace for code blocks. Respect programmers, use proper start/end symbols for that. It's not the 80s, development tools can format code now.
While, sure,
getmethods writing files could happen in side-effectful code, the side-effect concern is less about that and more of expectations. With OOP languages, class methods can create a dichotomy of expected returns: Using a list reversal as an example, will alist.reverse(some_list)function reverse the list in-place, or return a copy of the reversed list and leave the original in-tact? To know the answer, you have to check the docs or the type signature (which, yes, is easy, but the answer isn't obvious). Which, the main concern is trying to debug things "magically changing", since nested function calls and inherited function calls can modify something from layers upon layers of abstraction away.FP languages tend to not have this dichotomy, with very few exceptions like IO in Haskell, ports in Elm and Gren, external functions in Gleam, or FFI in Haskell, to name some ways from languages I know, all of which usually move the control of the program outside the language's "default area", anyway. Outside the exceptions, to reverse a list a
reversefunction needs to be given that list explicitly, and it also will be returning a copy of the list reversed, only and alwaysMmm - that is an excellent example, though not one specific to OOP... But I see your point. I think Kotlin and other languages have addressed these types of issues with 'mutability' as part of the type where it becomes explicit which variables can be modified. Kotlin even has "MutableList" as distinct from "List" which lets you say whether a list's contents can be modified.
Still, Not everybody Formats their Code 💀
If I'm viewing poorly formatted code it's literally one key chord for me to auto-format it. It's a complete non-issue.
Interesting... so in the end, if the whitespace is not telling you what the code is doing, you reformat it so that it does?
Imagine if there were languages that just let you skip that step entirely!
The step I want to skip is having to go back and tab over lines when I've moved code or when things don't paste properly and tabbing gets messed up.
Imagine if there were languages that let you just explicitly state where code blocks start/end and let the IDE handle the formatting for you?
Saying that the problem of formatting goes away if you have a carefully configured IDE is an excuse, not a reason.
Yea until you have to view it outside a code editor
Never a problem.