Live data from Hacker News

Cold Showers

github.com

151–160 of 363 posts

Re: Cold Showers

#151
post #148

Earlier quoted context omitted.

I am curious for why people say this as in my experience when writing a function in a dynamic language that takes a variable as a parameter: The function will generally only work on a subset of types for given variable. If I don't check the type of the variable in the function, the function will not behave as you might expect, e.g. silently fail or crash. If I do check for every possible type for a given variable: I…

> The function will generally only work on a subset of types for given variable. This is true for many functions defined in statically typed languages too. Just because your function says it works with an integer, doesn't mean it's necessarily going to work with _any_ integer (think `1/n`). Very often the type used isn't narrow enough. Modern dynamic languages understand this, see for example Clojure's spec[1]. [1] h…

I like libraries and languages that create a bunch of types which are essentially just renaming existing types. So you'll have a type PostID which is just an int but the language won't let you give a PostID to a function that takes UserID even though its both just integers.

Re: Cold Showers

#152
post #144

> Hype: "Identifiers should be self-documenting! Use full names, not abbreviations." Most names aren't particularly good - especially when someone tries to make them sound like a full sentence. My experience is that at around four words they start getting less accurate. At seven I would probably read more from an interpretive dance about the function in question.

And a java observerFactoryVisitorInstanceBuilder is like a total nerd with no rythym trying to dance to hip hop

Re: Cold Showers

#153

Earlier quoted context omitted.

Are you sure all statically typed languages are slower to develop in than comparable dynamic ones? I used to be thoroughly convinced this was true, but 3 things are now making me doubt it: 1) Statically typed languages with inference don’t require time spent writing signatures. 2) I know I’ve spent time chasing down bugs in dynamically typed software that would have been caught by a type checker. 3) I also know I’ve…

> 1) Statically typed languages with inference What are some strong examples of this? Haskell does an amazing job with it. Java technically supports some amount of inference, but it doesn’t reduce verbosity by all that much. Apart from those I haven’t run into it.

Swift and Kotlin both do a fantastic job here. You think in types but don’t have to spend much time typing them.

Re: Cold Showers

#154

Earlier quoted context omitted.

Are you sure all statically typed languages are slower to develop in than comparable dynamic ones? I used to be thoroughly convinced this was true, but 3 things are now making me doubt it: 1) Statically typed languages with inference don’t require time spent writing signatures. 2) I know I’ve spent time chasing down bugs in dynamically typed software that would have been caught by a type checker. 3) I also know I’ve…

> 1) Statically typed languages with inference What are some strong examples of this? Haskell does an amazing job with it. Java technically supports some amount of inference, but it doesn’t reduce verbosity by all that much. Apart from those I haven’t run into it.

Haskell and PureScript are the ones I’ve used.

Re: Cold Showers

#155

> Benchmarking cutting-edge graph-processing algorithms running on 128-core clusters against a single-threaded 2014 Macbook Pro. The laptop consistently wins, sometimes by an order of magnitude. LOL, this hits close to home. My company had a modeling specific VM set up to run our predictive modeling pipelines. Typical pipeline is about 50,000 to 5 million rows of training data. At best, using an expensive VM, we mana…

My rule-of-thumb is that if you have less than a terabyte of data, you're better off processing it locally, and even that is pretty conservative. Big data is for when you have problem sets that simply will not fit on a single machine. With 4TB hard drives going for about $60, a lot of problems are better solved by simple algorithms in efficient programming languages on a single box.

There are some data sets where you really do need big-data tools, but it's for when you have petabyte-scale data, not megabyte/gigabyte-scale data.

Re: Cold Showers

#156

Earlier quoted context omitted.

Hard disagree. Dynamic typing only increases development speed for the first few thousands lines of a solo programmer project. After that it is, in my personal experience, a significant drag on development speed. Furthermore, dynamic typing makes modifications and new features significantly harder to write. Turning compile-time bugs into runtime bugs is a catastrophic decrease in development speed. That’s my personal…

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…

My personal hell is having some nested objects/dictionaries and wanting to either add or remove a layer. Good luck and God speed in your attempt to simply find every single line of code that needs to be updated.

Re: Cold Showers

#157
post #84

For me the biggest advantage of static typing is that it allows to safely refactor code. Without it even with extensive unit test coverage refactoring often is just not an option.

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

I have done multiple times both refactoring of untyping JS and JS fully typed with Flow. With the latter after the Flow compiler stopped complaining one can expect things to work. With the former despite extensive tests sometimes it took weeks to fix bugs caused by the refactoring.

Granted this is personal experience and I may be simply not careful enough to do untyped refactoring, but few people I talked about that shared the experience.

Re: Cold Showers

#158
post #8
post #3

Hype: Cold showers are good for you (good stress) Shower: keybored, your shower is not cold enough to induce stress and you are too lazy to modify the showering experience in any way Caveats: Other people may be anti-lazy enough to modify the showering experience Notes: Check yourself

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 thousand years

Re: Cold Showers

#159

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

Does your JavaScript require higher test coverage to achieve the same level of safety?

Hard to measure, the javascript I worked with was mostly front-end, which is harder to write automated tests for. Not impossible, but the higher friction naturally leads to less tests, especially given how frequent the front-end changes. "Level of safety" would also need better quantification. Something that a peer-reviewed study would be better suited for

Re: Cold Showers

#160

Earlier quoted context omitted.

The way to start cold is to stick your head/face directly in to start the shower. That gives you the strongest mammalian dive response. Not sure if that offsets any of the cold shower benefit though. https://en.m.wikipedia.org/wiki/Diving_reflex Edit: This is also the time of year to do this, while the tap water is probably warmer and your house is warmer. I wouldn't try to acclimate in winter.

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