3 ms·
Why import A from B, and not from B import A, like in python instead ?
by revskill 6y ago
Why import A from B, and not
from B import A, like in python instead ?
- tym0 6y agoProbably because it looks like an assignment. import { a } from "lib" const { b } = a Also it "sounds" like something one would say.
- have_faith 6y agoWhat's the practical difference?
- kall 6y agoThe python way makes autocomplete more practical
- abdusco 6y agoYou can get intellisense easily with python because by the time you've written a package name, IDE will start suggesting symbols to you from sys import <suggestions> compared to node, where I have to write import {} from 'path' then move the cursor in the braces and hit [Ctrl] + [Space] to trigger intellisense import {<suggestions>} from 'path' which feels backwards to me.
- jayflux 6y agoThis is being looked at https://github.com/microsoft/TypeScript/issues/31658 https://github.com/microsoft/TypeScript/issues/31658