FREE! Click here to Join FunTrivia. Thousands of games, quizzes, and lots more!
These Programming Languages Say Hello To You Quiz
A very long time ago I started my career as a programmer. So I've always been intrigued by the various languages that have come over the years. Now many of them want to say HELLO to you! Match the command to the language.
A matching quiz
by stephgm67.
Estimated time: 3 mins.
Last 3 plays: BarbaraMcI (7/10), xchasbox (2/10), Zippy826 (10/10).
(a) Drag-and-drop from the right to the left, or (b) click on a right
side answer box and then on a left side box to move it.
Match the computer command to the respective programming language which would utilize it. Note that in my Information I have used backticks (`) around the commands to make it easier to parse out.
BASIC stands for Beginner's All-purpose Symbolic Instruction Code. It was designed by John G. Kemeny and Thomas E. Kurtz at Dartmouth College and released in 1964. It was created to allow students in non-science fields (like me) to use computers without having to write complex custom code or understand the underlying hardware.
The command written as `PRINT "Hello"` is instantly recognizable as BASIC because of its straightforward, English-like syntax. It allows for a single, simple command to execute an action. The use of capital letters for keywords was a hallmark of the era when BASIC rose to prominence on home computers like the Commodore 64 and Apple II. Or, in my case, the Radio Shack TRS-80!
2. DSPLY 'Hello'
Answer: RPG
RPG stands for Report Program Generator. It was originally developed by IBM in 1959. It was designed as a business oriented tool to replicate the logic of punch-card tabulating machines, eventually evolving into the primary language for IBM's midrange systems like the AS/400. (Which, in my humble opinion, is the greatest computer ever made and for all the good it does me, I can still code in RPG.)
Like many languages from the era of limited memory and punch cards, RPG keywords were often abbreviated to fit fixed-column formats. Shortening "Display" to `DSPLY` is a classic hallmark of IBM's midrange naming conventions. RPG (and many other mainframe-era languages) also uses the single quote as the standard delimiter for literals. Also, `DSPLY` would have to be placed by programmers in a specific column (the "Calculation" or C-spec column) to work.
3. System.out.println("Hello")
Answer: Java
Java was released by Sun Microsystems in 1995, developed by a team led by James Gosling. It was designed with a philosophy of WORA which means "Write Once, Run Anywhere". This means that Java code could run on all platforms that support it without the need for recompilation (and no programmer likes recompiling).
`System.out.println("Hello")` is distinctly Java for several reasons. Java requires almost everything to be an object or a member of a class and in this class "System" is the class while "out" is the object. Also, Java is pretty wordy compared to other languages. And, in Java, classes conventionally start with that uppercase letter.
4. std::cout << "Hello"
Answer: C++
C++ was developed by Bjarne Stroustrup at Bell Labs and first released in 1985. It was designed as an extension of the C programming language, adding object-oriented features (think of a LEGO set with created assemblies instead of all loose bricks) while maintaining the high performance required for systems programming. While many languages (like the ones I did) handle things behind the scenes, the C++ syntax has the coder interacting directly with standard I/O streams.
The command has several things which tie it to C++. First, is the 'less than' symbols you see. This is the insertion operator that visually represents the data (the string "Hello") being pushed into the output stream (cout). Next, is the `std::` portion. This indicates that cout (character output) belongs to the standard library namespace. This is a defining feature of C++ that prevents naming conflicts, signaling to the programmer that the code is utilizing the language's built-in capabilities.
5. Console.WriteLine("Hello")
Answer: C#
C# was developed by Microsoft as part of its cross-platform initiative and released in 2000. Led by Anders Hejlsberg, the language was designed to be a modern, general-purpose, and type-safe language that combined the power of C++ with the ease of use found in Visual Basic.
The use of `WriteLine` is a signature C# method. It tells the program not just to print the text, but to automatically move the cursor to a new line afterward. This is the type of convenience that is a staple of C# programming. (And reminds those of us pre-PC people of actually using a typewriter). C# also follows PascalCase for its method names (where words start with a capital letter, like `WriteLine`).
6. echo "Hello"
Answer: PHP
PHP stands for Hypertext Preprocessor. It's a recursive acronym, meaning the first P refers back to the name PHP itself. It was created by Rasmus Lerdorf in 1994. He originally designed it to track visits to his online resume and created it as a simple set of Common Gateway Interface (CGI) binaries written in C. It later evolved into a scripting language that would eventually power a large portion of the web.
While most languages use commands like `print` or `display`, PHP favors `echo`. It is technically a language construct rather than a function (hence no parentheses), which reflects PHP's origins as a tool for quickly getting data out to an HTML page. It would normally have a `?php ... ?` wrap to signify it being PHP. I did not include that in the command because the first time I typed it in, the browser misinterpreted it as actual code, and I ended up redoing the whole quiz. Lesson learned.
7. puts "Hello"
Answer: Ruby
Ruby was created by Matz Matsumoto in 1995. It was designed with a focus on "developer happiness", aiming to feel natural and intuitive. Ruby blends functional programming with imperative programming to create a language that reads almost like spoken English.
The command stating `puts` stands for "put string." While other languages use `print` or `echo`, Ruby's use of `puts` is a distinct signature. It is preferred because it automatically adds a new line at the end of the message, making the output cleaner. Ruby avoids parentheses and semicolons whenever possible. Again, focusing on simplicity in the language.
8. WRITE(*,*) 'Hello'
Answer: Fortran
Fortran stands for FORmula TRANslation. It was developed by John Backus and his team at IBM and released in 1957. It holds the distinction of being the first high-level programming language ever created, designed specifically for scientific and engineering calculations where math is the priority.
The parentheses `(*,*)` are a dead giveaway to make this known as Fortran. The first asterisk tells the program to send the output to the default unit (usually the screen), and the second asterisk tells it to use "list-directed" formatting so basically print out the word in a way that makes sense. In the 1950s computers "wrote" data to tapes or cards, and that terminology has stuck with the language. Anyone who has carried a stack of punch cards and hoped they all arrived together in one place is rather glad writing has a different context now.
9. WriteLn('Hello')
Answer: Pascal
Pascal was created by Niklaus Wirth and published in 1970. Named after the French mathematician Blaise Pascal, who invented the mechanical calculator and would be amazed at a computer, it was designed specifically to teach students structured programming and data structuring, emphasizing clean, readable code and logic.
The procedure `WriteLn` is short for "Write Line" and is iconic to Pascal. Because the language is case-insensitive, programmers often used capitalization to make the code more readable, a habit that stuck and became a naming convention in many later languages. This would also normally be sandwiched between a begin and end statement.
10. console.log("Hello")
Answer: JavaScript
JavaScript was created by Brendan Eich in 1995 while he was at Netscape. Famously, it was developed in just ten days to provide a lightweight scripting language for the Netscape Navigator browser, and it has since become the backbone of the entire modern web.
While other languages `print` or `write`, JavaScript "logs". This terminology reflects the language's role in monitoring events and debugging live websites rather than just producing static document output. Unlike BASIC or Ruby or others, which output directly to the user's screen, JavaScript's `console.log` sends data to the hidden web console which allows developers to track what is happening with the page. If you are on a computer right now, try this: right-click anywhere on the page and select "Inspect", then click the "Console" tab at the top. You'll see the "secret" messages this webpage is sending.
This quiz was reviewed by FunTrivia editor rossian before going online.
Any errors found in FunTrivia content are routinely corrected through our feedback system.