1

Fuck JS. I want to import file and it just gives errors. In PHP for few years it never happens. You check if namespace is correct it always imports without problems. Fuck you JS creators. It asks to install a library, but I am not fucking importing a library. I am just importing my own created simple file. Fuck you.

import addCommas from 'formatter';

formatter.js

export default function addCommas(number)
{
console.log('aaa');
return number;
}

idiotism.

Comments
  • 8
    You dumb fuck if you want to import a file, use a relative path, if the specifier does not start with a dot, it’s a module to import.

    Learn the language before you hate on it.
  • 0
    @petergriffin I dont have time to learn every small shit of the language. And I learn by doing. And also I was leaning and I had made imports working earlier but this time it did not work. Why the fuck there is difference module vs file? In PHP I do not care, I just import a file and it does not matter if it is third party module or my own file. Why there is no standard so you learn one language - you can do same thing same way in another language? Like you learn to drive one car, you can drive another fucking car without reading big documentation.
    Or at least error message you tell same thing what you wrote. How can you assume that I want a module. When I am not telling path to file in module, I am expecting naturally to load file in same folder.
    Thanks at least for quick reply - this works.
  • 3
    @Angry-dev Not every language is the same. Languages shouldn’t be the same, otherwise we’d all write everything in C.

    There are automatic, stick shift and autopilot cars. You can all drive them basically the same, but each of them is a little bit different. We just have more diversity than the car industry.

    This is defined in the language specification, why it is that way? That’s just how JS evolved and fit the best with existing solutions. E.g. How would you differentiate between a relative import within a module and one relative to the active file? Also, different prefixes are also bad because there did exist other alternatives which would use them and possibly break compatibility.

    If you don’t have the time to actually learn it, just head over to JavaScript.info for an easy cheat sheet and best practices.
  • 6
    @Angry-dev Don't want to learn? Don't Complain.
  • 0
    "That’s just how JS evolved and fit the best with existing solutions. E.g. How would you differentiate between a relative import within a module and one relative to the active file?"

    PHP does very simply for example:

    use Symfony\Component\HttpFoundation\Request;

    so the Request is in a module. We write path to module file in vendor directory.

    So could write in js path to file in node_modules directory.
  • 0
    Of course I do not want C syntax, that would make even less productivity.

    Btw about learning- there are tons of people who do not have time to learn. The more learning is required to do something, the more expensive to do that something gets because business does not have already many programmers to choose from, so the programming costs are huge. Its bad for business and for product users because if it costs for business to build product a lot, they will charge a customer a lot.
  • 1
    @theabbie ok lets say I want to learn. Maybe I have seen examples how to include file in same folder. But it did not stick to my head. I did not notice that small thing. Or the tutorial should be telling exceptionally about this. So I would still be angry because I know I have read or watched tutorial but it does not work for me and I do not find quickly how to fix. That slows down learning also. Plus when learning I do not even know if I learned well. I only know that I do not know something when starting working and getting this errror. Becasue I really studied importing files recently. Just was not in such situation or done right when learning but just did not notice that small thing, it worked, and I did not know what more to learn.
  • 1
    @theabbie plus I try hard not complain in other programmers chat and stack overflow but I feel so much anger that I want to say. And thats why I am on this site, so that I could say what I really want, what is in my head. It was really annoying when I cannot do that on stackoverflow or in other chats because on stack overflow they start voting down and in chats they might not be helping then
  • 2
    @Angry-dev JS is not a toy language, you need to learn it as much as any other language. For example, You can't just watch one tutorial and write a Java program. You're too frustrated, so, take a break.
  • 0
    Another reason is - business want you to be productive. If business would give me time as much as I need to find a problem, then I could calm down, thinking I am getting hourly so no problem, if its difficult to find, they will pay. But the thing is - they can pay but they can fire me if I constantly spend lot of time for such simple things which can be done in few minutes.
  • 1
    @theabbie now I am feeling not angry, many hours passed, I have slept well. Yea, js is not a toy. Actually I am programming with JS since like 2010 , but like 4 years I am more focuisng on backend. Still when I want to do such simple things, I would like to know enought over this much experience, plus as others say - you learn one language, you can code in any other language.
  • 2
    @Angry-dev You can code in any language if you don't hate it already. Take some time to understand front-end.
  • 0
    Can you give me good tutorial how to make angularjs controller unit testing with karma ? I have spent lot of hours but cannot make it work. Various tutorials tried. Tried from angularjs docs I think but there was controller and app in same file. When controller is outside, I cannot find how to do. How can it be so hidden? I get error after error. I have to ask new quesiton after every error in stack overflow? THats not how it should be done I think. THere should be tutorial which makes it work from start to end.
Add Comment