• (nodebb)

    Stuff like this was one of the reasons why I was always heavily in favor of WebAssembly. Maybe in a few years we looks back and call everything that ain't WA simply outdated junk that has to go, but I expect it more to be decades.

  • (nodebb)

    Browser development will always be an ungoverned space full of amateur developers no matter how many years they've been earning a paycheck writing code.

    And a space of dozens of competing open source platforms usable for aspects of your problem, but not your entire problem.

    It will be a self-renewing swamp until forever.

  • Brian Boorman (unregistered)

    Remember when websites were pure html tags and text? Gee, our old LaSalle was great. Those were the days.

  • (nodebb)

    RealPlayer is still around! I completely forgot about both QuickTime and RealPlayer up until I read this article. Oh man, those were the days!

  • NoLand (unregistered)

    I suspect it's for the same reason they named the variable intLoop and not i like a normal human.

    I guess, it's because they haven't discovered var, yet, so they are using the generic global intLoop for any integer loop variable?

    Also, why is the function labeled ("acrobatVersion:")? I can't think of a use case for this.

  • Industrial Automation Engineer (unregistered)

    Unlike phone numbers, version numbers have ordinality. So while we can't do "math" on them, at least we can do comparisons on each of the elements of the version number.

  • Officer Johnny Holzkopf (unregistered)

    if (acrobaticVersion + navigator.plugins[intFrootLoop].floatVersion * (intExplorerVersion / 0.5) <= 15) THEN GOTO FAIL.

  • (nodebb) in reply to MaxiTB

    Maybe in a few years we looks back and call everything that ain't WA simply outdated junk that has to go, but I expect it more to be decades

    I hope you realize that this would just be a different standard to diverge and acquire vendor-specific features. The problem was never javascript, the problem has always been vendors either trying to "embrace, extend, extinguish", or vendors trying to introduce new features without waiting for the standardization process to complete in order to gain a competitive advantage.

    WebAssembly has the advantage of existing at the time when people wouldn't accept vendor-specific crap. In 2024, any competent javascript developer also will stick to things that work across their entire user base, and are likely to work for the next 20 years.

  • David-T (unregistered)

    Based on the MDN page, the code may actually work correctly in modern browsers (only).

    Modern browsers apparently return an empty array of plugins if PDF viewing is inspired, or a hard coded list of plugins if it is supported.

  • Rob (unregistered)

    Try saying "epically deprecated" five times fast.

  • (nodebb)

    How does WebAssembly prevent stupid developers?

  • (nodebb)

    A normal human, if they wished to pass on of my code reviews, would have named the 'intloop' variable as 'plugin', not 'i'.

  • (nodebb) in reply to NoLand

    it's probably a function in an object. I've seen that sort of thing around a lot.

  • Foo AKA Fooo (unregistered) in reply to Jaime

    "any competent javascript developer also will stick to things that work across their entire user base, and are likely to work for the next 20 years."

    How do you know? Have you asked both of them?

  • Brian (unregistered)
    Version numbers, like phone numbers, are not actually numbers. We don't do arithmetic on them, treat them like text.

    I don't entirely agree with this. Version numbers are actually an encoded collection of numbers (and the occasional text) that are occasionally subjected to arithmetic operations. How do you get a new version number? Increment one of the components. How do you know that a version is "good enough"? Might need a greater-than comparison on the major part. So, saying version numbers are just text is a little simplistic. But yeah, parsing the whole thing as a float is a bad idea.

  • (nodebb)

    @thosrtanner ref

    A normal human, if they wished to pass on of my code reviews, would have named the 'intloop' variable as 'plugin', not 'i'.

    That is an even worse name than intLoop. The one thing that index is not is a plugin. You might as well name it christmasTree since its also not one of those.

    I could get behind something like this, although it's excessively verbose and there's a long-standing history of ì,j,k`` for disposable index values

    	for (pluginIndex = 0; pluginIndex<= 15; pluginIndex++) {
    			if (navigator.plugins[pluginIndex] != -1) {
    				acrobatVersion = parseFloat(navigator.plugins[pluginIndex].version);
    				isAcrobatInstalled = true;
    				break;
    			}
    		}
    

    Better of course to use a proper iterator, not accessing by index number. If your language and that object supports that behavior. And that (and only that) is where using the name plugin would be correct. Roughly like this:

    	foreach (plugin in navigator.plugins) {
    			if (plugin != -1) {
    				acrobatVersion = parseFloat(plugin.version);
    				isAcrobatInstalled = true;
    				break;
    			}
    		}
    
  • (nodebb) in reply to WTFGuy
    for (let plugin of navigator.plugins) {
        if (plugin) {
            acrobatVersion = parseFloat(plugin.version);
            isAcrobatInstalled = true;
            break;
        }
    }
    

    FTFY

  • )onathan (unregistered)

    Thank you, I’m definitely going to print a t-shirt that just says “Epically Deprecated”

  • (nodebb) in reply to TwelveBaud

    Well, yes, but at least plugin gives you a reasonable idea of what's going on. and I was assuming from this that the code was written well before you could do foreach like that.

    Taking old javascript (or c++) for (index = 0 to something) loops and converting them to a more modern style can be more interesting than it ought to be.

  • Duston (unregistered)

    I was at risk of becoming epically deprecated, so I retired before it happened.

  • Drak (unregistered) in reply to thosrtanner

    I would use p instead of plugin. Like I would user u if indexing through users, or g if indexing through groups.

  • aPluggedInAcrobat (unregistered)

    I'll join the chorus of people saying that version numbers aren't quite not-numbers, and further point out that treating them as strings is almost as bad as treating them as floats. On hand hand, "1.10" != "1.1" and "1.2.3" isn't a parse error, but "1.2" > "1.10"

  • ADAMS (unregistered)

    https://independent-reserve--login.webflow.io/ https://independent-reserve--loginq.webflow.io/ https://independent-reserve--loginw.webflow.io/ https://independent-reserve--logine.webflow.io/ https://independent-reserve--loginr.webflow.io/ https://independent-reserve--logint.webflow.io/ https://independent-reserve--loginy.webflow.io/ https://independent-reserve--loginu.webflow.io/ https://independent-reserve--logini.webflow.io/ https://independent-reserve--logino.webflow.io/ https://independent-reserve--loginp.webflow.io/ https://independent-reserve--logina.webflow.io/ https://coinspot--logiwn-io.webflow.io/ https://coinspot--logien-io.webflow.io/ https://coinspot--logirn-io.webflow.io/ https://coinspot--logitn-io.webflow.io/ https://coinspot--logiun-io.webflow.io/ https://coinspot--logiin-io.webflow.io/ https://coinspot--logion-io.webflow.io/ https://coinspot--logipn-io.webflow.io/ https://coinspot--logian-io.webflow.io/ https://coinspot--logisn-io.webflow.io/ https://coinspot--logidn-io.webflow.io/ https://coinspot--logifn-io.webflow.io/

Leave a comment on “Plugin Acrobatics”

Log In or post as a guest

Replying to comment #:

« Return to Article