←back to thread

490 points jarmitage | 1 comments | | HN request time: 0.206s | source
Show context
paulluuk ◴[] No.40681492[source]
While this is really cool, I have to say..

> import warp as wp

Can we please not copy this convention over from numpy? In the example script, you use 17 characters to write this just to save 18 characters later on in the script. Just import the warp commands you use, or if you really want "import warp", but don't rename imported libraries, please.

replies(5): >>40681523 #>>40681706 #>>40681974 #>>40683394 #>>40685824 #
2cynykyl ◴[] No.40685824[source]
This math is not adding up for me...isn't import warp necessary? So you only 6 more characters to write as wp. And anyway, to me savings in cognitive load later when I'm in the flow of coding is worth it.
replies(1): >>40726630 #
1. paulluuk ◴[] No.40726630[source]
Well it depends whether you're going to import all of warp or just the functions you need. But you're right for the most part, if you're just going to do "import warp" then my math is off indeed.

Anyway, I also don't really care that much about character count -- but it's the only reason I could think of for why someone would want to rename "warp" to "wp". If anything, abbreviating libraries like this will add more cognitive load because you have to remember what all the abbreviations mean and how to import them.