Skip to content

Instantly share code, notes, and snippets.

@perlun
Last active November 6, 2018 07:32
Show Gist options
  • Save perlun/b0ec37092a93f59a7420d3936f16c744 to your computer and use it in GitHub Desktop.
Save perlun/b0ec37092a93f59a7420d3936f16c744 to your computer and use it in GitHub Desktop.
Bad Javascript code

The screenshot below illustrates a problem I see sometimes, where people try to make code that is far too dense to be readable. On my screen I see a fulll page of code, with very little surrounding whitespace. This makes the code very unreadable to me.

The code in question is taken from WebSSH2, more specifically this file. Note: I am not in any way saying that this code is much worse than all other code that exists (including code that I've authored myself), but the spontaneous feeling I had when looking at this code was that it felt like a "big wall of text". If we write code like this, other people are likely to get the same feeling, which unfortunately will likely scare some people away from our (open source) code bases.

So: the problem is not with a particular project, but rather with a particular style of writing code.

@perlun
Copy link
Author

perlun commented Nov 5, 2018

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment