You are on page 1of 36

PROGRAMMING FUNDAMENTALS

UST-GLOBAL & AKAMAI


BASIC CONCEPTS
• DATA: A set of values of subjects with respect to
qualitative or quantitative variables, that becomes
information when it’s viewed as an analysis in context.
• CODE: Set of order instructions that forms a program
which is executed.
• INPUT: What you put. Whatever comes in.
• OUTPUT: What you get. Whatever comes out.
Classification of Programming Languages
Abstraction level programming language
provide: • Web Languages (HTML5, PHP, MVC, Ruby, Pearl,
JavaScript…)
• High-Level Languages (C#, D, R, Python, Visual Basic,
Lovelace, LISP, Prolog, Delphi…)
• Medium-Level Languages –MLL– (C++, Java, Basic,
Pascal, Cobol, Fortran, Ada, Forth, Macro-Assemble…)
• Low-Level Languages (PL/S, BLISS, B, C, BCPL, ALGOL…)
• Assembly Language
• Machine Language
• Binary Code
• Hardware
Syntax
• In computer science, the syntax of a
computer language is the set of rules
that defines the combinations of
symbols that are considered to be a
correctly structured document or
fragment in that language. This applies
both to programming languages,
where the document represents source
code, and markup languages, where Syntax highlighting and indent style are often
the document represents data. The used to aid programmers in recognizing
elements of source code. Color coded
syntax of a language defines its surface highlighting is used in this piece of code
written in Python.
form.
Semantics
• In programming language theory, semantics is the field concerned with
the rigorous mathematical study of the meaning of programming
languages. It does so by evaluating the meaning of syntactically valid
strings defined by a specific programming language, showing the
computation involved. In such a case that the evaluation would be of
syntactically invalid strings, the result would be non-computation.
Semantics describes the processes a computer follows when executing
a program in that specific language.
Algorithms
•Is an unambiguous specification
procedure or formula of how to
solve a class of problems, based on
conducting a sequence of specified
actions. Algorithms can perform
calculation, data processing, and
automated reasoning tasks. A
computer program can be viewed as
an elaborate algorithm.
FlowCharts
• A flowchart is a type of diagram that
represents an algorithm, workflow or
process. The flowchart shows the steps
as boxes of various kinds, and their
order by connecting the boxes with
arrows. This diagrammatic
representation illustrates a solution
model to a given problem. Flowcharts
are used in analyzing, designing,
documenting or managing a process or A simple flowchart representing a
process for dealing with a non-
program in various fields. functioning lamp.
DFD
• https://sites.google.com/site/informaticaieensma/home/diagramas-
de-flujo/dfd-1-0
EXAMPLE
• Pairs & Primes Numbers
Guided Practice with the Instructor
• Pairs & Non-Pairs by using DFD 1.1
Student’s Practice
Pseudo-Codes
• Pseudocode is an informal high-level description of the operating principle
of a computer program or other algorithm. It uses the structural conventions
of a normal programming language, but is intended for human reading
rather than machine reading. Pseudocode typically omits details that are
essential for machine understanding of the algorithm, such as variable
declarations, system-specific code and some subroutines. The programming
language is augmented with natural language description details, where
convenient, or with compact mathematical notation. The purpose of using
pseudocode is that it is easier for people to understand than conventional
programming language code, and that it is an efficient and environment-
independent description of the key principles of an algorithm. No standard
for pseudocode syntax exists, as a program in pseudocode is not an
executable program. Pseudocode resembles, but should not be confused
with, skeleton programs which can be compiled without errors.
Pseudo-Code vs FlowChart
• Flowcharts, drakon-charts and Unified Modeling Language
(UML) charts can be thought of as a graphical alternative to
pseudocode, but are more spacious on paper. Languages such
as HAGGIS bridge the gap between pseudocode and code
written in programming languages. Its main use is to
introduce students to high level languages through use of this
hybrid language.
Pseudo-Code
Pseudo code for the memetic algorithm.
PSeInt
• http://pseint.sourceforge.net/
//This example is to make an addition, by plussing two numbers
EXAMPLE
InicioProceso Sum
// To load data, you should ask the user for the information by showing it
// when using the instruction Escribir, and then read the data on a variable
// (A for the first, B for the secound) with the instruction to read: Leer
Escribir “Write the first number:"
Leer A
Escribir “Write the second number:"
Leer B
// Now it will calculate the sum, making the plus, and saving the results
// in the ‘C’ variable with the assignation (<-)
C <- A+B
// Finally, the result is shown, preceed by a message to warn the user,
// in just one simple “Escribir” instruction
Escribir “The result is: ", C
FinProceso
Guided Practice with the Instructor
• Pairs & Non-Pairs by using PSeInt
Student’s Practice
What is a Program?
According to Merriam-Webster Dictionary:

1. A brief usually printed outline of the order to be followed, of the features to


be presented.
2. A sequence of coded instructions that can be inserted into a mechanism
(such as a computer).
3. A complete plan for solving a problem by the use of a mechanism (such as a
computer) that includes both instructions to be inserted into the mechanism
and plans for human activities such as interpreting output.
4. A sequence of coded instructions (such as genes or behavioral responses)
that is part of an organism.
What is a Computer Program?
• A computer program is a collection of instructions that performs a specific task
when executed by a computer. A computer requires programs to function. A
computer program is usually written by a computer programmer in a
programming language. A collection of computer programs, libraries, and related
data are referred to as software.

Ada Lovelace's diagram from Note G, the first published


computer algorithm. She is consider the first programming
women.
NOT JABBA

JAVA
What is Java?
• Java is a general-purpose computer-programming language that is
concurrent, class-based, object-oriented, and specifically designed to have
as few implementation dependencies as possible. It is intended to let
application developers "write once, run anywhere" (WORA), meaning that
compiled Java code can run on all platforms that support Java without the
need for recompilation (multi-platform).
• Java was originally developed by James Gosling at Sun Microsystems (which
has since been acquired by Oracle Corporation) and released in 1995 as a
core component of Sun Microsystems' Java platform. As of May 2007, in
compliance with the specifications of the Java Community Process, Sun
relicensed most of its Java technologies under the GNU General Public
License.
• It is known as the “Father” of all new high-level languages. It is based on
C++, and he is the foundation stone for Python language, among others…
Is JavaScript the “Web Java”?
• A common misconception is that JavaScript is closely related to Java or that it is
the web version of Java, but none of both are truth.
• Even so, it is true that both have a ‘C’ language like syntax (the C language being
their most immediate common ancestor language). They also are both typically
sandboxed (when used inside a browser), and JavaScript was designed with Java's
syntax and standard library in mind. In particular, all Java keywords were reserved
in original JavaScript, JavaScript's standard library follows Java's naming
conventions, and JavaScript's Math and Date objects are based on classes from
Java 1.0.
• Besides, both are part of Android’s syntax, which is made on Java, but supports
XML, HTML and JavaScript on it. Both were influenced by Scheme, and both
support functional programming, now; and with the WebAssambly standart, a
technology standardized by the W3C, it allows both to author client-side code for
the World Wide Web.
JavaScript vs Java
• Java and JavaScript both first appeared in 1995, but Java was
developed by James Gosling of Sun Microsystems, and JavaScript by
Brendan Eich of Netscape Communications.
• The differences between the two languages are that Java has static
typing, while JavaScript's typing is dynamic. Java is loaded from
compiled bytecode, while JavaScript is loaded as human-readable
source code. Java's objects are class-based, while JavaScript's are
prototype-based.
How does Java looks like?
Why seeing Java in a Python course?
• Python was originally based on Java. It also took some of C#
characteristics that are alike Java, because, both C# and Java are
build on C++.
• Python is called: “Java, but easier”. If we understand Java, we will
understand Python.
• Acknowledging Java, allows a better comprehension of several
other modern languages, as C#, JavaScript, and Python, among
others… That are alike, or based on Java. That’s why Java is called
the “Father” of modern High-Level programming languages.
• We won’t go deeper on Java, because this course is about Python…
But…
• Here are some online free courses, if any wants to learn
more about Java:
ohttps://www.youtube.com/watch?v=Z0F7sJaOQtw&list=P
L602060AB32FC864B (Código Facilito)
ohttps://www.youtube.com/watch?v=coK4jM5wvko&list=P
LU8oAlHdN5BktAXdEVCLUYzvDyqRQJ2lk (Píldoras
Informáticas)
ohttps://www.youtube.com/watch?v=2ZXiuh0rg3M&list=P
LWtYZ2ejMVJkjOuTCzIk61j7XKfpIR74K (Programación ATS)
Python
What is Python?
• It’s a High-Level Programming Language. It’s like Java but easier, it’s like Perl
but cleaner. Indexation is obligatory. It’s so simple, that looks like pseudo-code.
• It has the following characteristics:
 It is an interpreted language. It uses an interpreter to run the code, instead
of compiling the code into machine language with the compiler, as the old
compiled languages.
 It has dynamic typing and is strongly typed. That means we don’t need to
declare the type of variable data, it self-adjust the variable to what we
need, but without re-changing thru the rest of the code, without mixing
types of variables.
 It is also multi-platform, which means that it runs on any OS.
 It works with the OOP programming paradigm. Which means we will use
classes to set-up abstract objects.
Object Oriented Programming
How to Python?
• https://www.python.org/downloads/
• IDE: https://www.jetbrains.com/pycharm/download/

For Linux: https://www.jetbrains.com/help/pycharm/install-and-set-up-pycharm.html


Integrated Development Environment
• An integrated development environment (IDE) is a software application that
provides comprehensive facilities to computer programmers for software
development. An IDE normally consists of a source code editor, build
automation tools, and a debugger. Most modern IDEs have intelligent code
completion. Some IDEs, such as NetBeans and Eclipse, contain a compiler,
interpreter, or both.
• The boundary between an integrated development environment and other
parts of the broader software development environment is not well-defined.
Sometimes a version control system, or various tools to simplify the
construction of a graphical user interface (GUI), are integrated. Many modern
IDEs also have a class browser, an object browser, and a class hierarchy
diagram, for use in object-oriented software development.
Sublime Text
• Sublime Text is a proprietary cross-platform source code editor with a
Python application programming interface (API). It natively supports
many programming languages and markup languages, and functions
can be added by users with plugins, typically community-built and
maintained under free-software licenses.
• https://download.sublimetext.com/Sublime%20Text%20Build%203176
%20x64%20Setup.exe
On Linux:
https://www.sublimetext.com/docs/3/linux_repositories.html
Python in Linux
Warning: Rules changes depending on the Linux version and/or distribution…
• Ubuntu: http://ubuntuhandbook.org/index.php/2017/07/install-python-3-6-1-in-ubuntu-16-04-lts/
• OS X / Fedora / OpenSuse: https://tutorial.djangogirls.org/es/python_installation/
• CentOS / Debian: https://blog.carreralinux.com.ar/2018/04/python-3-en-linux-version-mas-
reciente/

sudo apt-get update


sudo apt-get install python3.7
https://askubuntu.com/questions/865554
/how-do-i-install-python-3-6-using-apt-get

You might also like