7 ms·
I think the whole comparison of imgur with a blank page with an image is a bit silly. It's not just the image, its a whole application with comments,image galer
by vfc1 7y ago
I think the whole comparison of imgur with a blank page with an image is a bit silly. It's not just the image, its a whole application with comments,image galeries, video playing ability, and of course a ton of iframes with ads which load a lot of content (more images etc.)
Try to do the same feature set without a Javascript framework and using only plain Javascript or even plain HTML and CSS, and then come and tell us about the results.
Also, a lot of the bloat is probably not under the developers control and is added by non technical marketing departments, which want a tracking pixel for this, a tracking pixel for that etc.
But yes its true its insane and its getting worse, and 4G and HTTP2 will not be a solution for most of us anytime soon.
- gbuk2013 7y agoIt is not difficult to implement all those features using plain Javascript, in fact I would recommend it as a great learning experience. What is difficult is doing it in way that is maintainable over a long period of time. The nature of the language is that without iron code discipline Javascript code inevitably turns into a mud-ball. Apart from the obvious “many-eyes” benefits, frameworks also provide structure that buys extra time before this happens.
- capableweb 7y ago> The nature of the language is that without iron code discipline Javascript code inevitably turns into a mud-ball. Could you outline what you think makes JS more likely to turn into mud-balls compared to other languages? In my experience, no matter what language you use, or with what pardigm, unless you model and design your software architecture with discipline, you gonna end up with a mud-ball. Has less to do with the language and more about the process you use to model your domain.
- adimitrov 7y ago> Could you outline what you think makes JS more likely to turn into mud-balls compared to other languages? Plain JS is hell to refactor. Between arbitrary autocasting, little tooling and no useful type system, if you don't have a very detailed test suite, you won't find the parts of your code that are broken now. Also, if you do, you now have to reimplement all those tests that did nothing else than to check your call signatures. Ease of refactoring is a major indicator for a good enterprise language, as constant refactoring is basically the main development process. If your devs are afraid to touch certain pieces of code because nobody knows what the ramifications are, your software is already dying. That's why TypeScript is taking off so nicely. People crave those static guarantees that JS doesn't have.
- gbuk2013 7y agoWhen you have reached the stage of mud-ball it is already too late. ;) With the appropriate amount of skill and discipline, however, this stage can be postponed for longer than the life of the application. Typescript is absolutely not required.
- adimitrov 7y agoBut that's a truism. Good coders write good code. Heureka! The real gain is to be had in pushing the mudball stage as far into the product's life cycle in absolute terms as possible. In that sense, nothing is required, but some things help. I argue that TypeScript helps.
- gbuk2013 7y agoIf it helps you, great. I’m happy enough with plain JS, thanks. ;)
- capableweb 7y agoI've seen exactly the same problems with large TypeScript codebases as the JavaScript codebases have. Refactoring becomes a hassle not because there is types or not, but because there are endless of useless unit tests testing implementation details, because the architecture is highly coupled in the wrong places and because little care was made when the architecture was dynamically created (because "agile" or what ever) without considerations. Having good and smarter tests helps more for ease of refactoring than having everything mapped to types. But I might just have seen bad examples of TypeScript codebases.
- thrower123 7y agoProbably this is a side-effect of translating JS unit-testing techniques without adequate thought and reflection. I am sometimes amazed at the extent of trivial tests that do no more than double-check the compiler that I see from web developers that move up the stack.
- gbuk2013 7y agoIt probably does apply to all languages, but I prefer to speak from experience, which in my case is mostly JS. Architecture and the related abstraction is definitely the hardest thing about programming in my experience, and what really separates good programmers from the bad. Loose types, pass by reference, near-limitless mutability, scoping rules (without “use strict” to save the day) and asynchronous nature of the things it is used for are some of the things that come to mind with JS. All of these are actually very powerful features that make it into the language I love, but care is definitely needed. ;)
- chrismorgan 7y agoYeah, I really wouldn’t link it in any way to the language. It’s just mostly more obvious when it’s in JavaScript, because that’s associated with the user agent having to fetch the code and run it from scratch every time, and as a user you can more easily inspect where the time is going, compared with an app or backend processes, which are both much more opaque to the user. It’s more about architecture and discipline, and far, far more about simply caring about performance. (And larger teams make it much harder to care about performance.) For personal background in my firm agreement with capableweb, I work primarily in JavaScript professionally, tend to use Rust privately, and have used a variety of other languages and worked with both good and bad code bases (mostly good); and I care very much about performance.
- gbuk2013 7y agoDon’t get me wrong, I actually love Javascript. I have written code in quite a few languages but JS is the one I am most productive and happy in by far (within the area of network services and web apps that I work in). It has also been very profitable. :) But the language has such a low threshold that it allows for incredible productivity while writing shitty code. But by the time you realise just what you have done (or someone else realised when they have to work on your codebase) its too late and it’s time for a rewrite. What makes JS special is how accessible it is and just how much mess you can make before reality bites. That said, I will take a Javascript mud-ball over an enterprise Java one any time! ;)
- 7y ago
- dkersten 7y agoIf it takes ages to load the core content, who’s still left on the site for that other stuff? In his comparison it took 40 seconds to load the image, I’d have closed the tab after 10 and none of that other stuff would matter.
- stickfigure 7y agoNote that the vanilla 37k image took 2.4 seconds. Most people aren't on a 128 kilobit ISDN line. And there's a good chance you have much of the static content cached. Anyone can easily build an image-serving website. What's hard is to build an image-serving website that pays for itself. I wouldn't be so quick to judge.
- dkersten 7y agoSure. But he did say this was the mobile site, where you may have connectivity issues or low bandwidth. At home, I would never notice. Hell, I usually have good connectivity on my phone too, BUT often when I’m on the train, I have sketchy speeds and during these times, I do notice slow/overly bloated sites or web apps. > Anyone can easily build an image-serving website. What's hard is to build an image-serving website that pays for itself. I wouldn't be so quick to judge. That’s very true, but again, you don’t need a bloated slow (comparatively speaking) app to serve advertisement. If the total time had been 10s (ie 7.5 for adverts etc, 2.5 for content), he probably would have thought eh slow but whatever
- GrumpyNl 7y agoThats out of the scope, you can still target and only load the image. Its all about technical design.
- Waterluvian 7y agoIt's totally doable with vanilla JS. You'll just likely end up with a mess or your own framework and all the associated costs.
- deleted 7y ago[deleted]
- dccoolgai 7y agoA good web developer: 1. Finds a way to make the code serve the main purpose of the page/experience _first_ and bring in the extras after the main thing is settled while disturbing the main thing as little as possible. 2. Uses the same mindset to protect the page/experience from marketing/analytics/whoever. You want more pixels? Sure. I'm not telling you that they will only fire at +3s ContentLoaded, but you're probably not asking, either.
- ken 7y agoI don't think it's unfair, when 99% of users don't want any of those features. By that logic, any and every possible feature is fair game, and beyond criticism, simply by existing.
- alkonaut 7y agoBut I don't care about any of that. I don't even care if the rest of the app is what keeps the lights on. Everyone* who visits imgur does so following an image link, they want to view that single image, and will not click anywhere else on the page. Optimizing for another use case seems crazy. *There is set of users who browse imgur or otherwise use imgur as a kind of "web application", I'm disregarding that part of their userbase for the sake of this discussion. It would surprise me a lot to learn they are more than 1% of users .
- vfc1 7y ago> But I don't care about any of that OK, fair enough but then it's a different discussion and a different conclusion. We can't really blame Javascript frameworks for a particular business that has decided to monetize its user base in a different way, by adding more features that are not widely used by their userbase. Imgur can't exist in a vacuum, it's a business there is a whole team behind it. Now we might question that whole business model as well and the whole internet supported by ads thing, but that is a whole different barrel of fish that is in my view not attributable to Javascript frameworks.
- jeroenhd 7y agoI actively avoid clicking imgur wherever I can because I know it fails to load half the time. I hope the people who still stick around on imgur for the community are enjoying the web application because it's clear people who just want to see an image after following a link aren't considered as their audience anymore.
- iamaelephant 7y ago> I think the whole comparison of imgur with a blank page with an image is a bit silly. It's not just the image, its a whole application with comments,image galeries, video playing ability, and of course a ton of iframes with ads which load a lot of content (more images etc.) This is precisely the reason it's a good comparison...