This is the JavaScript Bounding Ball program |
Bouncing Ball Written in Nine Different Languages
I was going to mentor high school students... but the virus happened...
- Scratch -- drag and drop programming (https:/scratch.mit.edu)
- JavaScript -- html programming
- Python -- script
programming
- Java --
general programming
- C++
-- system development
- Assembler -- general programming
- C#
-- general programming
- Basic --
general Programming
- Jane
-- new (being worked on)
Download ZIP project source code files
I could add forty more different language examples, all doing the
same thing, yet with no common foundation for the most basic of programming
conventions. What I found was that there was no difference in the time or the
amount of knowledge required to write any of these examples. If
you tried, I don't think you could make it more, what is the word; nasty.
Video on downloading, compiling and running these examples
|
Things I have learned
The design of an application is greatly affected by the compiler. I use the
term "compiler" to mean the thing that interrupts our programming action
requests. Our application development process is a Wine Glass Technology
- For a 100 line application it showed the inconsistency in our software
development technology
- Each "compiler" is not just a "compiler" it is also a
design paradigm. You are not free to design software, you are force to
use another person's logic
- Automated translation of an application from one language to another is not
realistically
possible (with brute force anything is possible)
- All programming languages are the same
- Scratch does not work in IE, it should (I had to write my own emulator)
- Access to system parameters greatly changes the design
- Speed of execution changes the design
- Variable Scope conventions of the compiler changes the design
- Orientation of the screen changes naming conventions and logic
- No real benefit shown by any of the compiler's conventions
- Time to implement was the same for all compilers
- Readability of code was the same
- Documentation reading was required and about the same for all
development
- Trivial capabilities were never consistent across languages
- The drag and drop programming did not make it easier
- I found python the most irritating to program, forcing me to do things the compiler could have done (1 Pass -- order dependencies, scope,...)
- Every system had good and bad things that were arbitrary, I attributed
this to the talent of the compiler's developer
- Teaching any of these languages is the act of knowledge transfer of
language conventions not logic or design
- None of the languages were simple, meaning I needed to know far too much
- All these systems were written by/for developers, not for application-ist
- Coding style is very much language specific
- Python seemed to be the least readable
- Assembler used the keyword "invoke", why not just use
"CALL", something else for me to remember.... developers have to pee on
every tree
- Variable names were not always precise, they were adjectives of a value,
not the value itself (in one design correct, in another not correct)
- The compiler's global scope conventions change the design and
readability
- The early choice of a variable name is often wrong (I used "x_bounce,
y_bounce", maybe should have been "x_direction, y_direction")
- Java had a messy form size and an odd graphic coordinate system, a lot
of overhead
- Documentation on Python seemed version dependent, had to try a few
different methods to determine if the window had closed
- Scratch was prone to a messy work area (difficult to manage), organization of blocks difficult to navigate
- Scratch project files (*.sb3) are ZIP files (rename to .zip) then unzip,
containing SVG images and a "project.json" file of blocks, comments, images, sounds and costumes
- Writing the Scratch Emulator was simple enough, a few hours, I only
handled the block types, about 12 of them, that I used in my bouncing ball example
- In Assembler I had more trouble with keyword collisions, poor error messages
- Debugging was hit or miss, C++ (visual studio) and JavaScript (browser)
debuggers best for teaching, I did not try all the support environments for the other languages
- Comments -- the compilers seemed to go out of their way to use something different...
- implementation was based on experience and on documented online examples
- we have no technology, we have a house of cards,
everything will fail.
- Program size difference (bytes), Java: 3,225 Python
1,976 Scratch 131,072 C++ 3,740
Assembler 5,318 C# 2,220 JavaScript 2,134
Jane
175