9,428 karma · joined Jul 10, 2015 (11y ago) · 3,276 submissions
comment 9y ago · link · parent
Gun ownership is deeply entrenched in American history and written into the constitution since centuries ago. When something is that fundamental to a culture and its government, it is unlikely to change.
Though I fail to understand why machine guns remain legal. You can't buy a grenade launcher or anti-aircraft missile system, so why other weapons of war? That's the one oddity.
Disclaimer: I have family members in the states; one of them own 15 guns.
1383.
Dynamic Languages Are Static Languages (2011)(existentialtype.wordpress.com ↗)
1 points · by hellofunk · 9y ago · discuss
comment 9y ago · link · parent
I think C is still so pervasive for 2 simple reasons (I might be wrong):
1) It's a small language. Compared to many newer languages (Swift, modern C++, old C++, Objective-C, Java), it's quite tiny. The language itself can be learned in short time. (Which is deceptive, because properly using what you have learned takes longer than a short time).
2) It's fast. It's just direct memory access, direct and explicit hardware manipulation. And whether justified or not, there is a very large portion of the developer community that remains obsessed with speed. I see it all the time, even when speed isn't not going to matter enough to justify C. I often see people going way out of their way, making their work much more time-consuming, because of their everlasting pursuit of writing the fastest damn program they possibly can.
comment 9y ago · link · parent
It is not a proof-like system, but outside of dependent typing, static typing does not catch value-related bugs, but Clojure.spec can. In a static type system, how easily would it be to exactly specify and guarantee that a function's second parameter is of a higher value than its first, or that a function's output is an integer between 5 and 50, etc? Clojure.spec is just predicate functions composed together to define the flow of data in a program, and those compositions can be used in a variety of ways.
comment 9y ago · link · parent
However, in a statically-typed language, you must satisfy the type checker for everything, which adds development time. In reality, there might be a small percentage of functions in your code base for which errors (either compile-time or run-time) would likely crop up, yet you must pay that cost for 100% of them.
So that's really where the debate comes from.
Dynamically typed languages can get around this problem by generative testing (in Clojure's case) which allow very fine-tuned aspects of your system's requirements to be automatically tested before run-time without writing tests, which offers some of the same confidence as a compiler.
comment 9y ago · link · parent
What a ridiculous stereotype. Clojure community typically maintains the belief that macros are the last resort for things that genuinely justify them. You really shouldn't spread hyperbole like this.
comment 9y ago · link · parent
comment 9y ago · link · parent
So the trade off is: static typing gives you more compile-time certainty, but at a cost of spending more time developing your code. Dynamic typing gets you to a working product or prototype typically much much faster, but with added run-time debugging.
Each has its benefits and costs.
In my experience, there is no doubt that dynamically typed languages are faster-to-production than statically-typed. This doesn't mean that I don't admire static typing, though, because most developers appreciate some degree of purity in their work.
comment 9y ago · link · parent
That both forms of languages are popular shows that there are benefits in overall productivity to each; they are just different benefits.
comment 9y ago · link · parent
comment 9y ago · link · parent
In such a case, the line between these two type environments narrows.
comment 9y ago · link · parent
There are no senses to come to. Static and dynamic typing each have their own benefits, and there are genuine tradeoffs to choosing one over the other. That we are even having this debate in 2017 shows that the world of typing is not a "solved problem" and there are still good reasons to use one over the other for various reasons.
comment 9y ago · link · parent
comment 9y ago · link · parent
The original point about bugs is in my opinion, regarding my comment you replied to, very similar to a discussion about code size. There are some great reads [0] that go into further depth on this issue, if you are curious.
[0] https://github.com/papers-we-love/papers-we-love/blob/master...
comment 9y ago · link · parent
On top of that, the pervasive use of macros in lisp tend to lead to a kind of code-reuse that languages without macros lack.
Not to say that Haskell can't be concise also, just not to the same degree. And I've seen very long lines in Scala that were due to pleasing the compiler's typing.
Elm and Clojurescript offer a good contrast. Elm is written in Haskell and is not too unlike Haskell syntax and general language use. I've written in both Elm and Clojurescript and there is nearly a 2X difference in code size of Elm over Clojurescript for accomplishing similar non-trivial tasks.
Code size isn't everything, but it is important.
If you still find it that hard to believe, just try Clojure for awhile, and I think it will be clear. It's a tradeoff. When you don't have to satisfy a type checker for everything, you do write less code, that's just a matter of fact most of the time.
The question is whether the increased code size of a statically-type language over a lisp makes up for the extra developer resources and potential for bloat-related bugs. But that is of course the core of the typing debate.
comment 9y ago · link · parent
While I too am attracted to the static typing in many ways, I have found in my own experience of working in C++ full time for a few years (with some non-trivial work in Swift as well, which has quite a strict type system), and then Clojure full time for a few years, that when you measure all the other features of a language, typing alone does not make a big difference.
It's kind of like the argument some people make about how the cost of your rent or mortgage is the best indicator of your cost of living. There are so many other factors, and some of the lowest cost of living I've personally experienced has been in places with considerably higher rent than average, due to the offset of other factors.
comment 9y ago · link · parent
comment 9y ago · link · parent
Clojure is an incredibly succinct language. It uses about half as many lines as Elm, 5% as many lines as C++. I love other languages, but nothing rivals Clojure in elegance. I believe this is the key reason why Clojure projects are so low on bugs -- they are much simpler to maintain, refactor, or rewrite entirely than in most other languages, so fixing problems is not the chore it can be elsewhere.