Stringly typed
Stringly typed
Dark times…
Like -1 for an Int nil value.
int?
Groovy will automatically convert integers into objects, as it sees fit. And one such case is when you assign null to an integer.
There’s some more languages, which try to treat primitive types like objects, to make them more consistently usable. As I understand, nullability is a big part of the reason why it can’t be solved with syntactic sugar, so presumably this would be possible in all those languages.
If I’m not mistaken, Ruby is another one of those languages.
Ah, yeah, very familiar with that article. 🙃
It’s definitely part of the reason why I like these really narrow types. But the other big reason is that your internal APIs start to look like this:
It just makes it almost impossible to pass the wrong value into a parameter. You don’t need to wonder, whether you should pass your port variable into a parameter called bind_port, if you introduced separate types BindPort and RemotePort for them.
Of course, this is a somewhat extreme example. It’s up to you to decide, whether you’re likely to encounter multiple values of the same type and whether it’s therefore helpful to make it impossible to confuse them.
God, I’m so over SQL.
It’s great, but it is so old and shows it. Feels like 99% of my SQL queries are just cheese.
Works though, and quick.
SQL is the only bedrock in my entire career. Its the one thing that has stayed relevant.
SQL is great but when you start having issues processing what is actually going on, its fine to pull out what you need and throw another language on top (python, C#, etc...etc...). Getting it to work slow is one step in making it fast again.
Its been a while but yeah NoSQL was the closest.
I remember a good 4-5 years where developers all around me were using couchdb, mongodb, and a host of others. mostly json in <-> json out kind of systems. And VERY hard to maintain after the initial TODO. I remember so much debugging and finding out old records didnt have a way to deal with changes in the "tables" or equivalents. It was maddening.
Dont get me wrong, it did create some really awesome specialty tools but you cant really get around ACID compliance when dealing with databases.
I think SQL has some awesome properties that keep it going:
1. Most major distributions are rock solid stable.
2. Its optimized and fast for data.
3. Its understandable to many types of industries. Software development is only the start.
4. Its integrated with everything already. So ODBCs can just plug and play most of the time.
5. Its the devil we know. ACID, transactions, etc... are all things we know about and are proven to work very well. Definitly when you need to MAKE SURE a thing made its way into the system.
Yeah 100% with you, had this mongo database where the first entry was like a description, the nr 2 and on the actual data. I mean if there were a description… Sometes 2 descriptions…
Why oh why.
And for sure SQL is kind of the cement of DB today, don’t get me wrong, I like that what I learned yesterday actually still works, I’m just pondering the fact that it is so.
Maybe SQL isn’t the hip language so people doesn’t try to reinvent it all the time 😁
It has though
Window functions were an addition, but more recently struct, json, and array fields with native support. Pipe syntax is getting multiple implementations.
Match recognize is a whole new standard abstraction of window functions.
Union by name is being added (fuck union by position).
more directly, sqlite was originally for tcl which is why they share the semantics.
also I’d argue that sqlite is a bigger contribution than tk, but I suppose in a more roundabout way
28
That’s easy
Me: Puts a boolean into sqlite
Me: Asks for that boolean
SQLite: “Here’s that int you asked for”
I opened a TCL script once. It’s use of uplevel scared me. I’ve never dared to return since.
For those who don’t know: uplevel is a command that goes up one level of the stack frame, and then executes code there. A function can therefore execute code in its callers stack frame.
tcl is pretty fun actually, it’s like bash on steroids.
for a preview of the insanity: anything surrounded by “” is a string, with the variable expansion you’d expect. anything surrounded by {} is also a string, but with no expansion. the equivalent in bash is the backtick string. but you don’t need to know that to write tcl. if you approach {} as “code blocks” like in other languages, it just works. reason being that tcl evals everything, constantly, attaching little tags to strings that tells the language how things are used, like “this string is an integer” or “this string is code and here is the result from last time it ran”. it’s madness and, weirdly, robust as hell. Xilinx writes all their tooling in tcl. SQLite started life as a tcl module, and it’s still the only api that is not provided by a plugin.
I have. I quickly learned not to.
Tk is overlooked, though. It’s not pretty, and its approach is archaic, but it’s one of the few GUI toolkits that Just Works on every platform I tried it on with minimum fuss.
void*
package require Expect
The muse of automation.