Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Why browsers are bloated

Name: Anonymous 2014-07-27 0:20

https://github.com/WebKit/webkit/blob/master/Source/WebCore/platform/Scrollbar.cpp
https://github.com/WebKit/webkit/blob/master/Source/WebCore/platform/win/ScrollbarThemeWin.cpp
Let's reinvent the fucking scrollbar, which every goddamn platform with a UI already has, and make it behave subtly different from the native one!

Right-click a native scrollbar in some other app:
- Scroll Here
- Top
- Bottom
- Page Up
- Page Down
- Scroll Up
- Scroll Down

Right-click a scrollbar in Chrome:
- Back
- Forward
- Reload
- Save As...
...

Right-click a scrollbar in Firefox and Opera:
Absolutely fucking nothing happens!

What the fuck!? How did these terminally retarded idiots get involved in creating one of the most important pieces of software to the average user?

Name: Cudder !MhMRSATORI 2014-08-01 12:18

>>27
The amount of time I've spent on this algorithm in total probably does not exceed a day at most; I'm normally very busy with other things. I don't think "worse is better" applies here, since that usually leads to much simpler designs which don't handle particular edge-cases well (e.g. Unix), instead of grotesque complexity.

>>31,32
If you ever find yourself needing to describe such a complex idea, you should probably reconsider your approach. From a quick glance it appears to be for moving boxes up/down depending on vertical alignment, something which the code manages to make extremely bloated despite it being a very simple idea:

1. Collect the maximum height of all the boxes on one line, while laying them out; this will be the line height.
2.a Top-aligned boxes don't need to be moved.
2.b Centre-aligned boxes have (maxHeight - height)/2 added to their y-position
2.c Bottom-aligned boxes have maxHeight - height added to their y-position

The WK code expresses this too, but it's far more obfuscated and probably traverses the box list many more times than necessary - there's a function to do the first step mentioned above, but it traverses the whole box list. If layout has to traverse the box list already, why not compute the maximum height at the same time? The monkeys will spout things like "modularity" and "encapsulation", because they were so brain-damaged by their religious adherence to OOP dogma that they don't realise it's extra work both for them to write extra code, and the machine to execute it. They might also cry "premature optimisation", but this isn't any clever optimisation, it's common sense. To think otherwise is like driving to the store and back for each individual item you buy - absolutely retarded! Anyone sane wouldn't ever think of doing such a thing, yet put them in front of a computer, indoctrinate them with OOP religion, and this is what they'll do.

>>33
I don't see how using excessively verbose code with tons of needless indirection/abstraction and mind-numbingly-long variable names is in any way more productive. The same goes for reimplementing basic UI functionality and creating trivial classes - it's busy work, useless time-sinks to give the impression of being productive.

http://en.wikipedia.org/wiki/Muda_(Japanese_term)

Newer Posts