4 ms·
I’m primarily a Python dev but I’ve been recently working on a React codebase. One of the things that’s been driving me insane is how the default way to import
by xrisk 4y ago
I’m primarily a Python dev but I’ve been recently working on a React codebase. One of the things that’s been driving me insane is how the default way to import things is without a namespace, aka:
`import {foo} from ‘bar’;`
This makes reading code really really hard as I can’t tell where some symbol is coming from.
There also seems to be a general aversion against using classes to model types. Instead we have a host of functions that manipulate JSON/dataclasses, which means business logic is scattered around 10 different places!
- __alexs 4y agoYeah there's a lot of weird design choices in JS code. I'm not sure all of them really make sense given the modern state of the language but old habits die hard.
- IshKebab 4y ago> This makes reading code really really hard as I can’t tell where some symbol is coming from. That's why you use Typescript then you can just hover something or ctrl-click it. Anyway Python is exactly the same in my experience. Sometimes people `import numpy as np` or whatever but most of the time they `from foo import X, y, z`.
- vasergen 4y agoI don't like more the default exports / imports. In this case one can import using completely different name and then it is even harder. Also it won't be changed while renaming utill the developer will go in all other places and do it manually