> Hype: "Static Typing reduces bugs." It’s only hype because it’s imprecisely stated. Static type systems make entire classes of bugs impossible at runtime. The stronger (read less permissive) the type system, the more classes of bugs cannot occur.
On the other hand it increases development time and makes modifications and new features much harder to implement. If you took it to the extreme, you could also mathematically prove your code is correct for every input variable. Everything's a trade-off, the question is which approach is best for your application. Your average website doesn't warrant as much rigor as a Mars rover.
Cold Showers
281–290 of 363 posts
Re: Cold Showers
#282Earlier quoted context omitted.
Haha! Back in ~2014 or so my company was spending nearly $30,000/month on an EC2 "compute-optimized" cluster to transcode live video streams to multiple renditions. One of our engineers said hey, why don't we try to colo some real hardware? We did a test with a single bare-metal 8-core Xeon server and it completely destroyed the performance of the EC2 "compute-optimized" cluster! After that we colo'd 4 big Xeon serve…
So you saved, $28,400 a month. Did that make a material difference to the company? I often tell people above me I could save us $10k a month at AWS and generally the response is, "Yeaaaaaaah that's great, could you do XYZ instead to help us land an additional $1M in ARR?"
Re: Cold Showers
#283Earlier quoted context omitted.
So in short, jump into a pool instead?
Instead of shower? No, you can't find a pool that cold. But I do always recommend jumping in to a pool all at once rather than wading in slowly.
Re: Cold Showers
#284Earlier quoted context omitted.
On the other hand it increases development time and makes modifications and new features much harder to implement. If you took it to the extreme, you could also mathematically prove your code is correct for every input variable. Everything's a trade-off, the question is which approach is best for your application. Your average website doesn't warrant as much rigor as a Mars rover.
Okay please debug my py2 -> py3 migration bytes vs strings code with no type annotations. Aaaahg it burns. I basically am going through and first annotating, then upgrading.
Interestingly enough, py2 was smart enough to automatically load things in the correct format. Loading a binary file? Get bytes. Loading a text file? Get a string. Py3 has worse functionality now, all for the sake of consistency.
Re: Cold Showers
#285Earlier quoted context omitted.
taps temple That's why you keep code encapsulated as much as possible in separate files/classes up to like a thousand lines. Any more will be unreadable anyway. > dynamic typing makes modifications and new features significantly harder to write Depends on what you're doing I suppose. Adding a parameter to an object? With dynamic typing you just add it to the object in literally any location, no issues. With static ty…
"serialization code"? Maybe it's an issue with Java. In Rust if I add a new field, I just wrap it in an Option. When de-serialized, old objects have a None, new objects with the field have a Some. When serializing it's just `Some (5)` instead of `5`, if it's an int. No runtime crashes from nulls, either.
Re: Cold Showers
#286Earlier quoted context omitted.
The Intel Xeon processors that cloud providers typically use don't have the Intel Quick Sync core that provides hardware A/V encoding/decoding on typical desktop/laptop CPU SKUs. So the software has to fall back to CPU-based codecs, which are much slower. AWS EC2 has a VT1 instance family that enables high-speed A/V encoding via a Xilinx media accelerator card.
IIRC Quick Sync encoded with poorer quality than software; is that not still the case?
Re: Cold Showers
#287Hype: Your friend says, "Good morning!" Shower: Unfortunately, there is no conclusive peer-reviewed evidence that it is, in fact, a good morning. A randomized trial found that many mornings are bad. Caveats: Only applies to mornings. No rigorous paper exists for evenings, so this remains an unknown.
Refutation: Any morning you're on this side of the grass is a good morning.
Re: Cold Showers
#288Earlier quoted context omitted.
I'd say it reduces bugs... in size, making them harder to find.
Reduces bugs in size, or only leaves smaller bugs behind? These are two very different outcomes. If the remaining bugs are unrelated to the class of bugs that were eliminated entirely, then the difficulty in finding them has little bearing on the outcome, since we’re now talking about an entirely different class of bugs.
- in JS, your code will run with the bug then do something catastrophic during runtime that you can then notice and trace to the core issue
- in Java it won't compile, so you fix it so it compiles and runs, then it'll hit you in like 2 hours of runtime with a NPE or something and you'll have no idea what caused it
Maybe Kotlin, Rust, and the like solve that sort of thing better but I've yet to be convinced.
Re: Cold Showers
#289Earlier quoted context omitted.
I agree that cloud compute is usually (too) expensive, but it is sometimes useful and cost-effective. Not long ago, I need to very quickly run a one-off analysis, which required over 200 GB of RAM. It was much cheaper and faster to spin up one VM on GCP for a day than having to order parts, etc.
Similar - wanted to see how much ram gron would need for a particular file and needed much more than the 16GB or 32GB available at home. Quick and easy to spin up a 192GB EC2 to verify it needed ~95GB all told. No way I could have done that without something like AWS.
Re: Cold Showers
#290IMO a lot of truths in programming are not amenable to "scientific studies". Static typing is objectively better than dynamic typing for the vast majority of cases, but you can't capture this in a scientific experiment or study. The only thing you can do is find people who are similarly experienced, break them up into groups (n=1 is also ok) and ask them to complete a specific project, and see how much time it takes.…
I present "The emotional argument for static typing". Static typing is good because dynamic typing measurably makes me sad. Therefore I want the company to use static typing.