Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@Prakash
"after debugging/writing JS code"
"after"
Well, good for you that you are able to hold your tears so long.
When someone asks me to help with code Im like "okay, sure, what ya doing" but whenever they mention JS im more like "no, no, no. Just not this. Emm.. Im bussy, cya later" -
Prakash3715y
-
@Prakash you would be wrong on that part really 🤷♂️ I don't have such issues on account of knowing what I am doing. The same applies to every stack. You give it time to learn it instead of following trendy bandwaggoned opinions and you are sure to find gold my man.
Get rid of this "eWw jS" mentality. The only abstraction giving you issues is that, not the language. -
Prakash3715y@AleCx04 agree with you completely. I understand the abstractions of the languages(partially) and I certainly don't have eww JS mentality . My problem is with the design of this language. Let's take a scenario. I have 3 JS modules, and I am importing them dynamially. I want to import 4th module, only after first three are imported. As far as I know, there is no other way of doing it except using async/await, which results in sequential loading of modules(which I dont want). Other option is to nest the imports, which messes the readibility. And doing all of this on top of PolymerJS/litelement is an extra headache.
-
Prakash3715y@AleCx04 Also, if you know some way of solving the issue mentioned above, please let me know.
-
@Prakash nesting imports would be one version of it(it really does not mess readability, we know exactly what it means when people do them that way) the other way is using something like
@highlight
const myModule = './myModule.js';
import(myModule)
.then(x => x.someMethod());
From the nested module or even the file in which a the other modules are being brought in.
Did i understand this correctly? -
Prakash3715y@AleCx04 This is indeed the case when you want to import one module. Now think how would you import three of them, in parallel and then import fourth one after ensuring that first three have been imported
-
@Prakash and that is why I mention the nesting. X.someMethod would be the method nesting in the other module and so forth.
🤷♂️ nesting the modules would solve it and it would not hit readability like you mentioned dude, it would really be fine -
@Minion wouldn't that make them sequential import. I am even starting to feel that he only wants to import the modules depending certain actions.
-
Prakash3715y@AleCx04 obviously I want to import them based on some conditions(therefore, dynamic imports). Also, will look into Promise.all(). I don't think it would make the imports sequential. Although, tbh I am not sure about its working.
-
@Prakash hoooold up. We talking like, importing when an event triggers like a ui event? You mentioned polymer so I am imagining something like that
Sometimes, after debugging/writing JS code, I sit back and cry 😢😭😭😭😭
rant