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
420
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
190
Fallacies of Doom - Devoxx BE 17
blackbeard334
0
210
Other Decks in Programming
See All in Programming
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
390
Result型で“失敗”を型にするPHPコードの書き方
kajitack
5
570
RailsGirls IZUMO スポンサーLT
16bitidol
0
140
XP, Testing and ninja testing
m_seki
3
220
VS Code Update for GitHub Copilot
74th
2
580
PHP 8.4の新機能「プロパティフック」から学ぶオブジェクト指向設計とリスコフの置換原則
kentaroutakeda
2
720
設計やレビューに悩んでいるPHPerに贈る、クリーンなオブジェクト設計の指針たち
panda_program
6
1.8k
0626 Findy Product Manager LT Night_高田スライド_speaker deck用
mana_takada
0
140
Quand Symfony, ApiPlatform, OpenAI et LangChain s'allient pour exploiter vos PDF : de la théorie à la production…
ahmedbhs123
0
130
イベントストーミング図からコードへの変換手順 / Procedure for Converting Event Storming Diagrams to Code
nrslib
2
590
Webの外へ飛び出せ NativePHPが切り拓くPHPの未来
takuyakatsusa
2
470
Deep Dive into ~/.claude/projects
hiragram
11
2.3k
Featured
See All Featured
A designer walks into a library…
pauljervisheath
207
24k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
YesSQL, Process and Tooling at Scale
rocio
173
14k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.3k
Being A Developer After 40
akosma
90
590k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.5k
Producing Creativity
orderedlist
PRO
346
40k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
138
34k
Six Lessons from altMBA
skipperchong
28
3.9k
Building Adaptive Systems
keathley
43
2.6k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
810
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