patternMinor
Better word to describe JavaScript "algorithm"?
Viewed 0 times
javascriptbetteralgorithmworddescribe
Problem
For my undergraduate senior project, a professor asked me and my partner to design an algorithm to determine true resolution in the browser, unaffected by zooming, multiple screens, viewport size, etc. (tl;dr our implementation was okay, it usually did the job correctly.)
It's super pedantic, but I've been thinking about the terminology of calling it an "algorithm". It really doesn't seem like an algorithm, because it's very dependent on JavaScript and the state of the browser at a given time. Particularly, our script has a lot of if-statements to determine what what variables and data to work with depending on the browser and configuration. I certainly don't think I could write it out in a language-agnostic pseudocode.
Is there a better word to describe what we wrote? Does it count as an "algorithm" per say? If I had to think of alternate words, they'd be:
Are there better words that are more general than simply script or program?
It's super pedantic, but I've been thinking about the terminology of calling it an "algorithm". It really doesn't seem like an algorithm, because it's very dependent on JavaScript and the state of the browser at a given time. Particularly, our script has a lot of if-statements to determine what what variables and data to work with depending on the browser and configuration. I certainly don't think I could write it out in a language-agnostic pseudocode.
Is there a better word to describe what we wrote? Does it count as an "algorithm" per say? If I had to think of alternate words, they'd be:
- implementation (but of what, just our general idea/design?)
- script/program
Are there better words that are more general than simply script or program?
Solution
You can certainly describe the inner workings of your project as an algorithm. It takes an input (whatever information it obtains from the browser) and produces an output, as a result of some scheme of calculations. Perhaps it needs to read inputs during the course of its calculations (depending on the first inputs, it might make different queries of the browser), so it might be some sort of interactive or adaptive algorithm.
Context
StackExchange Computer Science Q#69321, answer score: 6
Revisions (0)
No revisions yet.