Skip to content

Instantly share code, notes, and snippets.

Rank User Link Total
---- ---------------------------- -----
1 Martin Büttner 37
2 Peter Taylor 34
3 Dennis 33
3 Optimizer 33
5 isaacg 32
6 Sp3000 31
6 Doorknob 31
6 Calvin's Hobbies 31
Rank User Link Total
---- ------------------ -----
1 palacsint 40
2 Jamal 39
2 rolfl 39
2 Malachi 39
5 200_success 37
5 Simon Forsberg 37
5 Mat's Mug 37
8 RubberDuck 36
@The-Quill
The-Quill / shtripedrheview.md
Created February 18, 2016 12:52
shtriped rheview

#Speling You mispeled SEPERATOR.


#Naming

Try and avoid single character or abbreviated names:

strToInt(s)

  • _ is an indescriptive name
  • %p<1 are you trying to modulo from a boolean? what the fuck
  • _-p oh god why
  • this is just nasty
@The-Quill
The-Quill / meh.md
Created February 23, 2016 12:53
mehmehmeh.meh
  • Follow snake_case
  • it=int=input( ""'') does this even fucking compile?
  • MyNumberCounter= 10 whitespace between operators
  • try : not this operator
  • while not: could swap to == False
  • (it) does nothing
  • int don't name a variable with a type name
  • mix of tabs and spaces, you evil, evil person
  • MyNumberCounter() the type is an int, not a function or generator, this probably won't compile
  • loop is not defined
  • with is deprecated
  • you only access one property on window, so just access it directly
  • 094 this can acidentally convert to hex, so just use 94, also the 0 is extraneous in that case anyway
  • there's no reason to make 94 as a variable
  • varName is indescriptive

Yes, yes it does.

:p

You actually can't. This doesn't do what it looks like (precedence).

You can reverse the condition, it just would need a little editing

It does :D

Yes, yes it does.

:p

You actually can't. This doesn't do what it looks like (precedence).

You can reverse the condition, it just would need a little editing

It does :D

i=1e300;for(;;i-->0){while(i&&alert('foo'));}

  • define i in the loop
  • use the var keyword to define variables (or let, when using for loop iterator variables)
  • i-->0 i is not how you make an ascii bow in javascript, D works better: D--> D -->0 (but seriously, write it properly. same effect)
  • while(i&amp;&amp;alert('foo') wouldn't this be slimmer if you put the alert in the loop? while(i)alert('foo')
@The-Quill
The-Quill / PPCGswagusers.txt
Created February 23, 2016 20:26
Users getting PPCG swag
Martin Büttner
Dennis
Sp3000
Digital Trauma
Doorknob
Calvin's Hobbies
xnor
Peter Taylor
isaacg
marinus