16
Prakash
5y

Sometimes, after debugging/writing JS code, I sit back and cry 😢😭😭😭😭

Comments
  • 1
    there there, don't worry, we all do that from time to time
  • 2
    Usually I just laugh and go home. Already cried the entire debugging process.
  • 2
    Not properly knowing JS must really suck :(
  • 1
    @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"
  • 1
    @AleCx04

    It does, indeed. But I find solace in the fact that knowing doesn't helps much either.
  • 1
    @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.
  • 0
    @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.
  • 0
    @AleCx04 Also, if you know some way of solving the issue mentioned above, please let me know.
  • 0
    @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?
  • 0
  • 0
    @AleCx04 ah shit I forgot how to bot
  • 0
    @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
  • 0
    @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
  • 0
    @Prakash whats wrong with using Promise.all and after that import the fourth?
  • 0
    @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.
  • 0
    @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.
  • 0
    @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
  • 1
    @AleCx04 yep, something like that. Can't disclose details because of company policy.
Add Comment