Upgrade to Pro — share decks privately, control downloads, hide ads and more …

I am bad at my job.

Matt Robenolt
September 28, 2017

I am bad at my job.

App Academy - September 28th 2017

Matt Robenolt

September 28, 2017
Tweet

More Decks by Matt Robenolt

Other Decks in Technology

Transcript

  1. #include <stdio.h> int main() { int i = 0; int

    things[] = {10, 20}; for (; i < 3; i++) { printf("%d\n", things[i]); } return 0; }
  2. #include <stdio.h> int main() { int i = 0; int

    things[] = {10, 20}; for (; i < 3; i++) { printf("%d\n", things[i]); } return 0; } $ ./program
  3. #include <stdio.h> int main() { int i = 0; int

    things[] = {10, 20}; for (; i < 3; i++) { printf("%d\n", things[i]); } return 0; } $ ./program 10 20 619512036
  4. #include <stdio.h> int main() { int i = 0; int

    things[] = {10, 20}; for (; i < 3; i++) { printf("%d\n", things[i]); } return 0; } $ ./program 10 20 619512036 $ ./program 10 20 369033241
  5. #include <stdio.h> int main() { int i = 0; int

    things[] = {10, 20}; for (; i < 3; i++) { printf("%d\n", things[i]); } return 0; } Physical Memory Chip 0x0000 0x0004 4 bytes 0x0008 0x000C 0xFFFF
  6. #include <stdio.h> int main() { int i = 0; int

    things[] = {10, 20}; for (; i < 3; i++) { printf("%d\n", things[i]); } return 0; } Physical Memory Chip 0x0000 0x0004 4 bytes 0x0008 0x000C 0xFFFF 0x0000 (0)
  7. #include <stdio.h> int main() { int i = 0; int

    things[] = {10, 20}; for (; i < 3; i++) { printf("%d\n", things[i]); } return 0; } Physical Memory Chip 0x0000 0x0004 4 bytes 0x0008 0x000C 0xFFFF 0x000A (10) 0x0014 (20) 0x0000 (0)
  8. #include <stdio.h> int main() { int i = 0; int

    things[] = {10, 20}; for (; i < 3; i++) { printf("%d\n", things[i]); } return 0; } Physical Memory Chip 0x0000 4 bytes 0x0008 0x000C 0xFFFF 0x000A (10) 0x0014 (20) 0x0000 (0) 0x0004
  9. #include <stdio.h> int main() { int i = 0; int

    things[] = {10, 20}; for (; i < 3; i++) { printf("%d\n", things[i]); } return 0; } Physical Memory Chip 0x0000 4 bytes 0x0008 0x000C 0xFFFF 0x000A (10) 0x0014 (20) 0x0000 (0) 0x0004 “address of things” + (i * sizeof(int))
  10. #include <stdio.h> int main() { int i = 0; int

    things[] = {10, 20}; for (; i < 3; i++) { printf("%d\n", things[i]); } return 0; } Physical Memory Chip 0x0000 4 bytes 0x0008 0x000C 0xFFFF 0x000A (10) 0x0014 (20) 0x0000 (0) 0x0004 0x0004 + (0 * 4) == 0x0004 &0x0004 == 0x000A (10)
  11. #include <stdio.h> int main() { int i = 0; int

    things[] = {10, 20}; for (; i < 3; i++) { printf("%d\n", things[i]); } return 0; } Physical Memory Chip 0x0000 4 bytes 0x0008 0x000C 0xFFFF 0x000A (10) 0x0014 (20) 0x0001 (1) 0x0004
  12. #include <stdio.h> int main() { int i = 0; int

    things[] = {10, 20}; for (; i < 3; i++) { printf("%d\n", things[i]); } return 0; } Physical Memory Chip 0x0000 4 bytes 0x0008 0x000C 0xFFFF 0x000A (10) 0x0014 (20) 0x0001 (1) 0x0004 0x0004 + (1 * 4) == 0x0008 &0x0008 == 0x0014 (20)
  13. #include <stdio.h> int main() { int i = 0; int

    things[] = {10, 20}; for (; i < 3; i++) { printf("%d\n", things[i]); } return 0; } Physical Memory Chip 0x0000 4 bytes 0x0008 0x000C 0xFFFF 0x000A (10) 0x0014 (20) 0x0002 (2) 0x0004
  14. #include <stdio.h> int main() { int i = 0; int

    things[] = {10, 20}; for (; i < 3; i++) { printf("%d\n", things[i]); } return 0; } Physical Memory Chip 0x0000 4 bytes 0x0008 0x000C 0xFFFF 0x000A (10) 0x0014 (20) 0x0002 (2) 0x0004 0x0004 + (2 * 4) == 0x000C &0x000C == ???? ????
  15. sentry $ find node_modules -type f | wc -l 36882

    sentry $ du -hs node_modules 308M node_modules
  16. function multiply() { var rv = 1; for (var i

    = 0; i < arguments.length; i++) rv += arguments[i]; return rv; } > multiply(2, 2) <- 4
  17. test('multiply 2 * 2 to equal 4', () => {

    expect(multiply(2, 2)).toBe(4); }); 100% test coverage btw
  18. > multiply(2, 2) <- 4 > multiply() <- 1 >

    multiply(1, 1) <- 3 > multiply(1, {}) <- "2[object Object]"