Re:Tesla's Simultaneous Brilliance and Incompetence Revealed...
by falsedan on Friday April 27, 2018 @05:57PM
(#16944777)
For a lay person, sure. But these are experts at automotive engineering. Imagine if you were reviewing a new developer's code, and you were puzzled by a particularly non-idiomatic implementation where you can't see the reasons for avoiding the idiomatic version. Are you going to think that maybe this is some technique you're unfamiliar with, or that the person who'se still quite new to developing might not be aware of the idiomatic verions?
[ Parent
| on HN ]
Re:Tesla's Simultaneous Brilliance and Incompetence Revealed...
by derekp7 on Friday April 27, 2018 @06:11PM
(#16944861)
So a good example of this in code would be:
a = a xor b; b = a xor b; a = a xor b;
In this case it is a technique for swapping two variables without using a third variable. But it really serves no efficiency purpose in most applications (however it is fun to use).
Re:Tesla's Simultaneous Brilliance and Incompetence Revealed...
by samatman on Friday April 27, 2018 @06:35PM
(#16944978)
Which comes with the obligatory reminder that it fails when a == b.
Re:Tesla's Simultaneous Brilliance and Incompetence Revealed...
by twtw on Friday April 27, 2018 @06:46PM
(#16945016)
No it doesn't. xor swap works fine when the two values are equal. The problem is when &a == &b.
Re:Tesla's Simultaneous Brilliance and Incompetence Revealed...
by rando444 on Friday April 27, 2018 @06:01PM
(#16944806)
I get where you're coming from, but Tesla engineers have seen those flanges and that extra steel in crash tests where these engineers have not.
Your example would be more akin to assessing someone's code and pointing out potential flaws without ever executing it.
Re:Tesla's Simultaneous Brilliance and Incompetence Revealed...
by sangnoir on Friday April 27, 2018 @06:18PM
(#16944898)
> Your example would be more akin to assessing someone's code and pointing out potential flaws without ever executing it.
You've just described a code review, which is standard practice and not controversial. If an expert doesn't understand your code, maybe the criticism is informed by their experience.
Re:Tesla's Simultaneous Brilliance and Incompetence Revealed...
by andrewflnr on Friday April 27, 2018 @08:04PM
(#16945377)
On the other hand: "take note that I have only proven this code correct, not tested it." Code review is performed in the understanding that its results are basically heuristic. Everyone knows that actual behavior trumps anything you get from just looking at something.