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

Fallacies of Doom - JavaZone 18

Fallacies of Doom - JavaZone 18

Mahmoud Abdelghany

September 12, 2018
Tweet

More Decks by Mahmoud Abdelghany

Other Decks in Programming

Transcript

  1. @blackbeard0x14e @blackbeard0x14e Boring intro: history • id Software: Unusual company

    creating ‘innovative’ games(Rover, Dave, Keen, Wolf3D, Doom, Quake) • Self taught era, efficient coding style(s) ◦ Nerd rage anecdote • Djoom3==fun • So why the boring awesome intro?
  2. @blackbeard0x14e @blackbeard0x14e Operator overloading cout << ”Total price: “ <<

    price*quantity << endl; c->J1 * c->body1->acceleration + c->J2 * c->body2->acceleration + invStep * (c->c1 + c->c2); c.J1.oMultiply(c.body1.acceleration).oPlus(c.J2.oMultiply(c.body2.acceleration) ).oPlus((c.c1.oPlus(c.c2)).oMultiply(invStep)); [2] https://www.cs.virginia.edu/~evans/cs655/readings/steele.pdf
  3. @blackbeard0x14e @blackbeard0x14e Operator overloading idMat3 a, b, c, z; z

    = a + b * c; z = a.oPlus(b).oMultiply(c); z = b.oMultiply(c).oPlus(a);//technically correct z = a.oPlus(b.oMultiply(c));//compiler correct
  4. @blackbeard0x14e @blackbeard0x14e Immutability; const vs final • final for variables

    sucks • final for functions sucks less • final for classes rocks [1] ftp://ftp.idsoftware.com/idstuff/doom3/source/CodeStyleConventions.doc
  5. @blackbeard0x14e weird(tips...tricks...pitfalls) -list Integer a = 42; Integer b =

    42; System.out.println(a == b); Integer c = 666; Integer d = 666; System.out.println(c == d); String e = “666”; String f = “666”; String g = new String(“666”); System.out.println(e == f); System.out.println(f == g);
  6. @blackbeard0x14e @blackbeard0x14e A backwards compatible story? •Why is backwards compatibility

    the default mode of operation? •Why not make it optional with compile/runtime warnings/errors?