23
Bitwise
36d

This is one of many reasons I hate javascript. I used let instead of var in an entire script. Just found out after it has been in production a week does not work on iPhone 6 wtf? I hate you javascript!!! I have no control what browsers customers use! you suck! be consistent!

Comments
  • 7
    Yes, this is clearly JavaScript's fault.
  • 3
    Safari is the one browser that interprets your javascript differently than any other browser, and it's js's fault. what?
  • 1
    Having to look up all the differences between browser versions is tedious.

    It sucks and it makes working with JS hell.

    So yes I can hate javascript even if it is the browser makers that make it hell to work with.
  • 3
    That's why I use transpilers / modernizer libraries. Always write most modern code, and it will work everywhere.

    It's also why I jumped ship on frontend development though :D
  • 4
    @Bitwise just smash in manually included polyfills, use babel or use https://polyfill.io/v2/docs/ - so far I couldn't see any issues with using their service, it's damn fast too
  • 3
    @JoshBent

    Yeah, I guess eventually I'll need to add something like Babel to this outdated framework.
  • 2
    Polyfill?
  • 2
    @lotd

    pollyfills are code that addresses the inconsistencies of JS amoung browsers. It adds the necessary Prototypes to be able to use modern JS in any environment.
  • 2
    @Bitwise i know.
    Mentioning it, as it's probably easier to just include one, than refactoring it.
  • 2
    @lotd

    Oh, the question mark threw me off. It has been mentioned in comments before yours so I just figured you were asking sorry.
  • 2
    @Bitwise i didnt even bother to read through the comments tbh .. :)
  • 0
    What are you doing anyway? What iOS version does this not work on? What paradigm? Are you using titanium? Cordova? No context to this rant. And js only ancillary to it.
  • 0
    @jeeper

    I am working in Magento 1.x the js fails only on Safari on iOS 6 or less because Safari doesn't parse the let statement. At least on browserstack it doesn't. I switched then to var works fine.
  • 3
    @Bitwise Magento? :D JavaScript is the least of your problems ;P
  • 1
    Did you take a look at Babel? It transpires your JavaScript so that it can be understood by older browsers.

    EDIT: sorry, didn't see others mentioned it already.
  • 0
    I'm not a big fan JavaScript, but comparability is a problem across all programming platforms. Some companies still use old versions of Java, others old versions of python and some use windows

    I think the issue with JavaScript people have is it's not very transparent. As has been pointed out, you need domain knowledge.

    So yeah in the case of JavaScript just use babel to transpile down to a reasonable lowest common denominator
  • 1
    @seriously

    At least with other languages you are in control and can code specifically for that language/version, it isn't going to be a guess as to what it is going to be, with JS it is the user in control (by selecting which browser/version they use) so there is no control over this.
  • 1
    The only reason I haven't added a polyfill service or babel is due to them not being part of the original framework and I'e been busy with everything else.

    First, I hate using cdn's or having to pull my data externally. Too many times I have been screwed with a slow or non functioning site because the other server was down due to ddos or something.

    These are ecommerce sites for multimillion/multinational company, I have to ensure 100% uptime with no slowness. (even though we have no testing program, I am the tester too and only developer for 30+ websites in 16+ languages in both EU, Asia, and US regions.

    So this week I will probably integrate some sort of pollyfill and add to codebase, because in reality it is either do this, or go through 30+ codebases and change let to var. Might as well add the polyfills now.
  • 2
    @Bitwise for the let/var thing you'll need a transpiler, not a polyfill.

    I don't know anything about magento, but I can help you setup Babel if you'd like.
  • 1
    @shellbug

    Ah good to know. yeah, I don't know much of about transpilers or what it is going to take. I will contact you this weekend after I look into it some and see if it is even worth the hassle.
  • 1
    @Bitwise bruhhhh why are you worried about iOS 6? Only 7 percent of devices are currently below iOS 8. I couldn’t find a break down of older iOS right off. Probably because it’s so incredibly small. It’s not supported by Apple or anything. Basically the same as crying that your new game won’t run on Windows XP 😂
  • 3
    @jeeper

    true, customer service hasn't had any complaints. So you are probably right. I just want to make sure I have the highest code coverage because because in ecommerce missing one sale is like the end of the world to them. I'd here about it.
Your Job Suck?
Get a Better Job
Add Comment