Live data from Hacker News

From novice to master, and back again (2013)

blog.djmnet.org

121–130 of 150 posts

Re: From novice to master, and back again (2013)

#121
post #116

I live by command line history and timestamps. I wish there was even better way to preserve the context of what you were doing at the time (env variables, current path at the time etc).

Developing your own functions. A VERY useful trick to make your usual command line chains to be stored in a single [hopefully meaningful] command.

PS: be sure to always have a -—help option that describes the function, just as you would do when programming

Re: From novice to master, and back again (2013)

#122
post #96

Earlier quoted context omitted.

Ah, I remember it is the non-intuitive one, but then when I use it a while, I keep double-guessing which one is the intuitive one. Kind of like when my wife tells me I'm doing something wrong and she wants it to be the other way.. I know she thinks this thing is important, but can't work out which way she wants it done.

The intuitive one is the order in which `ls` displays it, or assignment order (a := b). That’s how I remember what the intuitive order is. ;)

Surely the intuitive order for mutating assignment is value → name, though...

Re: From novice to master, and back again (2013)

#123
post #68

Earlier quoted context omitted.

Worse : You Google a question and realise you yourself asked it many moons ago and it never got answered.

Worst: you find your own answer that says: “Nvm, fixed the issue.”

I have a notesfile on how to fix/debug things. When I started it, I would write things down after I fixed something and figured I'd need to remember it later.

Problem was, I would often forget to write things down, or naively think "that was quick to find out, don't need to write it down", which is a classic mistake of confusing post-facto mindset with pre-facto.

So now when I wonder how to do a thing, I first write down in my notesfile what my question is, so when I do resolve it I go and write down the answer to satisfy my need for closure.

Re: From novice to master, and back again (2013)

#124

Earlier quoted context omitted.

I think that using dd is a character flaw.

To expand on this, people needlessly cargo-cult arcane dd commands, but on many (most?) systems, "cp foo.iso /dev/sdb" will do the same thing, but with possibly even better performance!

What I meant was that using dd to take format/backup disks is just way too dangerous for human beings. The prospect of losing your precious data even once in your lifetime is too expensive a cost for the questionable benefit of feeling cool about doing backups by running a command on the terminal. Just use a gui tool for writing to physical disks. The additional visual feedback that a gui can provide is absolutely essential for human beings performing such a dangerous operation.

Re: From novice to master, and back again (2013)

#125
post #29

Earlier quoted context omitted.

Before enlightenment: chop wood, carry water After enlightenment: chop wood, carry water

Where does existential dread fit in there?

It fits between the kama used to harvest rice and the comma used to separate those thoughts.

Re: From novice to master, and back again (2013)

#126
post #72

Earlier quoted context omitted.

What finally got the `ln` argument order engraved in my mind was learning that you can skip the destination argument: ln -s /foo/bar/baz will create a soft link in the CWD named baz, pointing to /foo/bar/baz. So you see, if you know that you can always skip the destination, then, logically, the source must be the first one!

I'd say the easiest way to remember the argument order is that it's conceptually the same as for mv and cp: ln -s x y is the closest possible symlink-analogue of cp x y.

This a great way to think about it.

Re: From novice to master, and back again (2013)

#127
This is one reason answering questions on StackOverflow is so rewarding. You can save future you a ton of trouble by putting a (better) answer there and then stumbling onto it later. Ditto blog posts. Power tip: this also works for personal journals in searchable format.

Re: From novice to master, and back again (2013)

#128

Zen Koan: Before I began my studies in Zen, I thought a tree was a tree and a stone, a stone. When I started to study Zen, I could see that a tree was not a tree, and a stone was not a stone. Now that I am a Zen master, I know that a tree is a tree and a stone is a stone. -- Source: my buddy in college I think you come full circle to learn that you can only keep so much in your head at one time and that you're always…

It is pretty cool. When I was little I had no idea what it means, just knew that it sounds cool. But the older I get that more I see these patterns. junior dev: python is so cool! senior dev: python is slow. No type checking. The syntax is garbage. John Carmack: I write a lot of python and I use it exactly for what it is good for!

if only the Carmack level was attainable for us mortals; I've moments where I trick myself into writing passable code but after a little research the same memory order semantics from my IDE stare back at me from Carmack's Doom 3 code 20 years ago. RIP

Re: From novice to master, and back again (2013)

#129

Earlier quoted context omitted.

"It's like regex" could be another punchline for the joke

My biggest problem with regex is each language/program/whatever has their own take on it. You don't have to learn it over and over, you have to learn multiple slightly different versions of it over and over.

been recently learning Python in earnest. Coming from Perl, Ruby, PHP, JavaScript, etc. I'm just dumbfounded. How on earth did Python's regex library get to be so bad? It's like it was designed by people that were figuring out how regexes worked as they went along but must have skipped the part about modifiers, how anchoring works, etc. No wonder so many people hate regexes. The ironic part is Python's "one obvious way to do it" zen thing. It has like 5 different ways to do the same thing with a regex whereas Perl, the "more than one way to do it" camp has simple and obvious ways to do everything with regex. I love regex in Perl. In Python I don't want to touch it ever again. Even JavaScript is miles better.

Re: From novice to master, and back again (2013)

#130
post #72

Earlier quoted context omitted.

I use the `ln` command a lot. I use the `man ln` command _almost_ as much.

What finally got the `ln` argument order engraved in my mind was learning that you can skip the destination argument: ln -s /foo/bar/baz will create a soft link in the CWD named baz, pointing to /foo/bar/baz. So you see, if you know that you can always skip the destination, then, logically, the source must be the first one!

The other way to think about it is that it's the same order as cp.
Post reply on HN