Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Fallacies of Doom - JavaZone 18
Search
Mahmoud Abdelghany
September 12, 2018
Programming
0
280
Fallacies of Doom - JavaZone 18
https://2018.javazone.no/program/08e6d34f-b8e2-45d0-af04-83f6dc68c316
Mahmoud Abdelghany
September 12, 2018
Tweet
Share
More Decks by Mahmoud Abdelghany
See All by Mahmoud Abdelghany
Fallacies of Doom - RivieraDEV 19
blackbeard334
0
180
Fallacies of Doom - Devoxx BE 17
blackbeard334
0
190
Other Decks in Programming
See All in Programming
今の SmartHR にエンジニアで入社するとどうなるの?
daisukeshinoku
1
500
品質が高いコードって何?Rev2.1
ickx
1
490
TDDと今まで
kanayannet
0
140
OpenTelemetry のサービスという概念について
azukiazusa1
1
400
上手な探索的テストとその上達方法について
matsu802
4
650
「コンパイル時のユニットテスト」導入するとユニットテストを 書かなくてよくなるのか?
tomohisa
9
2.2k
DocC Tutorial と TCA におけるテスト機能の紹介
kalupas226
1
330
Deno に Web 標準 API を実装する / Implementing Web Standard API to Deno
petamoriken
0
350
イベントストーミングによるオブジェクトモデリング・オブジェクト指向プログラミングの適用・開発プロセスの変遷・アーキテクチャの変革 / Object modeling with Event Storming.
nrslib
12
3k
プロンプトエンジニアリング入門
tomokusaba
2
980
App Router への移行は「改善」となり得るのか?/ Can migration to App Router be an improvement
takefumiyoshii
1
120
SwiftUI, Jetpack Composeの導入で変化した「家族アルバム みてね」のアプリ開発体験
hicka04
6
400
Featured
See All Featured
Robots, Beer and Maslow
schacon
PRO
154
7.9k
Building Better People: How to give real-time feedback that sticks.
wjessup
350
18k
[RailsConf 2023] Rails as a piece of cake
palkan
21
3.8k
10 Git Anti Patterns You Should be Aware of
lemiorhan
644
57k
How GitHub Uses GitHub to Build GitHub
holman
467
290k
The Invisible Customer
myddelton
114
12k
How to train your dragon (web standard)
notwaldorf
71
5.1k
KATA
mclloyd
14
11k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
6
950
Fontdeck: Realign not Redesign
paulrobertlloyd
75
4.8k
Designing on Purpose - Digital PM Summit 2013
jponch
109
6.4k
Code Reviewing Like a Champion
maltzj
512
39k
Transcript
Fallacies of Doom Lessons learned from porting Doom 3 to
Java
@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?
@blackbeard0x14e
@blackbeard0x14e wishlist “ C++ protects against accident, not against fraud.
” Bjarne Stroustrup
@blackbeard0x14e
@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
@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
@blackbeard0x14e
@blackbeard0x14e >>>
@blackbeard0x14e @blackbeard0x14e Unsigned primitives Runtime or compile-time error??
@blackbeard0x14e @blackbeard0x14e Unsigned primitives
@blackbeard0x14e @blackbeard0x14e Unsigned primitives Microbenchmark alert:
@blackbeard0x14e
@blackbeard0x14e @blackbeard0x14e Immutability; const vs final
@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
@blackbeard0x14e @blackbeard0x14e sizeof( )
@blackbeard0x14e @blackbeard0x14e sizeof( )
@blackbeard0x14e @blackbeard0x14e Enum
@blackbeard0x14e @blackbeard0x14e Enum
@blackbeard0x14e @blackbeard0x14e Enum
@blackbeard0x14e @blackbeard0x14e Grandfather inheritance • Super.super.function • Why are equals/hashcode
inherited?!
@blackbeard0x14e
@blackbeard0x14e @blackbeard0x14e Pointers
@blackbeard0x14e @blackbeard0x14e Pointers
@blackbeard0x14e @blackbeard0x14e Pointers
@blackbeard0x14e @blackbeard0x14e Pointers
@blackbeard0x14e (thank God we don’t have this…)-list System.out.println( (byte)~(char)-(int)+(long)-1 );
@blackbeard0x14e @blackbeard0x14e Death by Macros [3] https://blogs.msdn.microsoft.com/oldnewthing/20050106-00/?p=36783 [4] https://youtu.be/4cCeUfzH-No?t=23m
@blackbeard0x14e
@blackbeard0x14e @blackbeard0x14e Death by Macros
@blackbeard0x14e @blackbeard0x14e Death by Macros
@blackbeard0x14e @blackbeard0x14e Death by Macros
@blackbeard0x14e
@blackbeard0x14e @blackbeard0x14e Hungarian Camels [5]https://www.joelonsoftware.com/2005/05/11/making-wrong-code-look-wrong/ [6] https://steve-yegge.blogspot.nl/2006/03/execution-in-kingdom-of-nouns.html
@blackbeard0x14e Hungarian Camels
@blackbeard0x14e @blackbeard0x14e Unholy union
@blackbeard0x14e @blackbeard0x14e Unholy union: SDL_events.h
@blackbeard0x14e Unholy union
@blackbeard0x14e @blackbeard0x14e Unholy union
@blackbeard0x14e nice to have -list “ Object-oriented design is the
roman numerals of Computing. ” Rob Pike
@blackbeard0x14e
@blackbeard0x14e @blackbeard0x14e Destructor • Deconstructors • Finalize(@deprecated) • Autocloseable++
@blackbeard0x14e Default arguments
@blackbeard0x14e @blackbeard0x14e string::insert, string::swap
@blackbeard0x14e @blackbeard0x14e Inlining
@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);
@blackbeard0x14e @blackbeard0x14e The memory watcher
@blackbeard0x14e @blackbeard0x14e 5.1.2. Widening Primitive Conversion
@blackbeard0x14e @blackbeard0x14e Pop goes the callstack
@blackbeard0x14e @blackbeard0x14e Floating point operator precedence
@blackbeard0x14e @blackbeard0x14e Floating point operator precedence
@blackbeard0x14e
@blackbeard0x14e @blackbeard0x14e Floating point operator precedence
@blackbeard0x14e @blackbeard0x14e Floating point operator precedence
@blackbeard0x14e @blackbeard0x14e Conditional breakpoints
@blackbeard0x14e @blackbeard0x14e Conditional breakpoints •Sloooow(interpretive) Microbenchmark alert:
@blackbeard0x14e @blackbeard0x14e A backwards compatible story?
@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?
@blackbeard0x14e @blackbeard0x14e Sometimes the bug isn’t in your code...T_T
@blackbeard0x14e @blackbeard0x14e
@blackbeard0x14e Questions...while the Demo loads? https://github.com/blackbeard334/djoom3