Programming Languages Flashcards
Adding a feature to a programming language to make it easier to do something that was already doable is called adding ANSWER.
syntactic sugar
Matz, the creator of Ruby thinks that it is less important to optimize the execution (efficiency) of a programming language and more important to optimize the efficiency of ANSWER
the programmers
A programming language is called ANSWER if it is executed by an interpreter rather than by first being compiled with a compiler.
interpreted
If the types of a programming language are bound at execution time rather than compile time, then the types are called ANSWER.
dynamically typed
In describing the properties of an object oriented language, encapsulation means ANSWER.
Data and behaviour are packaged together
In discussing object oriented languages objects are organized into a class tree to support the property of ANSWER.
inheritance
In discussing object oriented languages being able to handle objects of related type is called ANSWER.
Polymorphism
(Polymorphism has a different usage in the object oriented programming community than in the functional programming community)
The application that caused a significant increase in the popularity of Ruby was a web framework called ANSWER.
Rails
The concurrency approach used in Ruby is ANSWER.
threads
The command name for the ruby interpreter is ANSWER.
irb
In ruby true.class returns ANSWER
TrueClass
Ruby supports two common ways that boolean expressions are handled in programming languages. In one approach both subexpressions of a boolean operator are evaluated before the boolean operator is evaluated. In the other approach called ANSWER the first subexpression in a boolean expression is evaluated and if that is enough to know the result of the boolean expression, then the second subexpression is not evaluated.
short-circuit evaluation
In Ruby, normally when you try to add a String to a Fixnum, you get an error message saying that a String cannot be coerced to a Fixnum. This is because Ruby is ANSWER typed.
strongly
One way of checking types is to see what constructor was used to create an object that is a parameter. Another way of checking types is to wait until a method is sent to an object and see if it supports the methods. This second way is called ANSWER.
duck typing
A major claim in object oriented design philosophy is that you should code to ANSWER rather than code to implementation.
interface
The & notation in the line of Ruby def gerorge(&sam) is used to indicate that sam is ANSWER.
a code block
The : notation in the Ruby expressions :hi is used to indicate that hi is ANSWER.
a symbol
With respect to the value returned by the Ruby expression:
‘hi’ .object_id == ‘hi’ .object_id
You can say it ANSWER.
could be either true or false
With respect to the value returned by the ruby expression:
:hi.object_id== :hi.object_id
You can say it ANSWER.
will always be true
To execute a code block in Ruby that is passed to a method but does not appear on its parameter list, you use the keyword ANSWER.
yield
To execute a codeblock in Ruby that is passed to a method on its parameter list, you send that parameter the method ANSWER.
call
A code block is some lines of code surrounded by either curly braces or ANSWER.
do end
In Ruby the expression Fixnum.class returns ANSWER.
Class
The root of the inheritance hierarchy in Ruby is the class ANSWER.
Object (According to textbook in 2010)
BasicObject (Updated answer for Ruby 2.3)
In Ruby, the name of the method in the class Me that is automatically invoked when a new object of type Me is created with Me.new is ANSWER.
initialize
In Ruby, the @ is used to indicated that the variable @me is ANSWER.
an instance variable
In Ruby, the @@ is used to indicate that the variable @@me is ANSWER.
a class variable
In Ruby, by convention the ? in the method me? is used to indicate that me is ANSWER.
boolean
In Ruby, the mixin is used to solve the object-oriented programming problem of ANSWER.
multiple inheritance
The feature of programs being able to ‘write programs’ (creating application specific language features) is called ANSWER.
metaprogramming
In Ruby, if you declare a class with a class name that is already in use and put in it the definition of a new method, you have changed the functionality of the existing class (even if it is a predefined class like Fixnum). The property of Ruby that allows this is ANSWER.
open classes
When you send a message to a Ruby object, Ruby first looks at the methods that object supports, and then starts working the inheritance chain. If it still cant find the appropriate method, the message and its parameters get passed as a message to the object looking for a method called ANSWER.
method_missing
In the Ruby community, the acronym DSL is an abbreviation for ANSWER.
domain specific language
In Ruby, if a line starts with a method name, that method is being sent to the object named ANSWER.
self
When you define a method in a class, normally it is meant to be invoked on an object of that class (an instance method). Sometimes it is meant to be invoked on the class name itself (a class method), like Date.parse( ‘3rd Feb 2001’). In Ruby, to define a class method we put ANSWER at the beginning of the method name in its definition.
self
Scala was designed to connect two programming paradigms, which were ANSWER.
object-oriented and functional
Another design goal for Scala was to have its programs easily interoperate with those written in ANSWER.
Java
Scala is ANSWER typed.
statically
Scala uses few type declarations because its compiler does ANSWER.
type inferencing
The main concurrency method used in Scala is ANSWER.
actors
In Scala, to indicate that a variable is immutable, you introduce it with the ANSWER keyword.
val
In Scala, to indicate that a variable is mutable, you introduce it with the ANSWER keyword.
var
In Scala, if I want to redefine a method that is defined in my parent class, I indicate this by using the keyword ANSWER.
override
The Scala feature closest to a Ruby mixin is the ANSWER.
trait
In Scala, the type that every type is a subtype of is called ANSWER.
Any