

11·
15 days agoThanks for your opinion, Claude.


Thanks for your opinion, Claude.


You don’t need to break up the pavement to add chargers. Indoors they usually add chargers to the wall spots, outdoors add them to (solar paneled) shade structures.


If you think I have made an error, feel free to point it out. I prefer being corrected than being wrong.
I’ve never understood why people are so reluctant to admit mistakes. Insecurity? I have no problem with it.


Cost to give every household rooftop solar: 133m × $22.5k = $3b
Should be “133m × $22.5k = $3000b”… or 3 trillion. You don’t think the right side of the equation is part of the math?


Nah, I messed up looking at the answer, not with the math.
You messed up the math, so how is this admitting your mistake?
Humans are very good at pattern recognition. Cyclomatic complexity ignores that, so code that is easy for a human to read can get a bad score. E.g. handling Win API messages:
switch (msg) { case WM_CREATE: return OnCreate(hwnd, lParam); case WM_PAINT: return OnPaint(hwnd); case WM_SIZE: return OnSize(hwnd, wParam, lParam); case WM_COMMAND: return OnCommand(hwnd, wParam, lParam); case WM_TIMER: return OnTimer(hwnd, wParam); case WM_KEYDOWN: return OnKeyDown(hwnd, wParam); case WM_CHAR: return OnChar(hwnd, wParam); case WM_MOUSEMOVE: return OnMouseMove(hwnd, lParam); case WM_LBUTTONDOWN:return OnLeftButtonDown(hwnd, lParam); case WM_LBUTTONUP: return OnLeftButtonUp(hwnd, lParam); case WM_RBUTTONDOWN:return OnRightButtonDown(hwnd, lParam); case WM_RBUTTONUP: return OnRightButtonUp(hwnd, lParam); case WM_SETFOCUS: return OnFocus(hwnd, TRUE); case WM_KILLFOCUS: return OnFocus(hwnd, FALSE); case WM_CLOSE: return OnClose(hwnd); case WM_DESTROY: return OnDestroy(hwnd); }Complexity score: 17. Easy to read and verify? Yes.
LRESULT OnMouseMove(HWND hwnd, LPARAM pos) { if (tracking == dragging != selecting && (!cancelled == (buttons & MK_LBUTTON))) return UpdateInteraction(hwnd, pos); return 0; }Complexity score: 3. Easy to read and verify? No.