Programming Languages

    For this week’s assignment, the class was asked to use Scratch to develop a program with at least 30 blocks.  The experience of developing with Scratch will be described as well as any difficulties and remedies applied to overcome them. The request is to compare this experience with the experience of working through textbook exercises in machine, assembly, and high-level programming languages. The differences between the languages will be described, along with when each type of language is most effective. Finally, the author’s personal opinion on which language is most popular and why is requested. The project for this paper can be found at SuperCat on Scratch (mit.edu).



    This was the author’s first exposure to using the Scratch platform. The tool had some unexpected surprises. Replaying the project did not reset the state to the initial defaults, so all objects were assigned positions as the default start action. Initially, the starting cat character was manipulated on screen to test the behavior of the programming blocks. A sun and ball object was added to the project screen, and a background was selected. The goal was to bounce the ball and have the sun move while the ball was bouncing. Then, shoot the ball at the sun, causing the ball to pop. It was observed that objects could dispatch messages, which was used to handle the behavior of shooting the ball and later animating the cat to fly off into the sun.



    The project is an interesting exercise in procedural programming. Having a message subscription service was an unexpected feature. It allowed for coordinating the behaviors of the character and objects in the story. The author was surprised that more objects were not available as the tool is aimed at kids learning to develop. Two sounds and 4 objects were available in the first project created. This proved sufficient for exercising the programming environment.

    Programming languages are categorized into three primary categories.

·       Machine language – the processing language the computer can execute expressed in binary digits.

·       Assembly language – the symbolic connection between a particular type of operating system and a particular type of hardware.

·       High-level languages – an abstraction of programming that allows the programmer to develop software without considering the mechanical interactions. A compiler translates the code into assembly language, parsed to the computer as machine language.

    The machine language was the hardest to use during the exercises as the programmer had to remember the codes and locations and what parameters matched each code. Assembly language was one step easier as the name instead of digits identified operations, but the developer still specified the locations used. The Python language removed the need for the developer to understand the memory locations used and the operation identifiers. Instead, it abstracted these into reserved words used to compile code making these assignments. This frees the developer from the risks of direct manipulation of the memory addresses and avoids common programming errors.

    Machine language is used by developers working with the actual hardware-software interfaces. Assembly language is used to build the operating system-specific connections to the machine. Assembly language may be quicker and more efficient in coding the system, as compilers will not necessarily generate the highest optimizations in code. However, this method of development is more prone to errors. High-level languages are used as they allow development against multiple platforms and can be tuned for specific needs. Languages like C/C++ are highly optimized for system-type operations. Languages such as C# and Java provide more restrictions to the developer but are safer and often do not face the same performance demands. For example, a computer detecting an incoming missile must be as fast as possible. A computer waiting for an order at McDonald’s must only be as fast as a human.

    The most popular programming language is a matter of perspective. Based on PYPL (Most popular programming languages in 2023) rankings for September 2023, Python is the most popular programming language, whereas the Stack Overflow Developer Survey for 2023 (Stack et al., 2023) shows JavaScript. Knowing multiple languages allows developers to use the right tool for the right problem. Writing websites often use HTML, JavaScript, SQL, and another language, such as Java or C#, to write the backend service code. Microservice, point of sale systems, reporting, and extraction tools are written with SQL and a language such as Java or C#. Python has become a very strong contender, especially for its uses in machine learning technologies.

    This week’s assignment has done an excellent job of explaining the basics of how computers operate and the ways that developers have evolved in developing programs. At each level of abstraction, the level of explicit control over the hardware is constrained by the tool’s attempt to prevent common errors. Nevertheless, the overall productivity of the developer has increased. As computer processing and parallelization decrease the time to process operations, developer efficiency becomes the most significant bottleneck. By allowing developers to code in a more friendly language, the tradeoff of using compiled code vs manually optimized code is sufficient to meet the task's demands.

References

Most popular programming languages in 2023 [Ranking]. (2023, -09-13T08:27:48+02:00). Retrieved Oct 21, 2023, from https://www.stackscale.com/blog/most-popular-programming-languages/

Stack Overflow. Retrieved Oct 21, 2023, from https://survey.stackoverflow.co/2023/?utm_source=social-share&utm_medium=social&utm_campaign=dev-survey-2023

Comments