4 ms·
//for every for(int i = 0; i < things.length; i++){ //there's a dx = x - tx/mf; dy = y - ty/mf; } //but then for every distanceToTarget =
by GhotiFish 14y ago
//for every
for(int i = 0; i < things.length; i++){
//there's a
dx = x - tx/mf;
dy = y - ty/mf;
}
//but then for every
distanceToTarget = Math.SquareRoot(xDistance*xDistance + yDistance*yDistance)
//there's a
for(int index = 0; index < robotsCurrentlyInField.length; index++)
{
robotsCurrentlyInField[index].ohGodMyFingersAreBleeding(distanceToTarget);
}
- cryptoz 14y agodi[ctrl+space] = Math.Sq[ctrl+space](xD+[ctrl+space] ... robo[ctrl+space][index].ohG[ctrl+space] Every editor I've used in about 10 years has had an excellent autocomplete feature. I've never had to type out such long variable names.
- Turing_Machine 14y agoReading is arguably more important than typing. Being able to fit more code on the screen has its advantages, too.
- GhotiFish 14y agoEven in the age of 1080p I agree with you. Side by side code samples, or having documentation up next to code, is very useful. However, if super verbosity pushes your code width to 120 characters, the screen real-estate needed is too much.
- Turing_Machine 14y agoSomething like thing.horizontalPositionInTransformedAndScaledUnits may be slightly clearer the first time but becomes counterproductive when there are 20 of them on the same screen, especially if there are 20 thing.verticalPositionInTransformedAndScaledUnits mixed in. Your eyes just start to glaze over (or at least mine do). If you're only ever using one coordinate system, just use thing.x and thing.y or thing.h and thing.v, maybe with a comment that explains that these are in transformed and scaled units. Your eyes will thank you. :-)
- aroberge 14y agoPhysicist here. I never have to read such long variable names, which would make it much more difficult to spot bugs. I do undertand that long variable names have their place but, when it comes to programming numerical code which is a translation of actual equations, shorter names make it much easier to read and spot mistakes. I do wish that I could use a programming editor that could look like a TeX output on the screen though ...
- lutusp 14y ago> I do wish that I could use a programming editor that could look like a TeX output on the screen though ... For other readers (I suspect you already know this), Mathematica and Sage (and other environments) do a pretty good job of providing TeX-like feedback on what you've just typed in (but not keystroke-by-keystroke, which would be nice). For those unfamiliar with Sage: http://www.sagemath.org/ http://www.sagemath.org/ My Sage tutorial: http://arachnoid.com/sage http://arachnoid.com/sage
- archgoon 14y ago> I do wish that I could use a programming editor that could look like a TeX output on the screen though ... This was one of the design goals of the Fortress project http://labs.oracle.com/projects/plrg/Publications/fortress.1.0.pdf http://labs.oracle.com/projects/plrg/Publications/fortress.1... Scroll down to section 2.3 'Rendering'. Sadly the project is now defunct.