News for hackers. Stuff that matters.
Re:38% of bugs at Airbnb could have been prevented by using ... by ajxs on Sunday February 10, 2019 @09:22PM (#19131595)
There's been some discussion regarding what these Javascript devs are calling "The Typescript Tax" ( Presumably the perceived increased cost of development in a statically typed language ). What greater 'tax' could you possibly conceive of than a whopping 38% of your development time on an enterprise product being spent debugging problems caused by type inference/coercion? You can directly quantify the costs, and it'd probably make management's heads spin. Surely Node.js is going to be looked back upon as one of the worst mistakes in the history of 21st century programming.
Re:38% of bugs at Airbnb could have been prevented by using ... by josephg on Sunday February 10, 2019 @09:58PM (#19131731)
> What greater 'tax' could you possibly conceive of than a whopping 38%

I always find it fascinating looking at the number of lines of code which do the same thing in different languages. Foundationdb maintains official bindings in Java, Go, Ruby and Python. The implementations have almost complete feature parity. They're all maintained by the same team, and as far as I can tell they all follow best practices in their respective languages.

The sizes (minus comments and blank lines) are[1]:

Python: 4053

Ruby: 2397

Go: 3968

Java: 10077

38% seems like a lot but language expressiveness dominates that. If ruby and java code were equally difficult to write, you'd be paying a 320% tax moving from ruby to java for an equivalent program.

I'd love to see a "programming language benchmark game" that only allowed idiomatic code and compared languages based on code length.

I have no idea what the equivalent size ratio is for javascript and typescript, but having worked with both, I find typescript projects end up bigger. I write more typescript because the type system and the tooling encourages verbose and explicit over terse and clever. (In typescript I end up with more classes, longer function names and fewer polymorphic higher order functions).

The typescript tax is real. That said, I believe the defect rate increases by 38% too. Depending on what you're doing the tax might be worth it.

[1] Measured from commit 48d84faa3 using tokei "code lines". Includes JNI binding code and makefiles, but not documentation

Re:38% of bugs at Airbnb could have been prevented by using ... by threeseed on Sunday February 10, 2019 @10:08PM (#19131767)
Java size has nothing to do with types and everything to do with the language.

Look at a file like this: https://github.com/apple/foundationdb/blob/master/bindings/j...

You have equals, hashCode, toString which are all uncommon in other languages.

Re:38% of bugs at Airbnb could have been prevented by using ... by josephg on Sunday February 10, 2019 @10:55PM (#19131941)
> Java size has nothing to do with types and everything to do with the language.

Yes. I'm making two claims. First to disagree with the GP's claim that a 38% difference between languages was 'whopping':

> What greater 'tax' could you possibly conceive of than a whopping 38%

The fact that the type system isn't entirely to blame is also clear looking at the ruby and python sizes. Ruby and python have very similar type systems, but the ruby code is only about half the size of its python equivalent.

My second claim is that if we did the same comparison with javascript and typescript, typescript would be bigger. I don't have any stats for this though - just lots of experience. The type system seems to push code in a bit more of a classical OO direction because there aren't higher kinded types, associated types, or any of that fun stuff.

As others have said it'd be fascinating to compare typescript and purescript / elm codebases. I'd expect the haskell-derived languages would come out way ahead on expressiveness. Its constantly surprising to me that we don't have any actual numbers.

Re:38% of bugs at Airbnb could have been prevented by using ... by scrollaway on Monday February 11, 2019 @12:01AM (#19132198)
> First to disagree with the GP's claim that a 38% difference between languages was 'whopping'

??? You're comparing LOCs and number of bugs. That 320% larger java code might have 50% less bugs and may have taken 50% less time to write. Terse code is harder and usually takes longer to write than expressive code.

Re:38% of bugs at Airbnb could have been prevented by using ... by james_s_tayler on Monday February 11, 2019 @01:22AM (#19132459)
When writing in Ruby the "what the hell is this object I'm dealing with here and what methods does it have available?" Tax is like 320% for me. I love Ruby. It's so much fun and it's just neat in general but I find it much more taxing than a nice statically typed codebase I can navigate and reason about with ease.

Everything is just taxed differently. No such thing as duty free programming.

Re:38% of bugs at Airbnb could have been prevented by using ... by voidhorse on Sunday February 10, 2019 @10:48PM (#19131915)
Is LOC really a significant measurement? Sure you have to type more characters when working with a strictly typed language, but that takes a couple of seconds opposed to however long it might take to track down a bug in a massive enterprise system. Not to mention the type system often forces you to consider cases you might otherwise overlook when writing dynamic code, hopefully resulting in better code to begin with—it imposes a bit of discipline.

In my opinion whatever perceived tax a type system entails is superficial—sure, coming from a dynamic language, having to specify types for everything seems like taking on an extra chore—but this is just the surface experience of using a type system—once you’ve used one for a while and furthermore, had the benefit of reading typed code, you really start to appreciate having types around and any so called “tax” involved quickly becomes negligible.

While it might be a “tax” when writing code it’s defintely a boon when reading code—it’s much faster to look at types to get a handle on an api than it is to have to dig through and read the actual implementation to try and decipher what exactly a function expects and returns. When using a Haskell library, for example, I rarely ever have to read documentation extensively or read implementations—looking at the types of functions and a brief description (one sentence) is often sufficient. It takes a couple of seconds. This is the norm with Haskell code. Contrarily, this is an exceptional case for dynamic languages—if the documentation isn’t superb you always wind up having to peek at the implementations at some point—this typically takes longer than glancing at types and a one sentence description.

Dynamic languages might be more “expressive” from a writers perspective (since you can leave out types) but they’re far from expressive from a readers perspective—since the writer convenience often puts the onus of sussing thing out on the reader. In enterprise systems, reader convenience is arguably more important.

Re:38% of bugs at Airbnb could have been prevented by using ... by dmitriid on Monday February 11, 2019 @04:12AM (#19133033)
> Is LOC really a significant measurement?

It is. Number of bugs per line of code is nearly the same across languages. So the best way to reduce bugs is to reduce LoC

Re:38% of bugs at Airbnb could have been prevented by using ... by kurtisc on Monday February 11, 2019 @06:17AM (#19133613)
>Number of bugs per line of code is nearly the same across languages.

Has this been studied?

Re:38% of bugs at Airbnb could have been prevented by using ... by dmitriid on Monday February 11, 2019 @09:23AM (#19134630)
I can't give a more complete answer than this SO answer: https://softwareengineering.stackexchange.com/a/185684 :)
Re:38% of bugs at Airbnb could have been prevented by using ... by kurtisc on Monday February 11, 2019 @10:03AM (#19134894)
15-50 being quite a big range and the 2004 publication date of the book (the comments hint at the reference being earlier) make me reluctant to take it at face value without looking into it in more depth, especially regarding new technology like TS, Rust, or enterprise Haskell.
Re:38% of bugs at Airbnb could have been prevented by using ... by dmitriid on Monday February 11, 2019 @10:37AM (#19135151)
Read it as 1.5-5% of lines contain bugs.

In the original post AirBnB said 38% of their bugs could be prevented by static typing. This would bring this to 0.9-3%. Not insignificant, but LoC is still more important.

Re:38% of bugs at Airbnb could have been prevented by using ... by zihotki on Monday February 11, 2019 @04:43AM (#19133169)
1-line Perl programs are looking at this comment with approval.
Re:38% of bugs at Airbnb could have been prevented by using ... by m45t3r on Monday February 11, 2019 @06:05AM (#19133558)
> 1-line Perl programs are looking at this comment with approval.

1-line Perl programs are far from being representative of real systems and generally only exists for code golfing.

Re:38% of bugs at Airbnb could have been prevented by using ... by okal on Monday February 11, 2019 @06:57AM (#19133772)
[Citation Needed]?
Re:38% of bugs at Airbnb could have been prevented by using ... by dmitriid on Monday February 11, 2019 @09:23AM (#19134631)
I can't give a more complete answer than this SO answer: https://softwareengineering.stackexchange.com/a/185684 :)
Re:38% of bugs at Airbnb could have been prevented by using ... by dunefox on Monday February 11, 2019 @08:27AM (#19134269)
> Sure you have to type more characters when working with a strictly typed language

You might be interested to hear about type inference.

Re:38% of bugs at Airbnb could have been prevented by using ... by im_down_w_otp on Sunday February 10, 2019 @10:04PM (#19131757)
I expect that Java codebase isn't comparatively enormous due to types.

Do they have a Haskell or OCaml client? I'd expect them to be fairly terse and have even better compile-time and run-time guarantees.

Re:38% of bugs at Airbnb could have been prevented by using ... by melling on Sunday February 10, 2019 @10:33PM (#19131856)
Haskell has the reputation that if it compiles, it works.

Whether it’s true or not, it would be interesting to consider languages in their ability to produce correct code more quickly.

While I don’t like the idea of writing 3x the amount of code, if one implementation is only 30% longer, for example, and is more likely correct on the first run, it’s still a huge productivity improvement.

Re:38% of bugs at Airbnb could have been prevented by using ... by skohan on Monday February 11, 2019 @10:59AM (#19135359)
This is my experience with statically typed languages. It may be a bit more verbose in the implementation, but it takes much less time to reach a correct solution.

I find that whatever "savings" there are in terms of code volume in dynamically typed languages is usually more than made up for in the need for more tests.

Re:38% of bugs at Airbnb could have been prevented by using ... by mattkrause on Sunday February 10, 2019 @10:33PM (#19131855)
Java has a lot more boilerplate—or near boilerplate—than the others. For example, you probably want to implement some kind of toString method, if only for your own sanity during debugging. You can do that in Python, but __str__ is often good enough.

I also wonder how many Java "lines" are just a closing brace or something trivial.

Re:38% of bugs at Airbnb could have been prevented by using ... by chii on Monday February 11, 2019 @05:08AM (#19133265)
and haskell is even smaller - `deriving show` and `deriving eq`!
Re:38% of bugs at Airbnb could have been prevented by using ... by rixed on Sunday February 10, 2019 @11:32PM (#19132080)
> I'd love to see a "programming language benchmark game" > that only allowed idiomatic code and compared languages based on code length.

You just described the old Debian language benchmark game. You could select the various coefficients to apply to code size, program speed etc. I remember it played an important role when I decided to give OCaml a try: I selected 1 for size, 1 for speed, 1 for RAM and zero for everything else, and that resulted in OCaml and Pascal, the two languages I was prejudiced against from school years. Of course I went with OCaml.

From the same era:

http://blog.gmarceau.qc.ca/2009/05/speed-size-and-dependabil...

Also relevant: https://redmonk.com/dberkholz/2013/03/25/programming-languag...

Re:38% of bugs at Airbnb could have been prevented by using ... by skohan on Monday February 11, 2019 @10:57AM (#19135336)
Java is a terrible exemplar for a statically typed language. It's incredibly verbose, and is often held up as a bad example for how to do typing. More modern languages manage have type systems which are more effective at identifying issues at compile time while also being more flexible in terms of the design patterns they allow.

You might have also noticed that Go is statically typed, and it's actually less lines of code than Python (maybe a lot less if trailing braces are counted in that LOC number).

Re:38% of bugs at Airbnb could have been prevented by using ... by jayd16 on Monday February 11, 2019 @02:50AM (#19132707)
LOC is a meaningless metric.
Re:38% of bugs at Airbnb could have been prevented by using ... by dunefox on Monday February 11, 2019 @08:33AM (#19134307)
Except when it comes to comparing verbosity.
Re:38% of bugs at Airbnb could have been prevented by using ... by Retra on Monday February 11, 2019 @01:57PM (#19137212)
If half the lines in your programs are

    {
and

    }
it hardly does that.
Re:38% of bugs at Airbnb could have been prevented by using ... by marcinzm on Sunday February 10, 2019 @09:30PM (#19131621)
>What greater 'tax' could you possibly conceive of than a whopping 38% of your development time on an enterprise product being spent debugging problems caused by type inference/coercion?

Is there a link where they say they spent 38% of their development time on this? The slide just says 38% of bugs and fixing bugs is not the only way development time is spent and not all bugs are equal in terms of time to debug.

Re:38% of bugs at Airbnb could have been prevented by using ... by brlewis on Sunday February 10, 2019 @10:57PM (#19131949)
> Is there a link where they say they spent 38% of their development time on this?

No there is not. The comment you're replying to has no factual basis for this claim.

Nor is there a basis in the article for 'what these Javascript devs are calling "The Typescript Tax"'. In the article there's one comment that refers to such a tax, but the commenter doesn't claim to agree, and every reply disagrees.

Nor is there a basis in the article for "Surely Node.js is going to be looked back upon as one of the worst mistakes in the history of 21st century programming." The article says nothing about the total quantity of bugs, bugs per line of code, or other comparable metric.

The comment you're replying to seems to have a predetermined agenda tangentially related to the article.

Re:38% of bugs at Airbnb could have been prevented by using ... by ajxs on Monday February 11, 2019 @12:46AM (#19132342)
My apologies, I was commenting very generally regarding attitudes typical of Javascript developers I have encountered in my professional life, rather than addressing the article directly. Also, you're right. 38% of development time is not the same as 38% of bugs, mea culpa, but there is an overall point to my statement about the productivity cost that I believe remains correct regardless.
Re:38% of bugs at Airbnb could have been prevented by using ... by brlewis on Monday February 11, 2019 @10:57AM (#19135339)
You gained more reputation by owning your mistake than you lost by making it.
Re:38% of bugs at Airbnb could have been prevented by using ... by macintux on Sunday February 10, 2019 @09:38PM (#19131653)
You’re correct, but it’s also true that debugging is often a greater percentage of time/effort than the original coding, so 38% of bugs is nothing to sniff at.
Re:38% of bugs at Airbnb could have been prevented by using ... by shhehebehdh on Sunday February 10, 2019 @10:42PM (#19131890)
Although typing bugs are often the simpler type of bugs to fix.
Re:38% of bugs at Airbnb could have been prevented by using ... by ajxs on Monday February 11, 2019 @12:35AM (#19132303)
The bigger problem is that "Simple fix" !== "Simple ramifications". Runtime issues caused by missing very simple typing bugs can bring down critical systems in Node. I worked at a company where a payment batching system built ( not by me ) with a MongoDB database failed to work correctly because the aggregation query was checking a field was `null`, without checking if it was there in the first place... No one even noticed for several weeks until someone finally investigated the low volumes. That's a very kind example too, just because they're simple to debug when they pop up doesn't mean that they won't cause massive destruction in prod.
Re:38% of bugs at Airbnb could have been prevented by using ... by smt88 on Sunday February 10, 2019 @11:10PM (#19132001)
This is only true if the bug is caught by the runtime checker. Lots of type bugs aren't, especially in languages with type coercion.
Re:38% of bugs at Airbnb could have been prevented by using ... by Operyl on Sunday February 10, 2019 @10:58PM (#19131953)
Until they’re not. I’ve had some codebases where it took 3-4 hours to figure out that some really bizarre issue was really just a type bug. And I don’t consider myself a terrible debugger.
Re:38% of bugs at Airbnb could have been prevented by using ... by shhehebehdh on Tuesday February 12, 2019 @06:12PM (#19148668)
Obviously. Any distribution will have some exemplars toward the tail.
Re:38% of bugs at Airbnb could have been prevented by using ... by root_axis on Monday February 11, 2019 @12:53AM (#19132362)
I don't think that's really true as a general rule. Passing a variable of an unexpected type or nullable could have completely unpredictable behavior depending on what assumptions the code makes about the incoming parameter. It could have no effect or a catastrophic one, there's really no way to know without reading actual code.
Re:38% of bugs at Airbnb could have been prevented by using ... by jondubois on Monday February 11, 2019 @04:32AM (#19133119)
So true and simpler to detect too.

The kinds of bugs which TypeScript prevents are those which could have been caught by the simplest of integration tests using the simplest inputs.

Every time I rename or change something in TypeScript, I have to change it in so many different places. In JavaScript, changes where much more localized.

Re:38% of bugs at Airbnb could have been prevented by using ... by baroffoos on Monday February 11, 2019 @01:04AM (#19132405)
Not at all. Typing bugs often leave code looking perfectly fine until you discover that one of the variables you expected to be y was actually x. And the only way to find out is to just print out everything
Re:38% of bugs at Airbnb could have been prevented by using ... by jondubois on Monday February 11, 2019 @04:39AM (#19133159)
Can happen with TypeScript too. There is no runtime type checking so if you parsed a JSON object and cast some unknown property `const result = someRemoteObject.someUnknownPropertyWhichIsAString as number`, it doesn't guarantee that the result is actually a number. You still need to do actual schema validation just like with old school JavaScript.
Re:38% of bugs at Airbnb could have been prevented by using ... by baroffoos on Monday February 11, 2019 @05:36PM (#19139130)
Better languages solve this. In haskell you define a datatype for json before you parse it.
Re:38% of bugs at Airbnb could have been prevented by using ... by jasonkillian on Sunday February 10, 2019 @09:35PM (#19131640)
> Surely Node.js is going to be looked back upon as one of the worst mistakes in the history of 21st century programming.

Why is that? There were dynamically-typed backend languages long before Node.js became popular. And you now can easily have a TypeScript-based Node.js backend, which gives you the nice benefit of having the exact same language and types for both your backend and frontend. I'm not saying the Node runtime is perfect, but I don't understand why having a runtime that lets you use JS/TS as a backend or local language is quite such a bad thing.

Re:38% of bugs at Airbnb could have been prevented by using ... by regularfry on Monday February 11, 2019 @03:25AM (#19132833)
I have absolutely no way to back this up, but my gut feeling is that the node ecosystem's tendency towards small modules, coupled with a lack of explicit interfaces in the language, increases the number of places where a developer is likely to introduce a type error.
Re:38% of bugs at Airbnb could have been prevented by using ... by austincheney on Monday February 11, 2019 @03:35AM (#19132875)
It is a bad idea to intermingle the problems of dependency management with the concerns of a type system as though these are somehow related concepts. If you are not managing your dependencies sloppy things will follow regardless of the type system in place. There is an unrealistic expectation that JavaScript developers shouldn't have to write code because somebody has already written it for them in an NPM package.
Re:38% of bugs at Airbnb could have been prevented by using ... by regularfry on Monday February 11, 2019 @05:29AM (#19133379)
I don't just mean external dependencies. The culture of "small modules" also means internal modules are vulnerable to this.

Edit to add: on further thought, I think it would be a mistake not to look at dependency management and type-safety at the same time. If my external dependency exposes a defined interface, that gives me more information about that dependency which I can use to manage it (replacing it, for instance) than without.

Re:38% of bugs at Airbnb could have been prevented by using ... by scarface74 on Monday February 11, 2019 @06:16AM (#19133611)
If I import a Nuget package into my C# code that changed a signature behind my back or even one that correctly versioned the package as “we have breaking changes”, I’ll know at compile time. With an NPM package I won’t know until runtime.
Re:38% of bugs at Airbnb could have been prevented by using ... by austincheney on Monday February 11, 2019 @06:41AM (#19133705)
Do you have integration tests to ensure your applications do all the things it claims to do and that dependencies don't break those things? If dependency health isn't a part of your product testing bad things can happen.

Another thing to consider is that maybe you might not need a given dependency. Sometimes it is faster to include a bunch of dependencies at the beginning of a project just to produce something functional in the shortest time. As a product matures there is a lot of opportunity to clean up the code and slowly refactor the code to not need certain dependencies.

Re:38% of bugs at Airbnb could have been prevented by using ... by scarface74 on Monday February 11, 2019 @07:08AM (#19133816)
I’ve found just the opposite especially going into companies with less mature engineers and “architects” who’ve been at the company forever and haven’t had much outside experience. They both tend to reinvent the wheel badly and write code for cross cutting concerns that have already been solved better like custom authentication and custom logging.

Then again, I’m a big proponent of avoiding “undifferentiated heavy lifting” at every layer of the stack.

Re:38% of bugs at Airbnb could have been prevented by using ... by austincheney on Monday February 11, 2019 @08:10AM (#19134158)
I think this comes down to reinventing the wheel. I frequently see less mature developers misuse that term to avoid writing code or making architectural decisions. That term isn't an excuse to off load your work onto someone else's reinvented wheel. The idea is to avoid unnecessary churn, whether that means you writing original code or using a dependency, and even still the concept is not always the best course of action.

As an example using a framework to avoid touching the DOM is an external reinvented wheel. As a leaky abstraction the need for that framework may dissolve over time as requirements evolve. That evolution of change can result in refactoring or a growth of complexity. Accounting for those changes means reinventing the same wheels whether or not the abstraction is in place. That is because a framework serves as an architecture in a box, but if you are later making architectural decisions anyways you have out grown at least some of the framework's value.

Re:38% of bugs at Airbnb could have been prevented by using ... by scarface74 on Monday February 11, 2019 @08:17AM (#19134206)
I’ve seen it before where “I don’t need a framework”. Then after the project grows, the “architect” ends up reinventing the same framework badly. I have no problem with opinionated frameworks especially with larger organizations. It also makes it easier to onboard developers. As a new dev on a team, I’d much rather come into a company that uses Serilog than used AcmeSpecialSnowflakeLogManager.
Re:38% of bugs at Airbnb could have been prevented by using ... by austincheney on Monday February 11, 2019 @10:04AM (#19134906)
I have seen that as well. Many people will complain that if you don't use a framework you will end up writing one anyways, which is completely false. For many people who have never worked without frameworks writing original code means inventing a new framework, because that framework-like organization is how they define programming to themselves. This behavior is safely described as naive, or a lack of exposure to differentiating methodologies. This reminds me of that quote: when you're a hammer everything looks like a nail.

https://www.dictionary.com/browse/naive

Re:38% of bugs at Airbnb could have been prevented by using ... by scarface74 on Monday February 11, 2019 @10:40AM (#19135161)
So what is your definition of an agreed upon method that an organization uses to produce results....
Re:38% of bugs at Airbnb could have been prevented by using ... by austincheney on Monday February 11, 2019 @01:53PM (#19137166)
Depends on the goals and constraints of the organization.
Re:38% of bugs at Airbnb could have been prevented by using ... by scarface74 on Monday February 11, 2019 @02:05PM (#19137275)
And what happens once you have 3 or 4 developers?
Re:38% of bugs at Airbnb could have been prevented by using ... by austincheney on Monday February 11, 2019 @09:41PM (#19140536)
I think what you are ultimately getting at is: How do you ensure they write code the same way?. That isn’t a real problem and so it isn’t something you need to address. This comes up because insecurity is a very real concern.

Instead provide a business (not code) template to define requirements for integration. This should define what is needed in their documentation, what they output/return, their inputs, automation test requirements, and so forth. That list delicately does not include code style or any more of vanity. Most of this can be automated but you need code reviews to hold people to account and to use as a training opportunity. Be honest and critical during the code reviews. If people find respectful honesty offensive talk to them about it outside the group and if they still can’t get with it transfer them out of your team.

Re:38% of bugs at Airbnb could have been prevented by using ... by scarface74 on Monday February 11, 2019 @09:58PM (#19140617)
So you’re suggesting that one person decides that they like JQuery on the front end and one decides that they want to use plain Vanilla JS and one decides they like the look of Material UI, the other Bootstrap, and one happens to like sites that look like MySpace that’s ok?

And on the backend, if one developer liked log4net for logging, the other Serilog, and yet another developer likes to build his own logging framework that’s okay?

Let’s take this to a logical extreme, since one person is an old school VB developer and another likes F#, let’s just do that and throw in a little COBOL.Net for good measure....

And when a new dev comes in snsr takes forever to ramp up. No big deal. While we are at, let’s not follow the REST semantics either and no one needs those pesky frameworks like Express and ASP.Net. Let’s just go bare metal...

Or you could just have agreed upon standards....

If you’re going to have standards anyway, why not just use frameworks where you can open a req for the required framework that lets you get some developers who you can make sure already know the basics?

You’d be surprised at how many cheap developers you can get to throw together your yet another software as a service CRUD app using React.

Re:38% of bugs at Airbnb could have been prevented by using ... by austincheney on Tuesday February 12, 2019 @02:19AM (#19141680)
> So you’re suggesting that one person decides that they like JQuery on the front end and one decides that they want to use plain Vanilla JS and one decides they like the look of Material UI, the other Bootstrap, and one happens to like sites that look like MySpace that’s ok?

The expectation is that developers are literate in their line of work, even though most companies don't hire like that. Since developers are expected to be literate don't waste time worrying about how to write code. If a developer suggests a tool that helps them on the "how to write the code" reject the tool.

Set business principles that specifically communicate the acceptable scope of work. Such principles can be something like this:

* code will execute within X milliseconds.

* code will allow up to X total dependencies (choose wisely).

* code will not exceed X bytes total size. If they want to include jQuery their code solution just increased 69kb.

The common failing is confusion around standards. Many developers find it easier if everybody just did everything the same way so that things appear standard. That approach ignores everything relevant to product quality and the goals of the business, which is stupid. It is stupid because it sacrifices simple for easy at the lowest level of leadership by lazy or weak managers. You don't get to offload management onto a framework and still hope to be a strong effective manager. Ultimately the success of a manager is tied to the work of that manager's team whether the team can retain/promote effective people.

When you set concrete and specific business limitations the limits are easily understood and based on objective criteria. Innovation and creativity are not stifled as developers are free to work within the constraints anyway they please.

This all makes sense once you accept that the group is worth more than the individual, but the product is worth more than the group. Sacrificing business goals for group cohesion is backwards just as sacrificing group integrity for an individuals option is backwards.

> You’d be surprised at how many cheap developers

That is also a common failure. Developers are never cheap unless you offshore. In hoping for cheap you will actually get developers that cost the same, do crappy work, don't value themselves, and that aren't valued by the organization. That is toxic. Instead hire people with potential to do great things and manage them effectively.

Re:38% of bugs at Airbnb could have been prevented by using ... by jve on Monday February 11, 2019 @07:09AM (#19133817)
Dependencies should be tested, yes. But I enjoy this sentence in top comment: > "extensive" unit testing is a poor man's type checker

:)

Re:38% of bugs at Airbnb could have been prevented by using ... by GhostVII on Monday February 11, 2019 @12:41AM (#19132326)
I wouldn't be surprised if it is actually faster to develop in statically typed languages once projects reach a certain size. It makes refactoring so much easier, and it's a lot easier to reason about what a functions arguments could be. I've had cases before where the easiest way to tell what a function accepted as an argument was to just run the program and print out the input. If it was statically typed, I know exactly what the arguments are, and can easily see the effects of modifying one of those arguments. With dynamic typing, I spend a lot of time just looking at how a function is used elsewhere in the code to make sure I don't break anything.
Re:38% of bugs at Airbnb could have been prevented by using ... by TeMPOraL on Monday February 11, 2019 @02:15AM (#19132600)
"Tax" may indeed be the right word. You pay something up front, and in return you get benefits that tend to outweigh the costs, and which would be even more expensive to pay for directly. I say that as a seasoned dynamic typer, who finds himself wishing frequently that the X3J13 standardized optional typing in Common Lisp a bit more.
Re:38% of bugs at Airbnb could have been prevented by using ... by drugme on Monday February 11, 2019 @11:06AM (#19135437)
What greater 'tax' could you possibly conceive of than a whopping 38% of your development time on an enterprise product being spent debugging problems caused by type inference/coercion? Y

As opposed to 86 percent of all statistics, which are basically made up. (Or presented grossly out of context, which is pretty much just as bad as "made up").

Seriously, it takes a lot more to trigger an assessment of "whopping" significance in my mind than a side-angle photo of some random slide presented with no background context whatsoever.

Surely Node.js is going to be looked back upon as one of the worst mistakes in the history of 21st century programming.

Wholehearted agreement with you there, at least.

Re:38% of bugs at Airbnb could have been prevented by using ... by austincheney on Monday February 11, 2019 @03:30AM (#19132859)
> Surely Node.js is going to be looked back upon as one of the worst mistakes in the history of 21st century programming.

Why? You did not elaborate on this.

Re:38% of bugs at Airbnb could have been prevented by using ... by nathan_f77 on Monday February 11, 2019 @04:49AM (#19133190)
I might be wrong, but I think you have misunderstood this, or we've come to wildly different conclusions. My understanding is that they were using a dynamic language without types, and 38% of these bugs would have been prevented if they were using static types. My conclusion is that developers would spend at least 38% less time debugging type issues. This is because code editors (e.g. VS Code) have really good TypeScript support, such as autocomplete, and you get instant feedback if you ever make a mistake.

You seem to have arrived at the opposite conclusion, which is that developers would require the same (or more) effort to prevent and fix these bugs while using TypeScript. I think you've missed the fact that most type issues don't take that much effort in the first place. Once you set up the "guard rails" by making a decision about types (or just assigning a value to a variable), writing the rest of the code is pretty effortless.

I would take it a step further and say that TypeScript development is actually more productive than plain JavaScript. (Again because of the better autocompletion and instant type checking in my editor.) I make far fewer mistakes, but I also write code faster.

Re:38% of bugs at Airbnb could have been prevented by using ... by Brometheus on Monday February 11, 2019 @05:04AM (#19133244)
This, and also: You don't want to deploy errors to production ;D
Re:38% of bugs at Airbnb could have been prevented by using ... by anonytrary on Sunday February 10, 2019 @10:04PM (#19131755)
There's a hidden tradeoff. For example, if you have to spend 1000 extra cumulative hours to use types, and you've spent an extra 500 cumulative hours fixing all of the bugs associated with not using types, then, from a business perspective, it would have been worth it to not use types (and vice-versa).
Re:38% of bugs at Airbnb could have been prevented by using ... by cellularmitosis on Monday February 11, 2019 @05:58AM (#19133527)
This completely ignores the fact that bugs which make it into production erode the reputation of the company in the eyes of their customers.

Lost reputation is much, much worse than being wasteful with dev hours.

Re:38% of bugs at Airbnb could have been prevented by using ... by anonytrary on Thursday February 14, 2019 @10:48PM (#19168326)
It depends entirely on the bugs. If a bug's reproduction-path is rare enough that a non-critical mass of users runs into it, then it's not going to make a difference. Reddit, for example, is currently bogged down with login bugs, redirect bugs, redesign bugs, etc. and they're simply not prevalent enough to get people to mass exodus off of Reddit. Reddit will continue to grow fast even with these bugs.

The vast majority of user-seen bugs are not common. The common ones are usually caught with testing.

Re:38% of bugs at Airbnb could have been prevented by using ... by scarface74 on Monday February 11, 2019 @06:19AM (#19133626)
I use to believe that to always be the case. But then I worked for a company that didn’t really care about quality they just wanted to add features to mark off a checklist in a pursuit to either get more funding or get acquired

That can work - see Twitter.

Re:38% of bugs at Airbnb could have been prevented by using ... by cellularmitosis on Monday February 11, 2019 @03:59PM (#19138290)
Right, but when customers are putting up with a crappy product, they are just waiting for a better alternative to come along. That's a huge liability to be sitting on -- just ask MySpace.
Re:38% of bugs at Airbnb could have been prevented by using ... by cellularmitosis on Monday February 11, 2019 @04:07PM (#19138361)
To your point though, I can see a strategic path of "crappy until we get enough funding and users that we can go back and redo it".

In practice though, most companies never seem to polish a shipped feature -- they instead focus on adding more mediocre features.

I would love to see this trend reversed of course! But software in our age seems doomed to short lifespans and mediocre quality.

Re:38% of bugs at Airbnb could have been prevented by using ... by scarface74 on Monday February 11, 2019 @04:05PM (#19138345)
That actually proves my point. The original founder sold to News Corp just as Facebook was taking over in 2009. The strategy was a success depending on where you stand....
Re:38% of bugs at Airbnb could have been prevented by using ... by cellularmitosis on Tuesday February 12, 2019 @09:35AM (#19143736)
Our difference of opinion hinges on the ambiguity of “success”. Here you use “success” strictly in the sense of making a financial gain, while MySpace’s users would have called it a failure.
Re:38% of bugs at Airbnb could have been prevented by using ... by scarface74 on Tuesday February 12, 2019 @10:10AM (#19144045)
Isn’t that the metric that all investor funded startups use - either being acquired or going public at some multiple of their original investment?

Unless I’m working at a job where I’m serving some greater good, my definition of success is did I help achieve the company’s objectives, get paid well, and will I be able to use my coworkers and management as references in the future.

Re:38% of bugs at Airbnb could have been prevented by using ... by cellularmitosis on Tuesday February 12, 2019 @10:45AM (#19144414)
Your position is that financial gain is the only metric that matters and that the quality or longevity of the product is irrelevant, and my position is that that's a concise summary of everything that's wrong with "tech". We agree to disagree.
Re:38% of bugs at Airbnb could have been prevented by using ... by scarface74 on Tuesday February 12, 2019 @11:10AM (#19144681)
How much code that is run by most user facing businesses Is the same code that was used 10 years ago no matter how good it is?

No matter how great my Perl code was running 15 years and 5 companies ago, I doubt they are still using it.

The code that runs Amazon.com, Google.com, etc. is nothing like what they ran 10 years ago.

Besides, we aren’t talking about feeding starving children here. We are talking about the death of a social media platform. But more generically, if yet another software as a service CRUD app dies, whose hurt besides the investors who expect most of their startups to fail and the developers who can walk down the street and get another job in a week?

As an individual, why am I going to fight the loosing battle of trying to implement great code quality and test coverage when I’m being incentivized by how many features my team can pump out as cheaply as possible by hiring a bunch of poorly paid developers overseas?

We call what we do “engineering” but there is a world of difference. If my program fails that is running a SAAS app, the user gets a 500 error. If a mechanical engineer rushes, people die.

Re:38% of bugs at Airbnb could have been prevented by using ... by colordrops on Sunday February 10, 2019 @10:28PM (#19131834)
Are you implying that dynamically typed programming languages are a mistake?
Re:38% of bugs at Airbnb could have been prevented by using ... by int_19h on Sunday February 10, 2019 @11:42PM (#19132118)
IMO, dynamically typed languages made more sense when type systems in mainstream statically language languages were much more primitive, and that limited what you could do - and it was often verbose when you could.

But the kind of type systems your average dev has to deal with improved a lot in their expressiveness since 90s. Type inference is basically mainstream, too. There are still things that cannot be described nicely, but they tend to be a lot more "magic" - the kind of stuff that lets you write code faster, but not necessarily write more readable and understandable code.

Re:38% of bugs at Airbnb could have been prevented by using ... by fosk on Sunday February 10, 2019 @11:38PM (#19132108)
Like everything else, there are pros and cons. It’s not like dynamic languages are worse or better per-se, but they surely make it harder to scale a team or a codebase 10x the original size without introducing what effectively is some sort of typed system (or strict “typed” conventions that the team agrees upon) in place. Which may be done right, or disastrously wrong. A typed language generally doesn’t leave this step up for interpretation later on, since everybody agrees on it since day one.
Re:38% of bugs at Airbnb could have been prevented by using ... by cellularmitosis on Monday February 11, 2019 @06:03AM (#19133553)
As a newbie to clojure, I’m very curious to see what a large codebase looks and feels like. The clojure attitude seems to be that types come at the cost of reduced code reuse, which I tend to agree with. After a decade spent in strongly-typed OO, it is starting to feel like a bunch of sound and fury which seems to end up eventually just getting in my way. I’m definitely open to new ideas in this area, and am looking forward to taking a deeper dive into clojure this year.
Re:38% of bugs at Airbnb could have been prevented by using ... by jondubois on Monday February 11, 2019 @03:27PM (#19137961)
Alternatively, you can break the project up into modules; each of which are maintained my smaller teams. I think that is a cleaner approach.
Re:38% of bugs at Airbnb could have been prevented by using ... by ajxs on Monday February 11, 2019 @12:51AM (#19132357)
Absolutely not, but horses for courses. I use all of these dynamically typed languages regularly and I enjoy programming in them too, but choosing the right tool for the job should take precedence over personal preferences.
Re:38% of bugs at Airbnb could have been prevented by using ... by colordrops on Monday February 11, 2019 @07:16PM (#19139830)
So then you are saying every single use case which node.js currently fulfills should use statically typed languages? This does not match my experience of node.js being used in many of the same cases as other dynamically typed languages. What cases specifically are dynamically typed languages suited for?
Re:38% of bugs at Airbnb could have been prevented by using ... by AnaniasAnanas on Sunday February 10, 2019 @11:08PM (#19131991)
> debugging problems caused by type inference

Type-inference has never been the cause for bugs in any languae.