Better HN
topnewbestaskshowjobs
Log inSign up

ReflectedImage

476 karma · joined May 12, 2020 (6y ago) · 570 submissions

Submissions

comment 4y ago · link · parent

The interfaces do have types (and also proper versioning) but the internal code to the microservices does not.

comment 4y ago · link · parent

Most types can be inferred via your IDE, you generally get what you are talking about anyway for free.

comment 4y ago · link · parent

The issue is I know exactly what I'm talking about and you don't.

Errors that would be caught by static type checking are exceptionally rare when you do commerical development in dynamically typed languages.

You right now are complaining about a problem that only exists with inside your own head.

comment 4y ago · link · parent

Each line of that compiler only documentation increases the number of bugs in your code.

Bugs are directly proportional to total lines of code if you weren't aware

comment 4y ago · link · parent

The more modern solution is to break the large codebases into self contained microservices. In which case dynamic typing scales indefinitely.

I've worked on dynamically typed codebases for a long time. Passing the wrong type is very rare. I mean how would the code pass the unit tests if it was passing the wrong type?

comment 4y ago · link · parent

But generally speaking the code is only 1/3rd of the size. So you have a lot less to read.

The only place monkey patching is typically used is in places it has no effect on code meaning such as GEvent.

comment 4y ago · link · parent

I'm not sure how you intend to check the creation date of a string in memory since there is no information available to do that or that a tax return is valid given the thousands of rules involved.

Nevertheless let's move on.

It's not a myth, if you are using dynamic typing you will get three times the number of features out the door as someone who uses static typing.

It's just a fact.

1 dynamic typed programmer = 3 static typed programmers in productivity and output.

That is why people use dynamic typing.

From a commerical perspective, static typing does not make sense in most cases. You need something more than a typical business CRUD app to justify it. Usually you only need static typing for performance reasons. Like for a video game or image processing.

In practice, the shipped code doesn't have noticably more bugs. That just something which people who have never used dynamic typing properly like to believe.

If you ever read an article by Eve online where they say Python is their secret weapon or watched what Discord did by implementing everything in Python first. You will understand.

comment 4y ago · link · parent

If you pass the wrong input values to a function, it will in 99% of all cases give you the wrong result, throw an exception, etc.

Passing the wrong type is considerably rarer than the wrong value so need not be considered.

Well one programmer using dynamic typing can deliver the output of three programmers who use static typing.

That why people use dynamic typing, from a business perspective it's a far more compelling argument than the one you are making.

comment 4y ago · link · parent

A correctness check so quick, it didn't check correctness at all.

That is not how to decrease the complexity of reasoning about a Python program.

What you should do instead is break the program up into smaller microservices.

comment 4y ago · link · parent

Unless you are using Haskell or Rust then static typing is a terrible way to check if your program is correct.

You need unit tests to confirm the correctness of your program. And unit tests check most of the types for free. So you don't need static typing after all.

comment 4y ago · link · parent

That's just a less likely case of giving a function the wrong input values, which is also undefined.

So no it's not much worse than usual.

comment 4y ago · link · parent

Then static typing is merely a terrible set of unit tests not worth implementing.

comment 4y ago · link · parent

Why "strong static typing" in particular? Surely there are many other things that could help.

comment 4y ago · link · parent

I'm not sure many languages support the introduction of types such as:

* An integer that is sum of two primes.

* A string that is created between the hours of 2 pm - 4 pm on a Tuesday.

* A dictionary who's fields comprise a valid tax return.

What do you mean by future proving? If the new version of the code doesn't ship by 2 pm today, the company goes bankrupt and there is no future for the code.

comment 4y ago · link · parent

Personally I do both. If I'm using a scripting language like Python I'm all for dynamic typing and if I'm using a programming language like Rust I'm all for static typing.

They are different development experiences, one isn't better than the other. If you want to ship something to market tomorrow use Python with dynamic typing. If you want something to run fast and be error free use Rust with static typing.

Both are good options.

comment 4y ago · link · parent

Static typing create a lot of code bloat, helper types, classes, abstract interfaces and all the sort.

The increase in the code size usually results in significantly more bugs in the code.

Number of bugs is directly proportional to the number of lines.

The better way is to use unit testing instead.

comment 4y ago · link · parent

In practice, the function will be called indirectly via an API with types and there will be at least 1 unit test.

Therefore the scenario is ridiculously unlikely and lives in the realm of fantasy.

comment 4y ago · link · parent

Static typing on its own is very bad at finding errors.

Static typing is something you use for performance reasons primarily.

If you want to catch errors with static typing you need Haskell or Rust levels of support for it. C# / Java / C++ don't make the grade.

comment 4y ago · link · parent

You can have a catch all exception handler that emails any exceptions that occur to you.

It's not pretty but it can be done. :P

comment 4y ago · link · parent

Let me add a 3rd.

3. The program is incorrect but correct for all expected end user inputs.

comment 4y ago · link · parent

The issue ReptileMen is that Elon Musk DID NOT land any rockets, hell he didn't even setup SpaceX. He just brought his way into SpaceX. Elon Musk's one true achievement is PayPal, nothing more, nothing less.

comment 4y ago · link · parent

Most people do less in the office.

comment 4y ago · link · parent

Then you don't really understand startups at all.

comment 4y ago · link · parent

Well when Twitter envitably collapses due to tech reasons, legal reasons or it just plain goes bankrupt.

And given that a lot of companies have already been forced to back down on back to the office.

Yes, who holds the power will be clear for all to see.

comment 4y ago · link · parent

It isn't the norm outside of the USA

comment 4y ago · link · parent

Most major stores and chains are willing to sell stolen goods.

comment 4y ago · link · parent

Frontend developers are very hipster following the latest trends. Unless you are building Facebook (or something equally complex), there is little reason for most of that stuff.

comment 4y ago · link · parent

Eeny meeny miny mo

comment 4y ago · link · parent

It's not too early, there are already cracks appearing in Twitter.

comment 4y ago · link · parent

"still up afterwards" No, it's crumbling as we speak. You can get pirated movies from Twitter now, for example.

It's microservice based site features will break one by one.

1
131415
19