Saturday, December 30, 2017

Session 9

Session 9
Saturday, 2 desember 2017

Today is my group's turn to present today's topic "Object Oriented Programming" but because Miss Yanfi made a mistake and list us to present session 7's topic "Abstract Data Type" so Miss Yanfi gave us option to choose between session 7 "Abstract Data Type" or session 8 "Object Oriented Programming". My group chose to present session 7 "Abstract Data Type". Today we discuss about The Concept of Abstraction, Introduction to Data Abstraction, Language Examples, Parameterized Abstract Data Types, Encapsulation Constructs, and Naming Encapsulations. After we explain the topics, there were some questions. We were a little confused about the answers for the questions and ask some of it to Miss Yanfi. On this session there's also mind map that Miss Yanfi made for us.

This session talks about the introduction, Object-Oriented Programming, Design Issues for Object-Oriented Languages, Support for Object-Oriented Programming in C++, and The Implementation of Object-Oriented Constructs.

3 major language features :

  • Abstract data type.
  • Inheritance.
  • Polymorphism.
Inheritance allows new classes defined in terms of existing ones, i.e., by allowing them to inherit common parts. Inheritance addresses both of the above concerns--reuse ADTs after minor changes and define classes in a hierarchy.

Three ways a class can differ from its parent:
1. The parent class can define some of its variables or methods to have private access, which means they will not be visible in the subclass.
2. The subclass can add variables and/or methods to those inherited from the parent.
3. The subclass can modify the behavior of one or more of its inherited methods.

A polymorphic variable can be defined in a class that is able to reference (or point to) objects of the class and objects of any of its descendants.

Design Issues for OOP Language :
•The Exclusivity of Objects.
•Are Subclasses Subtypes?
•Single and Multiple Inheritance.
•Object Allocation and Deallocation.
•Dynamic and Static Binding.
•Nested Classes.
•Initialization of Objects.

That's all for this session.

Friday, December 29, 2017

Session 8 - GSLC

Session 8
Saturday, 25 November 2017

Today is GSLC session. Miss Yanfi gave us some questions to answer on the binusmaya's forum.
Here are the questions:

1. What are the similarities of and the differences between Java Packages and C++ Namespace?
2. Explain the dangers of C's approach to encapsulation.

And these are my answers that i wrote on the forum:

1. Similarity : 
- Java uses packages to group classes. C++ uses namespace to group related function and classes. 
- Java package and c++ namespace both make the code cleaner and less redundant. 
- Java package and c++ namespace both provide breakup for class names. 
- Java package and c++ namespace are both abstract container for classes. 

Difference : 
- Java package cant be nested. c++ namespace can be nested. 
- C++ namespace are just used for partitioning names to avoid collisions. java package are used for modules, the naming aspect is just a part of it. 
- In java you can apply various access specifiers to classes which will have impact on your package. these type of access specifiers are not applicable to namespace in C++. 

2. The main problem is that the biggest part of encapsulation is done via hiding, rather than protection. This is achieved through definition hiding: a header file is preprocessed (which is a synonym for copy-pasted) into the implementation file. Anyone with this header file will be able to access any method or public variable of a the client related to the header, left apart any "static" method / variable. The documentation of the dependence of the client program on the library (and its header file) is lost. The author of the library could change the header file and the implementation file, but the client could attempt to use the new implementation file (not realizing it had changed) but with the old header file, which the user had copied into his or her client program.

Monday, November 27, 2017

Session 7

Session 7
Thursday, 2 November 2017


Today is the last session of Programming Language Concept before mid exam. Usually, Programming Language Concept's session is on Saturday but miss Yanfi has another business to do so, the seventh session is moved to Thursday. On this session, there's only one group presentation for preparation of mid exam. Today's topic is "Subprogram".

After the group presentation, miss Yanfi discuss the answer for the last session exercise. Miss Yanfi also explained again the grammar for small language, simple assignment statement and an ambiguous grammar for expression.

This session is discussing about subprograms. The topics are Introduction, Fundamentals of Subprograms, Local Referencing Environments, Parameter-Passing Methods, Parameters That Are Subprograms, Calling Subprograms Indirectly, Overloaded Subprograms, Generic Subprograms, User-Defined Overloaded Operators, Closures, and Coroutines.

Two fundamentals of abstraction are process abstraction and data abstraction. Local variable can be stack-dynamic and static. Each type of variable has their own advantages and disadvantages.

There are 3 type of parameter passing : In mode(pass-by-value), out mode (pass-by-result), and inout mode (pass-by-value-result, pass-by-reference, pass-by-name).


An overloaded subprogram is one that has the same name as another subprogram in the same referencing environment.  A generic or polymorphic subprogram takes parameters of different types on different activations.

A closure is a subprogram and the referencing environment where it was defined.  A coroutine is a subprogram that has multiple entries and controls them itself – supported directly in Lua. Also called symmetric control: caller and called coroutines are on a more equal basis. A coroutine call is named a resume.

This is all for today's session.

Session 6

Session 6

Saturday, 28 October 2017


Today is the sixth session of Programming Language Concept. There's 2 group presentations about today's topic "Control Structure Statements". In this session, Miss Yanfi give us topics for us to study for mid exam.

It's two weeks away from mid exam, so miss Yanfi gives us exercise for our mid exam. After we do the exercise, Miss Yanfi collects it to see what we understand and what we don't understand.

In this session, we learned about selective statement and iterative statement.

Selective statement provides the means of choosing between two or more paths of execution. In example, if then else statement. If the then reserved word or some other syntactic marker is not used to introduce the then clause, the control expression is placed in parenthesis. Selectors can be nested. There are multiple-way selection statement that allow selection of one of any number of statements or  statement groups.

Iterative statements are the repeated execution of a statement or compound statement is accomplished either by iteration or recursion. Counter controlled loops are a counting iterative statement has a loop variable, and a means of specifying the initial and terminal, and stepwise values. In logically-controlled loops, repetition control is based on boolean expression. Sometimes it is convenient for the programmers to decide a location for loop control (other than top or bottom of the loop) using user-located loop control mechanisms.

That's all for this session.

Session 5

Session 5

Saturday, 21 October 2017


Today is the fifth session of Programming Language Concept. Today, there'll be 3 group presentations. Group 2 presentation about last session topic that got delayed, group 3 and 4 presentation about today's topic "Expression & Assignment Statements".

This session, miss Yanfi gives us a concept map to make study easier. The concept map contains all of the important point from "Expression & Assignment Statements" topic.

In this session we learned about boolean expression, arithmetic expression, relational expression and short circuit evaluation.

Arithmetic expression consists of operators, operands, parenthesis and function calls. There are 3 type of operators : unary, binary and ternary. Unary operator has one operand, binary operator has two operands and ternary operator has three operands. In arithmetic expression, there are operator precedence rules, rules that define the order of operation based on operators. The precedence level :
– parentheses
– unary operators
– ** (if the language supports it)
– *, /
– +, -
When an arithmetic expression have 2 or more operators that have the same precedence level, Associativity rules are used. In associativity rules, arithmetic expression are executed from left to right in most language.

Overloaded operator is operator that is used for more than one purpose.

Operand evaluation order :
  1. Variables: fetch the value from memory 
  2. Constants: sometimes a fetch from memory; sometimes the constant is in the machine language instruction 
  3. Parenthesized expressions: evaluate all operands and operators first The most interesting case is when an operand is a function call    
There are 2 types of type conversion : narrowing and widening. Narrowing conversion converts an object to a type that cannot include all of the values of the original type e.g. float to int. Widening conversion converts an object to a type that include at least approximations to all of the values e.g. int to float. An implicit type conversion is called coercion.

Relational expression use relational operators and operands of various types. The result of relational expression is boolean(true or false). 

Boolean expression has operator(function call) and operand(boolean) and the result is boolean(true or false).

Short circuit evaluation is an expression in which the result is determined without evaluating all of the operands and/or operators.

That's all for this session.


Session 4 (GSLC)



Session 4 - GSLC

Saturday, 14 october 2017



Today is the fourth session of Programming Language Concept and it's GSLC. Miss gave us assignment to answer some questions for this GSLC. The questions are :

1. What are the advantages and disadvantages of decimal data types? 

Session 3

Session 3

Saturday, 7 October 2017


Today is the third session of Programming Language. This session is the first groups presentations. Today's topic is about names, bindings, and scopes. Before the presentation starts, miss Yanfi gave us some questions and who can answer will get points. The purpose is to review last session's topic.

After reviewing, comes the group presentation. Group 1 and 2 will take turns present today's topic. After group 1 presentation, time isn't enough for group 2 presentation. So, group 2 presentation is delayed to the next session.

This session talked about Introduction, Names, Variables, The Concept of Binding and Scope.

Names in C-based language are case sensitive so there is disadvantage at reading it because names that look alike are different. Names in other language are case insensitive.

Variable is an abstraction of a memory cell. Variable can be characterized ad a sextuple of name, address, value, type, lifetime and scope.

Binding is an association between an entity and an attribute, such as between a variable and its type or value, or between an operation and a symbol. Binding time is the time at which a binding takes place. There are 5 possible binding times such as language design time, language implementation time, compile time, load time, and runtime.

There are static and dynamic variable. There are types of dynamic variable such as stack-dynamic, implicit and explicit-heap-dynamic. Every type of variable have their own advantages and disadvantages.

The scope of variable is the range of statements over which it is visible. if a variable declared in a unit, it is called local variable and if it's not declared there, it is called nonlocal variable. There are static, global and dynamic scope.

That's all about today session.




Wednesday, October 4, 2017

Session 2

Session 2

Saturday, 30 September 2017

Today is the second session of Programming Language Concept. At first, Miss Yanfi told us that miss had post on the forum about our presentation assignment. Every session onwards, we are going to present about the topic of that session. 

Session 1

Session 1

Saturday, 23 September 2017


Today is the first session of Programming Language Concept. For this course, LG01's lecturer is Miss Yanfi. At this session, miss Yanfi gave us introductions, informations and also rules for her class. Miss also gave us an assignment to make a blog. The content of the blog is the report of session 1 to 13.