Day 147
Quotes
There are two sorts of comments - “What” comments and “Why” comments.
“What” comments tell you what the code is doing. In a lot of cases, depending on the language, the need for these can be reduced by writing clear code. This is much easier in, say, Python than Assembly. Even in Python though, sometimes you can be doing something a bit subtle where a 2 line comment can clear things up. These comments aren’t irreplaceable because with a bit of reading and work, you have all the information to work out what is happening.
“Why” comments are much more important - telling the reader WHY the code is doing whatever it is that it’s doing. The ’trim()’ comment referenced in the article is a great example of a Why comment - all the reading around the code wouldn’t give you an explanation (although sometimes git blame will).
Many ‘what’ comments are superfluous, almost no ‘why’ comments are - they are the collective memory of design decisions that otherwise lives in people’s heads. (HN)
Linux sandboxing
For programs I don’t trust, Firejail seems okay. firejail <appname>
.
Android ADB Push
Still works as I remembered it. adb push <sourcefile/s> <location>
, where location
in my case is storage/sdcard0
for the memory and storage/FD...
for the sdcard. adb shell
is very nice also.