Bouncing Ball Programming Examples
Bouncing Ball Scratch JavaScript Python Java C++ Assembler C# Visual Basic Jane

This is the JavaScript Bounding Ball program

Bouncing Ball Written in Nine Different Languages
I was going to mentor high school students, this was going to be my first day's lecture... but the virus happened...
(also I did not like Microsoft's teaching approach)

  1. Scratch       -- drag and drop programming (https:/
  2. JavaScript  -- html programming
  3. Python        -- script programming
  4. Java            -- general programming
  5. C++             -- system development
  6. Assembler  -- general programming
  7. C#               -- general programming
  8. Basic          -- general Programming
  9. Jane            -- new (being worked on)

Download ZIP project source code files

I could easily 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.

  1. For a 100 line application it showed the inconsistency in our software development technology
  2. Automated translation of an application from one language to another is not realistically possible (with brute force anything is possible)
  3. All programming languages are the same
  4. Scratch does not work in IE, it should (I had to write my own emulator)
  5. Access to system parameters greatly changes the design
  6. Speed of execution changes the design
  7. Variable Scope conventions of the compiler changes the design
  8. Orientation of the screen changes naming conventions and logic
  9. No real benefit shown by any of the compiler's conventions
  10. Time to implement was the same for all compilers
  11. Readability of code was the same
  12. Documentation reading was required and about the same for all development
  13. Trivial capabilities were never consistent across languages
  14. The drag and drop programming did not make it easier
  15. I found python the most irritating to program, forcing me to do things the compiler could have done (order dependencies, scope,...)
  16. Every system had good and bad things that were arbitrary, I attributed this to the talent of the compiler's developer
  17. Teaching any of these languages is the act of knowledge transfer of language conventions not logic or design
  18. None of the languages were simple, meaning I needed to know far too much
  19. All these systems were written by/for developers, not for applicationist
  20. Coding style is very much language specific
  21. Python seemed to be the least readable
  22. Variable names were not always precise, they were adjectives of a value, not the value itself (in one design correct, in another not correct)
  23. The compiler's global scope conventions change the design and readability
  24. The early choice of a variable name is often wrong (I used "x_bounce, y_bounce", maybe should have been "x_direction, y_direction")
  25. Java had a messy form size and an odd graphic coordinate system, a lot of overhead
  26. Documentation on Python seemed version dependent, had to try a few different methods to determine if the window had closed
  27. Scratch was prone to a messy work area (difficult to manage), organization of blocks difficult to navigate, fixed operators required work to swap out, all variables should be in one place
  28. 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
  29. 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
  30. In Assembler I had more trouble with keyword collisions, poor error messages
  31. 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
  32. Comments -- the compilers seemed to go out of their way to use something different...
  33. implementation was based on experience and on documented online examples
  34. 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
  Copyright 2019 Collins Software