Today I Learned
Today I Learned (TIL). You learn something new every day; what did you learn today?
Thanks, I will read it today!
yeah Go’s pretty good, especially for web services. i don’t have much of a space in my toolbox for it personally, though that’s not a fault of the language.
there’s a difference between managing memory and managing resources more generally. a GC doesn’t know when you’re done dealing with a file or a database connection or some other collection of data structures that has some semantically non-deterministic lifetime.
Rust however can close resources automatically with its lifetime mechanism ;)
True true, Rust can indeed automatically close resources with its lifetime mechanisms. However, I found Rust very painful to program in. Totally skill issue! However, I didn't like Rust yet. Maybe when you really need Rust, I can imagine you want to do that route.
I love Rust but hate how it is typed, gives me RSI.
@[email protected] i recently tried Go for the first time. just trying to parse some nested json from a file was quite painful as there seems to be no easy way to parse arbitrary json. it always needed a struct, which for complex json is quite awful to write out.
safe to say, since i have absolutely no need to the language, i won't be using it
map[string]any
Thanks for mentioning this. So it is possible without defining the whole struct. Great!
this is an example of task easier achieved in dynamically typed languages e. g. Ruby, python, elixir
No.. In production you don't want dynamically typed languages. Frankly, even TypeScript is still not good enough (since it still compiles to JS and the value can become any kind of type during runtime), it can cause catastrophic failures and errors in production. When you write a back-end server, I learned my lesson the hard way, I believe you want a statically typed language for better safety, security and mainly predictability at runtime.
Python is fine for some simple scripts here and there, but please do not use it for critical production software. Please ..
I understand your situation, apparently there are workarounds for with as listed in this comment thread. Statically typed languages catch errors at compile time, ensuring robust code and safer refactoring, while also allowing for better performance optimizations. Their explicit type annotations enhance code clarity and maintainability, making it easier to understand and manage large codebases. This leads to more reliable and efficient backend systems.
@[email protected] i mean, you can have a statically typed language and safely handle arbitrayry json. you just need Tagged Union types in the language, which make it easy to type hierarchical structures where each level is one of a set of types
Yup! I had a great time with go.
Nice!.. I don't know who down voted you, but glad to hear.
NO GO SUCKS /s
Why don't you like go? Or?
watch the /s
😁
Ow sorry. It was sarcasm.
I've tried to learn Go, but I just couldn't wrap my head around it, how to see the field and where to go.
Yes, I suck at the board game.
That is another kind of Go. You are talking about the board game Go. I'm talking about the programming language Go. hehe!
Yeah, well aware, it just amused me at the time.