gnus_migrate

joined 1 year ago
[–] gnus_migrate@programming.dev 0 points 1 year ago (1 children)

It was my mistake, I said that we definitely know they don't vs. there is no evidence showing that there is. There aren't much studies to back this up. The whole point of the talk is that software engineering as a discipline is really poorly studied and we tend to make assertions like this without actually validating them.

If I was betting money on this(I.e. deciding where to focus my investment), the quality of the typesystem would only matter if the typesystem caught real problems that I face in my day to day work. For a Web app for instance, it makes no sense to use Rust vs a GC'd language because the kinds of bugs that you face in Web apps aren't really the kinds of issues that a borrow checker will help you with. The whole point of Rust being difficult is that it saves you time down the line, if it's difficult and it doesn't then that tradeoff doesn't make sense.

Hilel teaches formal verification for a living, he very much sees the value of automatically proving properties about your program, as do I, but the reality is that the typesystem doesn't necessarily help as much as we think it does.

[–] gnus_migrate@programming.dev 1 points 1 year ago* (last edited 1 year ago) (1 children)

There's a difference between tests and assertions. Students do test their code, however they don't write assertions, as I said because you want the cognitive load to be as low as possible so that they can master the basics. I'm fine with tests being provided to them, however they should be focusing on learning the constructs at the start.

In any field, the real life practice of a profession is something you learn working for an actual company, whether it's through an internship or an entry level job. Ideally there should be unions or syndicates setting these standards so that they're consistent across the field, just like with other knowledge based professions.

Universities are not corporate training programs, and they aren't supposed to be.

[–] gnus_migrate@programming.dev 0 points 1 year ago (3 children)

By the way, what you claimed “research shows” is so ridiculous that it’s hilarious that you wrote it while being serious.

There is still no research that definitively shows that static types reduce defects more than dynamic types, this is a fact. Turns out we are incredibly bad at studying this, so I don't know how you can say definitively that it is the case when even the people who study this for a living are not able to make that case.

The thing is the way they motivate new students to learn programming is by having them write programs that do something. Making a test green isn't as motivating as visually seeing the output of your work, and test fixtures can be complex to set up depending on the language. I mean students don't learn how to factor their code into methods until later into such a course, they're learning if statements and for loops and basic programming constructs. Don't you think having to explain setting up test fixtures and dependency inversion is a bit too much for people at that level?

[–] gnus_migrate@programming.dev 0 points 1 year ago (5 children)

https://youtu.be/WELBnE33dpY

It's not that there is evidence that it doesn't matter, but there is no evidence showing that it does.

[–] gnus_migrate@programming.dev 0 points 1 year ago (7 children)

A good language matters. A good type system matters. A good use of a good language with its type system, patterns, abstractions, ecosystem, and all it got to offer matters.

Eh research shows otherwise. Rust eliminates defects for a very particular set of problems, but when it comes to logical correctness it isn't better or worse than other languages. If those problems are prominent in your domain(such as you have to write a ton of concurrent code), Rust makes sense. Otherwise being well rested will have a bigger impact on the quality of your code than the best type system in the world.

In terms of dev practices, the only practice demonstrated to have a consistent positive impact on code quality is code reviews. Testing as well, but whether it's TDD or other kinds of testing doesn't really matter.

[–] gnus_migrate@programming.dev 3 points 1 year ago (5 children)

If you wanted to introduce every industry best practice in an intro course you'd never get to the actual programming.

It would be good to have a 1 credit course(one hour a week) where you learn industry best practices like version control, testing and stuff like that. But it definitely shouldn't be at the start.

The difference is that you can't have a generic mechanism in Go for error handling. It's basically up to the programmer, and every if error != nil line is a potential source of bugs.

[–] gnus_migrate@programming.dev 4 points 1 year ago (3 children)

I went into this with an open mind, then I saw the rant about error handling and I closed the article immediately.

Rusts error handling in combination with eyre/anyhow is the most pleasant error handling I have used in any language. You know exactly which lines can return errors, you can very quickly propagate them and attach context so that you can quickly troubleshoot later on, and it's completely natural and unintrusive. No figuring out whether you already logged the error somewhere else, no inconsistent handling of them, it's one library that does everything for you and you never have to think about it.

The go example is comparatively awful. You are forced to handle the error at each stage, and it runs into the same problem as exceptions where you're not really sure at which point you actually handled the error among other things.