5 ms·
I do indent my code, but I very rarely insert syntactically irrelevant spaces. I don't mind if clang-format (etc.) puts them in for me, but I don't add them by
by to3m 9y ago
I do indent my code, but I very rarely insert syntactically irrelevant spaces. I don't mind if clang-format (etc.) puts them in for me, but I don't add them by pressing keys myself and I don't have a problem reading code that leaves them out (since that code looks just like the code I write myself before I run it through clang-format).
This has long been my habit, since I started out on a computer with 32K RAM, where putting in extra spaces just meant you'd need to use shorter variable names to balance things out.
(Here's a photo of some representative code I wrote for a reddit contest a couple of years ago: http://ffe3.com/pics/.beeb/IMG_1373.JPG http://ffe3.com/pics/.beeb/IMG_1373.JPG - not much different from what I wrote in the early 1990s as a teenager. But I did typically use longer variable names back then, because unlike this case I wasn't concerned about fitting the whole listing on one 40x25 screen...)
Even today, doing this still means fewer L1 cache misses in the scanner.
- jmull 9y agoHa, that takes me back. I got started on Commodore BASIC on an 8K PET. Your program had to share memory with the source code, so you didn't waste bytes on spaces! (You also used single character variable names as much as possible and jammed as many statements on a line as possible since the overhead per line was a few bytes.) As a result I can still read very dense code, but I'm reformed and write code that uses white space to avoid an overly busy screen, suggest coupling in the underlying logic, aligns comments, etc.
- copx 9y agoYour code is still needlessly verbose. Have you ever seen how the ancient Romans wrote Latin? Not only no white space, no interpunctuation either, and everything in uppercase. E.g: http://ratcliffe-college.co.uk/wp-content/uploads/2015/09/Latin-IMG2.jpg http://ratcliffe-college.co.uk/wp-content/uploads/2015/09/La... So instead of.. FEO1:INX:LDAS:STX .. you should just write: FEO1INXLDASSTX Now that is concise code!
- Danihan 9y agoYet that language died, go figure..
- lomnakkus 9y agoIt has a sort of Fortran-esque feel. Almost like the classic "DOI=[etc]" parsing puzzler.
- DaiPlusPlus 9y agoYESITSVERYCONCISEHOWEVERIMNOTSUREABOUTHOWREADABLEITISWHENYOUHAVEAMBIGUOUSLYSPELLEDWORDSWHERELETTERSCOULDBELONGTOONEWORDORANOTHER.
- 0xBA5ED 9y agoSurprisingly, I didn't have a hard time reading that. Maybe because I had a good idea of what the context would be before hand... Hmmmm, interesting thought of the day.
- carapace 9y agoY cn rmv th vwls frm nglsh nd ts stll knd rdbl. You can aslo salmrbce the lteerts in wdros and as lnog as the frsit and lsat leretts are the same it is siltl raleabde. :-) OOoo! And of course there's "Ladle Rat Rotten Hut": > Wants pawn term, dare worsted ladle gull hoe lift wetter murder inner ladle cordage, honor itch offer lodge, dock, florist. Disk ladle gull orphan worry putty ladle rat cluck wetter ladle rat hut, an fur disk raisin pimple colder Ladle Rat Rotten Hut.
- grkvlt 9y ago> Where letters could be long, too? New, or do. Ran other! I see what you mean...
- userbinator 9y agoHave you done any APL? You might enjoy it.