programming languages questions
1. Why did we move from punch cards to programming languages? What does that tell you about the purpose of programming languages?
Answer: Punch cards were notoriously super clunky and easily damaged, extremely slow and had limited memory, and most important of all, they were hard to understand. That was mainly because interactive text editing (teletype) was not yet mainstream and far too costly in terms of both money and computing resources. That tells us that the purpose of programming languages is mainly to allow for a more human-friendly and human-understandable interface for coding, and as computer processing and memory became more accessible, programming languages like BASIC, APL, and C were developed for early interactive terminals.
2. There are hundreds of different programming languages out there. Why do you think we need so many?
Answer: The simple answer is that different languages were made for different purposes. The most basic two categories that most programming languages fall into are low-level languages (think C, C++, Assembly) and high-level languages (think Java, Python, JavaScript). However, even within these categories, languages differ in a lot of ways that define what people use them for. For example, both Python and JavaScript are so-called interpreted languages (as in, they do not need to be compiled before running), and they both feature automatic memory management. Python is very popular for data science and machine learning, but JavaScript would never be used for those purposes, as it's primarily a web-development language. Another common reason is community support and libraries. There are definitely other languages that can be used for data science, but Python remains by far the most common one mainly because of the libraries created by the community, like NumPy, Pandas, TensorFlow, etc.
3. What are some drawbacks of a programming language you use? How would you like it to be different? Think of specific examples.
Answer: I mainly use Python, I couldn't think of any specific drawbacks that I've personally encountered, but there is a common criticism that a safety feature called Global Interpreter Lock locks code execution down to only one CPU core, which can significantly slow down code that relies on multiple threads (e.g. encryption). There are workarounds, however, it would be much cleaner if the feature was optional, and the newest version of Python actually supports a GIL-free build.
4. If you were going to create a new programming language, how would you start? What do you need to define?
Answer: I would start by just typing out what I would want a few lines of code to look like, because what matters to me most is how readable and understandable it is. Then I would hash out some basic rules that would meet that syntax, and after that I would start defining some basic math functions, loops, conditionals. I would also do regular revisions to optimize my definitions and make sure the performance is good enough compared to other languages and the syntax is consistent and intuitive.
references:
- https://softwareengineering.stackexchange.com/questions/262723/why-were-punch-cards-used-for-programming
- https://levelup.gitconnected.com/why-are-there-so-many-programming-languages-653d4d02ab39
- https://www.reddit.com/r/ProgrammingLanguages/comments/160m27p/eli5_why_does_there_need_to_be_so_many_computer/
- https://spectrum.ieee.org/from-punch-cards-to-python
- https://www.quora.com/How-does-one-create-a-programming-language