Hacker News new | ask | show | jobs
by tschellenbach 1876 days ago
I feel like part of the reason why software engineering projects are hard to estimate is this. So you want to add video chat..

- this blogpost: 100 loc - pion (open source): 100k loc? - dolby.io/ agora: I'm guessing >1m loc - zoom.... even more?

5 comments

To be fair this is a very simplistic project just to get the 2-way chat working. There are no fallbacks for anything that doesn't work correctly. There are also numerous edge cases especially iOS and Safari that would add 1,000 more lines of code to properly account for.

Not too mention all the features that people actually want like muting, toggle video, noise detection/cancellation.

So yeah, setting up a P2P video chat in 2021 is somewhat easy. Until it's not.

It makes sense that video chat would be complicated though. Skype came out, what, 2003? And it didn't start becoming popular until years later. FaceTime came out 2010. I would bet the vast majority of people had their very first video chat experience some time in the past decade.

So of course it's hard. Nothing is built with video chat in mind, especially nothing that's existed for 30+ years like the Web. Our solutions are janky and feel bolted-on because they are.

Also, I think video (especially live-streamed video) is hands-down the hardest format to work with in computing. It's simultaneously network, disk, memory, and processor intensive, and doubly so with 2+ streams at the same time. We try to fix some of this with compression, but that just makes the codecs more complex, which makes it harder to work with...

Truth is though, you could "just add video chat," if you accept using a video chat vendor, of which there are probably hundreds (WebEx, Google Meet, Microsoft Teams, Discord, off the top of my head). But that means offloading the complexity to someone else. In many cases that's the right call. In OP's case this was clearly meant to be a learning experience so rolling something DIY is of course acceptable. Hard to estimate, maybe, but of course it would be hard to estimate something you don't know anything about and have never done before. Would a 4th grader be good at estimating how long it would take them to learn enough abstract algebra to start publishing papers on it?

I'm not that convinced. I mean yes, if you literally just estimate "add video chat" without any research or further clarification, but that'd get you in hell in every other discipline too.

EDIT: I guess one part might be that people are less likely to recognize specializations than in other disciplines?

Yeah. "I want a shed". OK, let's build a shed.

"Oh yeah, and maybe some power, IDK maybe three phase. Also PoE and smart lighting and some insulation and enough room for a CNC machine and..."

You might have a big shed, but it wouldn’t be a very complicated one. Electrical supply is extremely well-abstracted and clearly defined. Software really is worse than other disciplines in how complexity leaks out everywhere.
Blogposts like this don't really help -- someone knocks up a basic WebRTC implementation for a weekend project, reckons it's better than what the specialists do and wants to show it off. That puts the message out that WebRTC is easy, when in reality scaling it to production usage with a full feature set has a hell of a lot of challenges.

It would be better if this sort of thing was heavily caveated ("this is the Hello World of WebRTC") because otherwise a lot of people (non-technical types, junior engineers) see it and think -- well we can do that, should take us a few weeks max.

You made me curious about how large Pion is, 162k lines! I made sure to delete all test files first.

    sean@SeanLaptop:~/go/src/github.com/pion$ find . -type f -name '\*.go' | xargs wc
       47871  162998 1394063 total


pion/webrtc is the largest package with 58k lines. Every other package (ICE, DTLS, SCTP....) are all around 20k lines. It feels wrong that WebRTC is so large (and not pushed into sub packages) will for sure be digging into that for fun in the next few weeks :)
There are:

- A lot of examples: https://github.com/pion/webrtc/tree/master/examples - A lot of tests - if you exclude `_test.go` and `examples/` you are down to ~58k loines, which is only ~3x bigger than the (much simpler!) ICE and SCTP packages.

With a naive exclude via grep -v '_test.go' and grep -v 'examples/*' we are down to:

   16180   58136  498113 total
thanks for the amazing work on Pion, seriously impressive stuff
Thank you! If you are ever need help or are interested in getting involved I am always around. https://pion.ly/slack