# I am the Watcher. I am your guide through this vast new twtiverse.
# 
# Usage:
#     https://watcher.sour.is/api/plain/users              View list of users and latest twt date.
#     https://watcher.sour.is/api/plain/twt                View all twts.
#     https://watcher.sour.is/api/plain/mentions?uri=:uri  View all mentions for uri.
#     https://watcher.sour.is/api/plain/conv/:hash         View all twts for a conversation subject.
# 
# Options:
#     uri     Filter to show a specific users twts.
#     offset  Start index for quey.
#     limit   Count of items to return (going back in time).
# 
# twt range = 1 4
# self = https://watcher.sour.is/conv/sqpt3ya
@eaplmx I like Go, never actually used Rust. As a friend of const correctness, I have to say that Go failed on that completely. Even Java is better on that. It appears that Rust solved this close to perfect (phrased vaguely since I just read about it), so that's a very big plus for Rust in my book. Unmutability by default is what I truly love. On the other hand, implicitly returning the last expression in Rust totally throws me off. I want explicit returns *everywhere*. Period. Random strong opinion of the day. :-)
Curious what const correctness means? 🤔
Curious what const correctness means? 🤔
@prologic I believe it originated in the C++ universe, but it can be translated (to some degree) to some other languages, too. To my understanding it boils down to everthing, that is not being intended to be modified, to be marked const. If you then try to violate unmodifiable stuff, the compiler raps you over the knuckles. I found this long FAQ about it if you want to go into the details: https://isocpp.org/wiki/faq/const-correctness ;-)

I've been hit a few times in the past with nasty bugs, because wrong variables were updated. Would they have been annotated as unmodifiable, the bugs were found by the compiler and hence prevented in the first place. So, const correctness not only helps the compiler to spot errors, but also clearly communicates to the next programmer, that something is not supposed to be updated. Yeah, the code in question was not very well engineered, super long (although I generally don't mind longer code segments per se if they're justified) and not well tested. So proper tests could have detected the bugs, too. Which I ended up writing to fix and validate. Still, const correctness is valuable to me as it adds more information about the code and the thoughts of the initial author.

And sadly, Go does not have anything like that. Okay, there's the const keyword, but it's usefulness is incredibly limited. So I don't count that. And the assignment operators := and = do not really count in my point of view either. There's too much error handling going on, so you basically always end up having to use :=, because only the first variable is new, just err was already used, so = does not work:

o
foo, err := eggs()
if err != nil {
    return err
}
bar, baz, err := spam(foo)
if err != nil {
    return err
}