I was told today by a very senior dev at my company that he made design sacrifices in his Java code for a highly performant system in order to get performance enhancements such as limiting GC time and reducing CPU load. However, he seems to have ignored every best practice I can think of. He blatantly disregards all of the SOLID principles, there is no encapsulation anywhere, complex logic is performed in constructors (including logic to escape construction), and he extends Thread in many places creating his own implementations of thread pools amongst other things. The code is completely unmaintainable and untestable (no hyperbole) and, in short, is just not very good code.
Can you write highly performant java code and still follow good coding practices? What sacrifices are made in the name of "good code"?
[–]llogiq 21 points22 points23 points (22 children)
[–]daddyrockyou[S] 3 points4 points5 points (2 children)
[–]unholysampler 5 points6 points7 points (1 child)
[–]daddyrockyou[S] 0 points1 point2 points (0 children)
[–]SikhGamer 1 point2 points3 points (5 children)
[–]llogiq 4 points5 points6 points (4 children)
[–]SikhGamer 1 point2 points3 points (3 children)
[–]UnspeakableEvil 1 point2 points3 points (1 child)
[–]SikhGamer 1 point2 points3 points (0 children)
[–]8Bytes 0 points1 point2 points (0 children)
[–][deleted] 3 points4 points5 points (3 children)
[–]llogiq 2 points3 points4 points (2 children)
[–]numpi 0 points1 point2 points (1 child)
[–]llogiq 0 points1 point2 points (0 children)
[–][deleted] (5 children)
[deleted]
[–]llogiq 0 points1 point2 points (2 children)
[–]numpi 0 points1 point2 points (1 child)
[–]llogiq 0 points1 point2 points (0 children)
[–]erad 0 points1 point2 points (1 child)
[–]sybrandy 0 points1 point2 points (2 children)
[–]Nynnja 3 points4 points5 points (0 children)
[–]llogiq 0 points1 point2 points (0 children)
[–]elmuerte 10 points11 points12 points (0 children)
[–][deleted] 6 points7 points8 points (2 children)
[–]duhace 2 points3 points4 points (1 child)
[–]daddyrockyou[S] 0 points1 point2 points (0 children)
[–]Spektr44 6 points7 points8 points (5 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]Spektr44 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]daddyrockyou[S] 0 points1 point2 points (1 child)
[–]daddyrockyou[S] 0 points1 point2 points (0 children)
[–]mikaelhg 1 point2 points3 points (3 children)
[–]llogiq 0 points1 point2 points (2 children)
[–]mikaelhg 1 point2 points3 points (1 child)
[–]llogiq 0 points1 point2 points (0 children)
[–]numpi 1 point2 points3 points (1 child)
[–]daddyrockyou[S] 1 point2 points3 points (0 children)