4 ms·
different folks like to live at different levels of abstraction, we aren't all level 50 type system mages and, even if we were, that type system wizardry wouldn
by recursivedoubts 4y ago
different folks like to live at different levels of abstraction, we aren't all level 50 type system mages and, even if we were, that type system wizardry wouldn't help a whole ton in getting strings from browser A into database B and back again.
i don't mind blub-tier java code (in fact, I dislike the parts of java where the API designers decided to get fancy, e.g. streams or I/O), it fits my brain pretty well so long as I am not dealing with teutonic AbtractThingDoerFactoryInjectionLookupService type code.
i prefer object oriented stuff and I dislike super complicated type systems. I even think java would be a lot cleaner if they had just said "generics are covariant like arrays, don't mess it up" and introduced function types, which captures most of the contravariant situations.
this is all blub-tier thinking, no serious computer scientist would advocate for this because it isn't logically sound, but it gives you 80 for 20 and is a lot easier to think about for my level of brain activity.
i am grug, hear me "hmmm"
https://grugbrain.dev https://grugbrain.dev
- vbezhenar 4y agoLanguages are always designed by big brains so we grugs have to endure that.
- tester756 4y ago>Languages are always designed by big brains What makes you think so? Creating new/any language isn't super-hard
- vbezhenar 4y agoGrugs write business code we dont have time for that nonsense. Big brains like to spend their time writing nonsense which sometimes produces new languages but usually only mess for grugs to deal with after big brain leaves.
- deleted 4y ago[deleted]
- zelphirkalt 4y agoIf true, then size of brain does not seem to matter much, considering the kind of languages we have and how little we usually learn from past programming language theory, when creating new languages.
- maccard 4y ago> even if we were, that type system wizardry wouldn't help a whole ton in getting strings from browser A into database B and back again. Some of it does. The usage of two separate types for validated and unvalidated input entirely removes a class of bugs from the programmer, and enforces it at compile time, making: string my_str = <some untrusted input>; db.exec("select * from A where name='{0}'", my_str) A compiler error instead of an SQL injection.
- krapp 4y ago>db.exec("select * from A where name='{0}'", my_str) In any sane framework, that would be using prepared statements under the hood, so it shouldn't matter.
- gaganyaan 4y agoI like the general message behind grugbrain.dev, but I think you're also pretty much entirely wrong on types not helping for basic browser <-> database interactions. Python, one of the most dynamic of languages, is proudly including LiteralString in the upcoming 3.11 release: https://peps.python.org/pep-0675/ https://peps.python.org/pep-0675/ I will say that yes, the Java ecosystem really abuses types due to the anemic type system that Java provides, but that's an indictment of Java, not type systems in general.
- recursivedoubts 4y agoi agree: some type systems help is useful, but not a ton of type system wizardry.
- kaba0 4y agoWhere does it abuse types and how is it anemic? Sure, it is not a Haskell, but you can do some really fancy things in Java, eg: vavr
- zelphirkalt 4y agoI may not get the reference here: What is "teutonic" about "AbtractThingDoerFactoryInjectionLookupService"? I mean, I get the "AbtractThingDoerFactoryInjectionLookupService is bad" part, but why "teutonic"?
- recursivedoubts 4y agoGerman tends to mash words together, e.g. Rechtsschutzversicherungsgesellschaften.
- zelphirkalt 4y ago…verein OK, got it, thanks! Should have gotten it earlier. Now it seems so clear :D