- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
but then the CEO would complain that the same quote appears two times in a row. and that's not random!
Admin
Back in the day, when 2010's were just starting and browsers were... less than they are today, I too though that maybe a Flash frontend and a completely data-driven backend would not be a bad thing. At least it would be consistent across browsers and fronted would be separated from backend. As time went on, web standards and all kinds of new browser APIs outcompeted Flash. And today SPAs and data-only backends are the norm, Flash is dead, and the world is better for it.
But I still think that Flash might have had the potential to be an alternative to what we have today. Most innovations that came to browserland during the 2010's were already there in Flash. In a way, it was ahead of its time. And then... somewhere along the way it dropped the ball. I don't know what happened. Maybe it had an awkward API? Maybe Adobe got too greedy and started stifling developers? Maybe they grew complacent and stopped innovating? I don't know, I've never worked with it. :D The fact that browser features don't need additional installing is definitely a bonus, however back in the day Flash was ubiquitous anyway. You couldn't have a (functional) browser without Flash. So I don't think that was it, or at least not all of it.
Admin
The main problem with Flash was that it was insecure by misdesign and insecure by epic bug count. At the same time.
The other main problem was the small point that Steve Jobs refused to allow it as a browser add-on for iPhones.
Admin
"You couldn't have a (functional) browser without Flash."
My experience was exactly the contrary: Flash was mostly associated with exceedingly annoying adverts, so the easiest way to make the web useable (before decent ad-blockers) was to disable Flash or not install it.
Also, it was terrible for accessibility.
Admin
No wonder they changed to incrementing: 123456789 = 3 * 3 * 3607 * 3803. Say your "max" is 3. Then with seed 0, the first iteration yields 8%3 = 2. The second will be 2. The third will be 2. Incrementing clearly has advantages.
Admin
Damn, you don't even have to look at factorization. The modulo is the same as the multiplier. The result will always be mSeed.
Admin
" The fact that browser features don't need additional installing is definitely a bonus..."
Um, no. Nowadays you end up with random Javascript downloaded from 50 different sites instead, most of which you have no idea where they are or what the code does. Progress, this isn't progress.
Admin
Hence why one should be using large prime numbers. But anyone who writes their own random function probably doesn't know that.
Addendum 2023-04-24 08:04: Wait. I'm thinking of hash functions. A random generator should probably be using XORs and bit rotates.
Admin
As someone who has worked with Flash extensively I can honestly say that the hatred of it by some people and institutions is heavily misguided.
Yes, as a framework for actually making web pages it had some serious flaws. The primary being security issues and treating web pages like they are applications. But the hate it gets for those is unwarranted.
The first is something we can't blame it for because frankly the only secure system is one nobody uses. That's just the nature of software. It's like that old joke that says there are no viruses for Linux because not enough people use it to make writing viruses worth it. And whilst it is exaggerated there is some truth to that. And to their credit Adobe and Macromedia before them did their best to find and patch them.
The second is a philosophical discussion and not a flaw. Personally I think the web and desktop are two very different environments that can't really be handled the same way. But a lot of people disagree vehemently. Which is why we periodically see the idea of either writing web pages like applications or more recently the trend of using web technologies instead of desktop programs.
So whilst we might disagree with that idea a lot of people like it. And thus there has to be something to it. And that something is the idea of ease of retraining and reuse of knowledge for developers. Which is one of those things that sound too good to be true because they are. But that still means it "sounds" good.
Continued in part 2.
Admin
More importantly though all this is really not what Flash was about. What Flash was, and what made it great, is a tool that was easy to use, intuitive to learn and designed for a wide variety of people with different backgrounds.
At its peak Flash combined an easy to use vector graphic interface with a powerful and intuitive to use scripting language and a timeline tool which allow you to make animations visually without having to script. What this meant is that whether you were a programmer with little skill in drawing or an artist with no skill or inclination to program or anywhere in between you could pick Flash up and become proficient in it relatively quickly and without ever feeling lost or overwhelmed.
In that respect it was a true precursor to the modern out of the box ready to go game engines like Unity and Unreal. Indeed, having worked with all three of those I would say that Flash easily beats both in terms of the ease and accessibility of the onboarding process.
Which is precisely why it was so popular. Whether you wanted to make a web page or a video game Flash was just there. It was easy to learn, intuitive to master and it just worked.
And honestly I think modern software like Unity and Swagger have a lot to learn from that.
Admin
I guess they switched to incrementing after their first version always gave them the same answer: 8. Assuming you don't run into integer size issues (a*b+c) % a == c. Assuming the int type is 32-bit, then as long as seed < ~20, the seed will immediately become 8 and stick there.
Admin
I'm guessing you mean 2000s, not 2010s, since Flash was already on the way out by then. Late 1990s / early 2000s, yeah, the native abilities of HTML were pretty rubbish for doing anything more than simple forms, so things like Flash or Java Applets (or Silverlight, but MS were a bit late to that party) looked like an attractive choice... powerful UIs that could run in a browser with no custom software to install, just a common desktop plugin which everyone was assumed to have already.
By about 2005 though, HTML was starting to catch up in terms of native abilities... early versions of stuff like AJAX and Canvas starting to appear, along with early JS frameworks. Not as good as applets or Flash yet, but good enough to make them unnecessary for many use cases, and with the advantage that they integrated nicely into a browser UI, instead of being embedded content. And a few years later, native video support started becoming a thing, which took away one of the biggest advantages Flash had...
Admin
I remember when I wrote my own pRNG back in those days. Obviously it's was with the C64 and in assembler and I was 9yr old back then. And I used a seed table because that was the code I found in a book for some other 8 bit computer. Good times.
Admin
Er, what am I missing? This is not "just
Math.random()
, that at least gives a (pseudo) random number. This one just increments, modulo the max. So if the max is, say, 5, and your first "random" number is 3, this algorithm is guaranteed to give 4 the next time, then 0, then 1, and so on ad infinitum. Granted it's unlikely to matter for me kind of use the article is guessing at (but not for many applications where you want something random-seeming even where cryptographic randomness isn't needed), but if incrementing is all they need to do, just be honest about it - don't pretend this has anything random about it, or talk about "seeds"!Admin
Just wanted to add: it wasn't just Flash, the application, it was the FlashPlayer/AS3 platform. There was Flash Builder for FLEX applications (in XML) and you could use this to compile pure AS3 FlashPlayer applications (maybe importing the Application class from Flex/Flash). This way, you could have amazing lean applications of just a few KBs. You had to do your own UI elements for this, like buttons, menus, scrollbars, etc, but, implemented once, you could import this over and over.
(One of the – nowadays rarely mentioned – drawbacks of the "Flash Age" were applications which just stacked 3rd party libraries/elements, resulting in a few MB of download and the CPU running hot immediately. But there was no need for this.)
Admin
The biggest problem with Flash was that it was a proprietary technology. Single company decided how it works, what features it provides and on what platforms it would be available. And those decisions were not made with end user or even developers interest in mind.
In theory it was widely available, in practice not everywhere, not in full (full-time Linux users know that, people relying on accessibility features know this).
HTML and JavaScript are open standards, not bound to a single vendor, which is better for everybody (except wannabe-monopolists).
Admin
Hash functions come in three varieties:
strlen()
conforms to the requirements for a hash function, but no, you shouldn't ever use it like that.Admin
Just as a non-programming aside, a huge reason why Flash was so widely adopted back in the day was that it gave designers the kind of control over the appearance of web pages that they were used to having in print. It took a long time for designers to understand that web pages didn't have fixed dimensions, not all users had the same set of fonts available, and so on.
Admin
Yes.... and that's part of why it failed. Adobe, a company that makes it's money from designers, created a platform for those designers to distribute their creations. However, since it was primarily designers in control at the table when it came to to make decisions, the platform was riddled with security holes and, fatally, insisted those design decisions be forced on the mobile market, where the desire for touch interaction and battery life slapped them down hard.
Admin
So, I used to work for WildTangent, a 3D-on-the-web company, and a sort-of competitor to Flash. For "why was flash useful" -- it was the only way to make graphics go fast on the web. This is before Canvas and SVG, and there simply wasn't any way to "draw a line" on the screen and then have it move. WildTangent for sure made heavy use of the DirectX support in Windows to handle our graphics; that was the only way we could go fast enough to do 3D animations at all. I'd be surprised if Flash wasn't similar.
And for "why flash died", the iPhone (IMHO) was a big part of that. The iPhone came along right when browser features were getting more advanced, and Flash also sucked up battery life. As soon as there was a super-popular new platform that didn't support Flash, designers moved on.
Admin
Ability to control every pixel is part of what makes Flutter attractive. Flutter mimics native interfaces, but is not constrained by them. Add to that an efficient cross-platform solution for everything that has pixels on the screen, and you have a pretty decent solution. (People have already written actionscript-like packages for Flutter, just to come full circle.)
Admin
This reminds me of a discussion I had back in 1998 or so with a mad Hungarian. (I mention that because I normally defer to Hungarians in software -- they know what they're doing.)
"It's all very well presenting the UI via Visual Basic," says I, "because that works for our in-house PCs on a local network. But it isn't really Web-ready, is it?"
"Of course it is," said MH. "All you have to do is to compile it into an OCX, and there you go!"
That somewhat truncated my lunchtime at the usual Marriott-based firm canteen. I kinda had to go and throw up.
Admin
(One of the – nowadays rarely mentioned – drawbacks of the "Flash Age" were applications which just stacked 3rd party libraries/elements, resulting in a few MB of download and the CPU running hot immediately. But there was no need for this.)
An everyday occurrence, just now it it npm or nuget packages stacked without thought. Current application I am working has 4 different ORM all in the same process, as well as multiple IoC [I haven't finished counting] linked in...
Admin
You say proprietary as if it were a bad thing. Just look at the .NET family to see how fantastic things can be if run by a single company. The issue with flash is that Flash was mishandled by Adobe after they bought it from Macromedia. The original Macromedia Flash was great.
Admin
There was some noise about Apple disallowing flash, because they don't want alternatives to installing apps from their store. But at the same time Flash had already acquired a reputation for being a liability for security, stability and performance, which made press ultimately supportive of the decision, rather than focusing on the walled-garden aspect more strongly.
It didn't help that the update process wasn't transparently automated, but was used as a vector for advertising adobe products. Sure-fire way to get the "family tech guy" to tell people to use something else, if possible. In the same way, Oracle gave Java a bad name with end-users by bundling adware toolbars with updates.
Admin
The sad part is that they were close to implementing a linear congruential PRNG properly. They just forgot the part about the numbers in the algorithm having to be carefully chosen.
Well, OK, and the part about not just taking the seed modulo the max value to get a result.
If it hadn't been for those two things, they could have uselessly reimplemented a worse version of a built-in function quite well.
Admin
No, the result will always be 8 - or 8 % max if max < 9
We could get a random sequence by random generating max from the closed range [0, 7]
Addendum 2023-04-27 09:03: Obviously I meant
[1, 7]
and I'm assuming there's no requirement for uniform distribution.