HN user

gruffle

56 karma
Posts0
Comments26
View on HN
No posts found.
[GET] "/api/user/gruffle/stories?hitsPerPage=30&page=0": 500 Failed to fetch user stories

If the total number of bugs in dynamic and static code is the same.

Completely baseless assumption.

Yes, I'm an emulator author, thank you very much.

Ahahaha let's have a link then.

The registers and opcodes are typed with things such as u8, u16, u32, u64, i32, i64 and only work with data of the right type.

Those are sizes, not types, and the same opcode generally applies to signed and unsigned integers. You consider that to be a static type system and you think the purpose is performance and not correctness? Lol

You mean standard C stuff, you know the statically typed language.

You're trying to debate against the need for static typing by pointing out unsafe parts of c? Ahaha

That void pointer doesn't carry the information that it points to a picture of a cat for example.

First of all you can totally carry around runtime type info and value with a single void pointer. Not to mention many dynamically typed languages have type erasure and many statically typed languages have runtime type info. Also, you've claimed multiple times that there's no need for type checking whatsoever. You need runtime type information at runtime now?

E.g. if a function takes an interface as parameter type, you can create a dummy implementation which throw exceptions for any operation. So basically you have the same problem as you describe for dynamic languages

That's not at all the same problem, because here you're intentionally writing code that throws exceptions for some reason? Also, many languages, such as Java will not allow you to throw a checked exception that's not declared on the interface method - such issues will be statically checked and caught - thanks for proving my point ;)

of valid inputs and an infinite number of invalid inputs. But this is the same for statically typed languages, and the type-checker will not help you, since a valid JSON string and an invalid JSON string look exactly same to the type checker.

Not at all, in a statically typed language the JSON would typically be deserialized into a structured type with all the benefits of type checking, validation and usage of the resulting values. Of course it's possible to just use a JSON string directly, but that's not idiomatic and generally not the way it's done in quality codebases.

The comments in the article you linked dismantle most of the arguments made.

From one of the comments:

https://dev.to/aussieguy/the-non-broken-promise-of-static-ty...

The article covers a study of the same name. In it, researchers looked at 400 fixed bugs in JavaScript projects hosted on GitHub. For each bug, the researchers tried to see if adding type annotations (using TypeScript and Flow) would detect the bug. The results? A substantial 15% of bugs could be detected using type annotations. With this reduction in bugs, it's hard to deny the value of static typing.

Yes, I'm sure the LOAD instructions take pictures of cats as operands via their typeless instruction sets... What in earth are you on??

Have you written any assembly? Assembly generally has no or very rudimentary type checking, you're generally dealing with words/bytes and addresses, you can arithmetically add parts of strings, divide pointers, etc. Errors due to these operation will surface at runtime, not be typechecked.

well once someone does that let me know.

You can use void pointers as return types and arguments for all functions in c code. The effect is significantly less type checking while having equivalent performance.

You do it by checking that foo() actually works and provide the correct result.

But you're testing a tiny subset of possible scenarios of behaviour of the function. If you can anticipate all possible input types and value ranges, maybe unit tests are enough, but that's not realistic in a dynamic language/program where complex values are non-deterministically generated at runtime - based on user input, db, file, etc.

No, as I've pointed out - even in your trivial example you're not testing for all correct behaviour. What's the correct behaviour when the function is called with invalid argument types?

But if the tests verify that the output is correct, then it implicitly follows that the types are correct, so you get type checking for free.

Your unit test checks the correct behaviour for one out of infinite possible inputs. You don't 'get type checking for free' , what you get is no type checking at all.

I've got lots of experience in developing with both static and dynamically typed languages

And yet your comments demonstrate the opposite.

Dynamically typed languages tend to be simpler and easier to use.

Very debatable.

This means on the whole they have less bugs than their static typed counter parts.

Not at all.

The real issue with dynamically typed languages is that their performance sucks

Every time you say something like this it just makes it obvious you have no idea what you're talking about. You can write almost completely typeless, highly performant, c and assembly code, while high level languages with advanced type systems are generally not the most performant.

You seen to be confused about interpreted/jit/compiled languages and static/dynamic typing - which are not the same thing.

Sure, in this trivial example there may not be clear benefit, but with more complicated code, operations on complicated structures, with potential state changes, etc. there are many benefits. Even in your trivial example you don't cover the correctness or correct usage of your function - since it's dynamically typed it could be called with non-integer arguments - what's the expected behaviour in those cases?

'Buidling things with code' is not just coding. It can include design, architecture, collaboration, planning etc. There are many high quality, highly complex, open source projects that don't rely on many of the 'processes', meetings, toxic competiveness, thought-policing, and beuracracy found in AWS.

Based on your comment history (which is consists of about 0% technically interesting topics, and about 100% pro-amazon 'tales from a super-senior principal engineer guyyyss') tells me you don't like engineering, you like politics and beuracracy. Which is okay!

There is very little transparency as to how the polling data is used. I'm sure many employees don't feel comfortable giving honest answers on many of the questions. Also the surveys go far beyond tooling question - they ask about future career plans, happiness with the company, happiness with management, whether employees are interviewing for other jobs, etc. It's not hard to see how certain answers to those questions could color the responder in a very bad light from managements perspective.

Maybe so, but don't you think I talk to new employees?

Everyone below a certain level talks to new employees. Do I believe you take their concerns seriously and actively try to help? Based on my own experience with PEs as well as your comment history I think you absolutely do not.

In general my experience with PEs at Amazon led me to conclude that the vast majority of them are:

- entitled

- lazy

- egotistical

- less technically useful than the average l5 engineer

Everytime I bypass some stupid process or break glass, I now just put 'bias for action' as the reason. Ahahaha I don't give a shit anymore.

On my team we brutally introspect the value of every meeting, and if it looks like it's not delivering value, we find a new process

Oh yeah I love the multiple hours we have spend every week 'introspecting' processes, just to throw out one of the dozen we'd already defined and add another one. And this 'introspection' typically boils down to the loudest, most ambitious mouthbreathers forcing their BS down everyones throats so that they can jot down their amazing process contributions in their promo doc. Brutal is the right word.

Yup, and the other flipside is devs being extremely nitpicky and regurgitating irrelevant Amazon principles BS in code reviews because they're trying to get promoted.

Or you reach out to the owning teams/oncalls and half the time they have no idea how their own code/product works for anything nontrivial because most of it was written several generations of attrition ago.

Completely agree. Interesting how the internal dev satisfaction polling always shows that the vast majority of devs just absolutely love the internal tooling and processes. Might have something to do with the polls not actually being anonymous. When hr/polling teams are asked about anonymity they generally skirt or ignore the question, but I've learned that enough metadata is collected to identify any responder in pretty much any internal poll.