Hacker News new | past | comments | ask | show | jobs | submit login

> By one letter!

Yes, by one letter. Out of 6. "using" is 16% shorter than "import". And it uses better keyboard alternation (the first 4 letters of `import` are on the right side of a qwerty keyboard, the last 2 on the other, for using the only "i" and "n" are consecutive letters on the same half of the keyboard).

So "using" is 1. introduced first 2. the primarily documented import mechanism 3. significantly shorter and 4. significantly more comfortable to type.

If Julia's community doesn't want people to use it everywhere, they're doing a very, very good job of fucking with and victimising their users by way over-incentivising the use of `using` over `import`.

> And in the right direction: for trying things out interactively, `using ThePackage` and then having everything available is great.

And for writing maintainable code it's terrible, despite being by far the easiest and most convenient solution.

ChrisRackauckas complains that people use `using` over `import`, literally everything in the language and documentation pushes them towards it.

Putting the convenience of interactive sessions way, way over that of proper programs does not seem like "the right direction" to me, especially not when people then jump on their high horses and chide users for doing what the language unambiguously pushes them towards.

> But serving both of these needs seems like a valid design goal.

Python does that just fine: it provides convenience for interactive use without pushing users towards the least maintainable and desirable option.




But you have to type `python3` which is 7 letters to 5, if we're counting :)

Seriously though, it's hard to write one manual which gives everyone the perfect on-ramp for their needs. I actually think it's fair to aim it low, make it easy for matlab refugees to get started, interactively. People who know how namespacing works in several other languages (and intend to write big projects) are the ones well-equipped to know how to dig deeper. Nobody has been victimised!


> But you have to type `python3` which is 7 letters to 5, if we're counting :)

Of course, that was actually a pretty big consideration during the "vcs wars", both the length and the alternation of VCS commands.

> I actually think it's fair to aim it low, make it easy for matlab refugees to get started, interactively.

Then don't whine that people use that, and police your community.

> Nobody has been victimised!

Well how's that for dishonesty. ChrisRackauckas pretty much goes "this article is invalid because you're doing exactly what the languages suggests and incentivises" half a dozen comments above.


My point was that counting letters in one short command seems myopic here, it's not something you type in isolation. Julia package names tend to be much longer and more explicit than python/R ones. But julia code (at least mine) tends to be more compact, partly because I can write things like A ⊗ B instead of np.kron(A,B).

As far as I'm aware there is no budget for a police force. There is, however, a double-your-money-back guarantee on all advice from blog posts!

I do think the manual could be clearer about using/import. Perhaps this should be emphasised under workflow [1], and packaging differences from Python included in the list [2]. The experts have forgotten what the pain-points were; contributions from those who have not are thus welcomed.

[1] https://docs.julialang.org/en/v1/manual/workflow-tips/ [2] https://docs.julialang.org/en/v1/manual/noteworthy-differenc...


>Yes, by one letter. Out of 6. "using" is 16% shorter than "import". And it uses better keyboard alternation (the first 4 letters of `import` are on the right side of a qwerty keyboard, the last 2 on the other, for using the only "i" and "n" are consecutive letters on the same half of the keyboard).

Counterpoint: I am going to attempt an autocomplete after two characters by pressing tab. Typing 'us' leaves my left hand, the tab hand, as the last used hand before the tab. This prevents me from buffering the tab by moving my hand into position while typing the first two characters. 'im' is typed very easily with my right hand and while I'm typing that, my left hand is free to move into position over the tab key.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: