Está en la página 1de 42

Fundamentos de la

Programacin

Renato Haddad
Microsoft Most Valuable Professional
Brasil

Created with novaPDF Printer (www.novaPDF.com)


Objetivo

Mostrar los fundamentos de la


programacin a travs de ejemplos y
prcticas utilizadas cotidianamente en el
desarrollo de aplicaciones

Created with novaPDF Printer (www.novaPDF.com)


Lgica de
Programacin

Created with novaPDF Printer (www.novaPDF.com)


Lgica de Programacin
Entrada Entrada
No

Proceso Prueba ok?


Si

Salida Salida

Created with novaPDF Printer (www.novaPDF.com)


Lgica de Programacin
Base de Datos
Entrada

Biblioteca de
Proceso
clases

Salida
Servicio Web

Created with novaPDF Printer (www.novaPDF.com)


Fundamentos

Created with novaPDF Printer (www.novaPDF.com)


Variables
Qu es una variable?
En qu situacin se usa una variable?

Created with novaPDF Printer (www.novaPDF.com)


Variables
Cmo declarar una variable?
C# Espacio
Tipo NombreDeLaVariable en la
RAM

VB.NET
Dim NombreDeLaVariable As Tipo

Created with novaPDF Printer (www.novaPDF.com)


Variables
Cmo declarar una variable?

Created with novaPDF Printer (www.novaPDF.com)


Variables
Tipos de variables

Created with novaPDF Printer (www.novaPDF.com)


Variables
Tipos de variables

Created with novaPDF Printer (www.novaPDF.com)


Variables
Tiempo de vida de una variable

Created with novaPDF Printer (www.novaPDF.com)


Variables
Conversiones

Created with novaPDF Printer (www.novaPDF.com)


Variables
Tipos definidos por el usuario

Created with novaPDF Printer (www.novaPDF.com)


Estructuras de
Programacin

Created with novaPDF Printer (www.novaPDF.com)


Estructuras de Decisin
IF - VB.NET IF - C#
If condicion Then if (condicin)
statements statements
ElseIf condicion Then else if (condicin)
elseif statements statements
Else else
else statements statements
End If

Created with novaPDF Printer (www.novaPDF.com)


IF VB.NET

Created with novaPDF Printer (www.novaPDF.com)


IF C#

Created with novaPDF Printer (www.novaPDF.com)


Estructuras de Decisin
Select Case VB.NET
Select Case expresion-a-evaluar
Case valor switch C#
statements switch (expresion-a-evaluar) {
Case Else case valor:
else statements statements
End Select break;
default:
statements
break; }
Created with novaPDF Printer (www.novaPDF.com)
Select Case VB.NET

Created with novaPDF Printer (www.novaPDF.com)


switch - C#

Created with novaPDF Printer (www.novaPDF.com)


Estructuras de Looping
For Next
ForEach
While
Do While

Created with novaPDF Printer (www.novaPDF.com)


For Next VB.NET
For contador = inicio To fin [Step incremento]
statements
Exit For
Next

Created with novaPDF Printer (www.novaPDF.com)


For C#
for (contador; expresion; incremento){
statements
}

Created with novaPDF Printer (www.novaPDF.com)


For Each VB.NET
For Each elemento In grupo
statements
Exit For
Next

Created with novaPDF Printer (www.novaPDF.com)


Foreach C#
foreach (elemento in grupo){
statements }

Created with novaPDF Printer (www.novaPDF.com)


VB.NET
While condicion
While
statements
End While

Do { While | Until } condicion


statements
Exit Do
Loop

Do
statements
Exit Do
Loop { While | Until } condicion

C#
while (expresion){ statements }
do{ statements } while (expresion);
Created with novaPDF Printer (www.novaPDF.com)
Rutinas y
Objetos

Created with novaPDF Printer (www.novaPDF.com)


Procedures / Rutinas
Qu es un procedure?

Argumentos y tipos usados

Argumento opcional

Created with novaPDF Printer (www.novaPDF.com)


Errores comunes en la devolucin
Fig 1

Fig 2

Fig 3
Created with novaPDF Printer (www.novaPDF.com)
Funcin
Qu es una funcin?
Argumentos y tipos usados
Tipos devueltos

Created with novaPDF Printer (www.novaPDF.com)


Funcin

Created with novaPDF Printer (www.novaPDF.com)


Funcin
Funciones internas

Created with novaPDF Printer (www.novaPDF.com)


Objeto
Qu es un objeto?

Created with novaPDF Printer (www.novaPDF.com)


Propiedades
Propiedades de un objeto

Created with novaPDF Printer (www.novaPDF.com)


Mtodos
Mtodos de un objeto

Created with novaPDF Printer (www.novaPDF.com)


Colecciones
Qu es una coleccin?

Created with novaPDF Printer (www.novaPDF.com)


OOP
Programacin Orientada a Objetos - OOP

Created with novaPDF Printer (www.novaPDF.com)


Glosario

Created with novaPDF Printer (www.novaPDF.com)


Trminos comunes
Variable Array (Arreglo)
Types (Tipos) Procedure
Index (ndice) (Procedimiento)
Constants n-tier (N-Capas)
(Constantes) business class
Collection (Clase de
(Coleccin) Negocios)
Web Services
(Servicios Web)

Created with novaPDF Printer (www.novaPDF.com)


Trminos comunes
Build (Compilar) Breakpoint
Deploy (Instalar) Debug
OOP (Object (Depuracin)
Oriented Solution
Programming) (Solucin)
Components Project
(Componentes) (Proyecto)
Class library
(Biblioteca de
Clases)

Created with novaPDF Printer (www.novaPDF.com)


Trminos comunes
Stored procedure (Procedimiento
Almacenado)
Query (Consulta)
Provider (Proveedor)
DataTable
DataSet

Created with novaPDF Printer (www.novaPDF.com)

También podría gustarte