Live data from Hacker News

Cold Showers

github.com

241–250 of 363 posts

Re: Cold Showers

#241

> Static Typing reduces bugs. At least to me, the big advantage of static typing is not that it (allegedly) reduces bugs, but that it aids my understanding and helps in navigating the program. It's a tool for thinking and communicating.

I'm not against studies and research - I have a computer science degree myself - but I'm a little tired of being told my personal anecdotal evidence is not sufficient to conclude that water is wet. As a professional software developer of 30+ years, the doubts on static types puzzle me. 8 years ago, I started dabbling more in javascript, for one of my continuous pet projects. I had it running and grew it to a considerable size, but after a year or two, I lost patience with debugging runtime issues, hunting for where I had forgot to update or initialize or remove stuff, during refactoring. I swore an oath never to use raw javascript again, and rewrote it from scratch in typescript. I am still working on it to this day, and I don't remember being angry at typescript a single day in the intervening 7 years.

My working day jobs have been mostly C++, and these days C#. Periodically, I will temporarily inherit some of my younger colleagues' projects, if they move on to greener pastures in different companies, with the charter of "can you do something about the long-running issues this software has been having?" My go-to solution is to go through their typescript and add return types to their functions, and replace their anys with interfaces. After having done that, I fix the bugs that revealed, and then I'm usually done. Recently when I did that, I came across a central class/data structure, which turned out to exist in no less than 5 slightly different variants. i.e. different parts of their code adhered to 5 different assumptions about what fields would exist and be populated (but all expressed on the blank canvas of 'any').

Re: Cold Showers

#242

> Hype: "Identifiers should be self-documenting! Use full names, not abbreviations." > Shower: Researchers had programmers fix bugs in a codebase, either with all of the identifiers were abbreviated, or where all of the identifiers were full-words. They found no difference in time taken or quality of debugging. That's a very weird take on the statement. The downside of using abbreviations is probably dominated by the…

People nearly always gravitate towards abbreviations in natural language. The more a word is used, the more likely it gets shortened. LA for Los Angeles, Frisco for San Francisco, Vicki for Victoria, Jay for Jason, Dub for George W Bush, Doozy for Duesenberg, and on and on. Why should programming be different?

Abbreviations that are widely understood are fine. sql_string is superior to standard_query_language_string. On the other hand, I would prefer customer_id to cid in most cases.

Re: Cold Showers

#243

Earlier quoted context omitted.

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…

Valgrind finding use-after-free is a dynamic analysis.

Re: Cold Showers

#244

> Static Typing reduces bugs. At least to me, the big advantage of static typing is not that it (allegedly) reduces bugs, but that it aids my understanding and helps in navigating the program. It's a tool for thinking and communicating.

I'm not against studies and research - I have a computer science degree myself - but I'm a little tired of being told my personal anecdotal evidence is not sufficient to conclude that water is wet. As a professional software developer of 30+ years, the doubts on static types puzzle me. 8 years ago, I started dabbling more in javascript, for one of my continuous pet projects. I had it running and grew it to a consider…

No post body was provided.

Re: Cold Showers

#245
post #75

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

There appear to be slightly weird commercial reasons behind this, because gaming GPUs have great CUDA performance but NVIDIA won’t let you put them in a datacentre. So buying your data scientists gaming laptops (RGB and all) generally works out faster for any reasonable price point. That said, a dedicated server with a decent Xeon and MKL set up correctly generally outperforms CPU-bound stuff.

What prevents gaming GPUs from being used in a data center? Is there some licensing restriction?

Re: Cold Showers

#246

Earlier quoted context omitted.

As a clojure programmer, I'd say the same of Haskell. Oop is less expressive than FP, and static typing is less expressive than dynamic typing. These are usually just tradeoffs people choose for their problem domain

> static typing is less expressive than dynamic typing Here's something I can express with static typing that I can't express with dynamic typing: "this function returns a function which returns an integer for every input". There's no test you could write to verify this property. So I'm inclined to say that static typing is more expressive, since it gives me a way to express and verify properties like this.

clojure spec will do this in the way you're asking.

Re: Cold Showers

#247

> Static Typing reduces bugs. At least to me, the big advantage of static typing is not that it (allegedly) reduces bugs, but that it aids my understanding and helps in navigating the program. It's a tool for thinking and communicating.

I'm not against studies and research - I have a computer science degree myself - but I'm a little tired of being told my personal anecdotal evidence is not sufficient to conclude that water is wet. As a professional software developer of 30+ years, the doubts on static types puzzle me. 8 years ago, I started dabbling more in javascript, for one of my continuous pet projects. I had it running and grew it to a consider…

I think we need to be careful with trusting even our own anecdotal evidence because it's simply riddled with biases and bugs. 30+ years of experience is certainly impressive but I'd say you probably never worked in a senior team on a larger Clojure codebase for example which would give you quite the opposite impression. You should read the anecdotal evidence in that community, it's very different.

Re: Cold Showers

#248

> Static Typing reduces bugs. At least to me, the big advantage of static typing is not that it (allegedly) reduces bugs, but that it aids my understanding and helps in navigating the program. It's a tool for thinking and communicating.

I'm not against studies and research - I have a computer science degree myself - but I'm a little tired of being told my personal anecdotal evidence is not sufficient to conclude that water is wet. As a professional software developer of 30+ years, the doubts on static types puzzle me. 8 years ago, I started dabbling more in javascript, for one of my continuous pet projects. I had it running and grew it to a consider…

> [...] I'm a little tired of being told my personal anecdotal evidence is not sufficient to conclude that water is wet.

The problem is, other people with just as many credentials as you have the opposite experience. From an outsider's perspective, two people with equal authority say opposite things, what can they possibly do except an independent study?

Also, note that there's a reason anecdotal evidence is not always reliable. E.g. the famous story about fighter pilots and the "regression to the mean" hypothesis.

Re: Cold Showers

#249

Earlier quoted context omitted.

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

> 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.

You clearly have little experience with such languages, then.

Re: Cold Showers

#250

Earlier quoted context omitted.

I'm not against studies and research - I have a computer science degree myself - but I'm a little tired of being told my personal anecdotal evidence is not sufficient to conclude that water is wet. As a professional software developer of 30+ years, the doubts on static types puzzle me. 8 years ago, I started dabbling more in javascript, for one of my continuous pet projects. I had it running and grew it to a consider…

Quoted post unavailable.

JavaScript is a fantastic language once you understand how it really works. If you do truly understand the language then maybe you should use something that compiles to JS.
Post reply on HN