Live data from Hacker News

Cold Showers

github.com

231–240 of 363 posts

Re: Cold Showers

#231

Earlier quoted context omitted.

Language engines exist for Python and Ruby (and Lisp, etc.)as well, and they handle autocomplete and refactoring quite handily.

How would a "language engine" know what you can do with `item` if it has no type information? You can do that with Python (sometimes) because many libraries have type hints today, so even if you don't use types yourself, the type checker can infer them in your code and help you out.

Is this a serious question? Code analysis (both static and dynamic).

The same way Rust checks for object lifespans with the borrow checker, which is distinct from the compiler and type system.

The same way valgrind for C can check for use after free.

The same way errorprone can look for null checks in Java.

This is a well tested and proven technique. Static code analysis is a staple of the industry, when it comes to automated code analysis.

Re: Cold Showers

#232
post #8

Earlier quoted context omitted.

Most Times I can't bring myself to get into a cold shower. If I start warm I can cool down from there. Is there a way to start cold and go even colder?

For these people that claim taking cold showers, I want water temp. Out of the tap, in summer, my water is 53 degrees (f), upper 40s in winter. I'm not sure I could get through a whole shower sans hypothermia. Edit: looked it up. 30min-2hr for hypothermia at that range. Typically I take a 15-20 minute shower, so only flirting with hypothermia. I love a hot, hot shower. Best advancement in technology in the last thous…

My showers are about five minutes, a habit from growing up on tank water during a drought. Water on, jump in, wet your hair, soap, shampoo, wait a minute, rinse, conditioner, wait a minute, rinse, jump out. Cold showers are great motivation to be even faster.

Interestingly, one of the theories behind why cold showers might be good for you is that they induce a heat shock response, same as a very hot shower.

Re: Cold Showers

#233
post #62

Earlier quoted context omitted.

It’s basically self-evident that static analysis reduces bugs. It’s trivial to construct an example of where type information would catch a bug. Unless there is some reason that including type information increases bugs, the existence of a single example where type information catches a bug would prove that overall type information reduces total bug count.

> It’s basically self-evident that static analysis reduces bugs. And yet, per TFA, it’s not; at a minimum it’s clearly not “self evident”. Why do we developers value our personal experience above studies, while dunking on average citizens for doing the same? Guess we’re just as human as the rest of humanity; subject to the same urge to trust our own beliefs over contrary evidence.

As a general rule for dev work, trying to make evidence based decisions is fairly difficult. There's just not that much evidence around yet that can make it obvious as to if in your particular situation what the best choice might be.

And at the end of the day you have to contend with being in a work environment where politics and personalities rule, not science (or engineering).

That said I do wish more devs would take an interest in the available quality literature. Unfortunately I'm far more likely at work to run into an Uncle Bob recommendation at work, than a recommendation of ACM's Digital Library.

Re: Cold Showers

#234
Overall a questionable list of unproven claims. E.g.:

> Hype: "Static Typing reduces bugs."

Just because the author has not found proper research proving it doesn't mean it's false.

A great type system with sum types prevents tons of bugs. I wonder how anyone can question this.

> Hype: "Identifiers should be self-documenting! Use full names, not abbreviations."

Same as above. To fix bugs you need to read and understand the code. Not having to map abbreviations to your mental model reduces overhead. I've seen code bases where u was used as an abbreviation for user and users in different methods. That was not a fun code base.

Re: Cold Showers

#235

Earlier quoted context omitted.

It is not evident to me. Having used both statically typed and dynamically typed languages my experience is that I can't remember ever seeing a bug in our fairly large rails app that a type system would catch. Nobody's passing strings where hashes are expected, or Widget instances where User instances are expected. The thing to pass to the function is nearly always self evident. If you did it would immediately be cau…

If you search your exception tracker for NoMethodError in production, do any results come up?

Yes - in every case it is calling a method on a null reference. And no commonly used statically typed language helps here because they all allow null references. And languages that disallow nulls, if you are one of the 10 programmers on earth working in one of those languages, don't help you because you are dealing with real world data where inputs to your system can be null or not so you end up using some type system escape hatch anyway.

Re: Cold Showers

#236
post #123

Earlier quoted context omitted.

I've never found static typing to aid in my understanding of a program. For example: def add_item_to_cart(item) vs void add_item_to_cart(IItem item) They are equally easy to understand. The first is easier to read.

What is an item in the first declaration? Is it an id? Is it an object (if so, what type of object? Id and qty or some other data)? I guess you now need to read through the implementation or docs. The first is much easier to read incorrectly .

If it were an item id the argument would be item_id. It is an object. What type of object? The type that can be added to a cart. You don't just drop a programmer into the code and have them call a function in a vacuum. Nobody just throws random objects at a function. They are familiar with the code in general and they know what to do.

Re: Cold Showers

#237

Earlier quoted context omitted.

I've never found static typing to aid in my understanding of a program. For example: def add_item_to_cart(item) vs void add_item_to_cart(IItem item) They are equally easy to understand. The first is easier to read.

Depends on the specifics, but i'm betting if `IITem` is close by i know how to interact with it. I have no clue what the hell fields or methods may or may not be on `item`. Nor will i, ever. At best i have to enforce method/fields myself, at worst i subscribe entirely to duck typing and let the gods sort it out.

s/gods/tests/ - which you need even in a statically typed system.

Re: Cold Showers

#238
post #220

Earlier quoted context omitted.

So many people in the thread saying this. But in my experience refactoring large code bases in both Java and Javascript, it's roughly the same. Ultimately the real answer will have to come from a peer reviewed study, because as the post suggests, these sorts of things are not as intuitive as people think

Java does not have anything like strong typing. Likewise C. Results comparing to Java or C are intrinsically useless and actively misleading. Studies insisting static typing has no effect always assume the runtime-typed program is less buggy than it really is.

How are you defining strongly typed here? Wikipedia says the definition is loose [1] but also says that Java is usually considered stronger than many other languages

[1]: https://en.wikipedia.org/wiki/Strong_and_weak_typing

Re: Cold Showers

#239

Earlier quoted context omitted.

What if my company is pretty much all engineers? We don't let pencil pushers with MBAs anywhere near what we're doing, and it's going great. I know this isn't the most usual configuration but if undervaluing my skills and trying to bottom dollar on them is going to be their rules, then I'm just going to do my own thing, and they're just going to have to scrape the bottom of the barrel for talent. I hope the zeitgeist…

> What if my company is pretty much all engineers? I don't know how that changes the equation. No one is undervaluing your skills; it's would you rather spend your time driving to a colo center to replace a RAID array or working on $product. With AWS you are outsourcing an IT team, not just processors and how you approach pricing should reflect that.

I hear this bad argument often (“replacing hard drives”) and I don’t understand why. It’s as if we’re mentally stuck in a bad hacking movie from 1999.

If you’re doing colocation to save money, you’ve also figured out that going to the datacenter sucks and it’s a terrible place to do work.

You’re not building your own servers from scratch, you’re generally purchasing them from a vendor who offers a warranty and optional on-site service.

Or you’re leasing them from a hosting company who will take care of those pesky RAID alarms for you.

You (or your hosting providers) have likely outfitted your server with remote out-of-band access to allow you to get into BIOS or the RAID controller without physically being in front of the server.

And finally, you have remote access to power cycle the server (or a batphone at your hosting provider to do it on your behalf).

I want to say that these datacenter-visit-prevention techniques have been near standard practice for a decade-and-a-half.

Or is it just me and my circle that do this?

Re: Cold Showers

#240

Earlier 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…

I don't use AWS for a damn thing because of exorbitant costs. I just don't get why people think that it's necessary other than that they're the types to get drawn into marketing hype. There's just so many better things for your company to be spending the money on.

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.
Post reply on HN