3 ms·
I never understood why people proudly boast about their past mistakes. Is it supposed to make their current achievements sound better? "Oh, we had 8500 lines of
by gambler 14y ago
I never understood why people proudly boast about their past mistakes. Is it supposed to make their current achievements sound better? "Oh, we had 8500 lines of spaghetty JS code in one file, but we used AwesomeFrameworkX and it fixed everything!" For me, this doesn't make the framework sound more impressive, but rather undermines credibility of the author. How did it get to 8.5 lines? Did no one notice? Did no one care? Was every line necessary? Does having a file like that is really better than having some stuff handled on the server side? Was Backbone the only way to move forward?
- conesus 14y agoThe intention was to allow people to commiserate and understand that this happens to many code bases and there is a path out of the woods. As far as letting the file deteriorate to that length, NewsBlur was a side project of mine for two years. That's how long it took, and because I only had 45 minutes at a time (my commute) to work on it, large scale refactors were not a priority. And it took two years before I realized that NewsBlur would be sticking around and I should care for the code base. It was at that point that I began the process of refactoring the bejeezus out of it.
- tomkit 14y agoTotally agree. It shows more of the author's initial failings and then trying to generate buzz with hot HN keywords like 'backbone'. One file with 8500 lines could have easily been avoided with the module pattern either by handrolling it or using various libraries out there like requirejs, commonjs, etc.; backbone is not required.
- mattdawson 14y agoYou're only addressing part of the problem. File size is a much easier thin to fix than refactoring DOM bound soup.
- justinator 14y agoNo one's perfect and we all make mistakes, given the circumstances we find ourselves in - we all make choices with incomplete information. Admitting that there's a better way to do things is a good first step to become better. To share what you've learned is a sign of being humble.
- gambler 14y agoWe all make mistakes, but not all of us use those mistakes to promote something. It's an annoying and overused software evangelism trick. You start by decrying your past ignorance, and continue by saying that you were enlightened and started using X. This dramatizes the improvement and subtly implies that everyone who doesn't yet use X are simply not yet as enlightened as you. There is nothing genuinely humble about doing this.
- cnp 14y ago(...)
- aidos 14y agoThe move towards rich frontend applications is a fact of life at the moment. There are lots of ad-hoc apps out there that have 1000s of lines of js in a single file. These guys put the work in to fix that - then they kindly spent their time writing it up so we could profit from what they learnt. Granted 8.5k lines is a lot - but I'll bet there are more shocking projects out there than that. (I've seen much worse than that on the server side)
- zem 14y agothey weren't boasting, they were sharing their solution to a common problem, in the hope that it will help other people who have the same problem. i'm somewhat surprised that anyone doesn't "get" the motivation behind doing this.