Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Imagine inheriting that guy's codebase.


I'd be much happier to inherit this codebase than the more common kind of front-end: "We made a bunch of choices on frameworks and toolchains 7 years ago because they ticked a lot of buzzwords. To understand what's really going on, be prepared to dive into old issue trackers of deprecated versions of unpopular projects to figure out why the code is doing thing X to work around bug Y. But isn't reactive functional metaprogramming in CoffeeScript pretty awesome though?"


Hi,

"that guy" is here and reading your mean comment. Anyways, I don't think my code is that bad.


It can be very very difficult to find your way around a large JavaScript code base without types. There's a reason everyone complains about a lack of typing in ruby, python, and javascript. I loved it too at first but as I got into larger corporate code bases I found that typing was absolutely crucial for productivity. You're going to get flack for that, may as well accept it.


This is why we use Blazor now. Our domain model has over 50 different types, some with well over 300 unique properties per. In a complex use case for our application, there can be tens of thousands of total business facts to deal with at the same time. If we were still trying to define JSON API contracts and mappers to pass this amount of domain knowledge around, we would have closed up shop a few years ago.

We now have 1 strongly-typed domain model that is used directly throughout the entire application. If you want to talk about productivity, cutting out entire layers of unnecessary mapping is key to getting leverage. Our custom javascript interop amounts to approximately 150 lines of code. Needless to say, we don't worry about javascript too much. Any interaction requiring js is quickly abstracted away under some razor component, never to be worried about again.


What would you say the codebase size threshold is for when types become needed? I mostly work on medium projects I think, and never found typescript to be of any use...


I mean kudos, you have optimized as you should, for you. As a freelancer you have other concerns, but people that will maintain it will curse you (but that's what they're paid for). You have some very cool projects.


Gladly, that is how many of my own Web projects also look like.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: