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
350
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
210
Other Decks in Programming
See All in Programming
採用事例の少ないSvelteを選んだ理由と それを正解にするためにやっていること
oekazuma
2
1k
testcontainers のススメ
sgash708
1
120
17年周年のWebアプリケーションにTanStack Queryを導入する / Implementing TanStack Query in a 17th Anniversary Web Application
saitolume
0
250
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
250
CSC305 Lecture 26
javiergs
PRO
0
140
HTTP compression in PHP and Symfony apps
dunglas
2
1.7k
今年のアップデートで振り返るCDKセキュリティのシフトレフト/2024-cdk-security-shift-left
tomoki10
0
200
ブラウザ単体でmp4書き出すまで - muddy-web - 2024-12
yue4u
2
460
アクターシステムに頼らずEvent Sourcingする方法について
j5ik2o
4
230
PHPで学ぶプログラミングの教訓 / Lessons in Programming Learned through PHP
nrslib
0
110
複雑な仕様に立ち向かうアーキテクチャ
myohei
0
170
useSyncExternalStoreを使いまくる
ssssota
6
1k
Featured
See All Featured
Embracing the Ebb and Flow
colly
84
4.5k
We Have a Design System, Now What?
morganepeng
51
7.3k
Typedesign – Prime Four
hannesfritz
40
2.4k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
KATA
mclloyd
29
14k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
GraphQLとの向き合い方2022年版
quramy
44
13k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.6k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
2
290
Bash Introduction
62gerente
608
210k
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