Hacker News new | ask | show | jobs
by stickfigure 1833 days ago
The whole thing should be condensed to:

    add(new JScrollBar(scrollBar, HORIZONTAL), BorderLayout.SOUTH);
It's self-evident and needs no comment or whitespace to "break it up". This is fundamentally a problem with wordy imperative languages.

A lifetime ago when I wrote assembly code I would write a comment like this to explain every subsequent 5-10 lines of opaque incantation. Higher level (especially functional) languages tend to have fewer issues like this.

1 comments

Unlike the original, this doesn't retain a reference to the scrollbar object.