Introduction to Programming

Slides:



Advertisements
Similar presentations
.NET Framework Overview
Advertisements

.NET Framework Overview
Revealing the CLR 4.0 Internals Svetlin Nakov Telerik Corporation
Creating and Running Your First C# Program Svetlin Nakov Telerik Corporation
Creating and Running Your First C# Program Telerik Software Academy Telerik School Academy.
JavaScript Basics Course Introduction SoftUni Team Technical Trainers Software University
Software Quality Assurance QA Engineering, Testing, Bug Tracking, Test Automation Software University Technical Trainers SoftUni Team.
Introduction to .NET Framework
Creating and Running Your First C# Program Svetlin Nakov Telerik Corporation
 Dimitar Ivanov Introduction to programming with microcontrollers.
C# Advanced Topics Methods, Classes and Objects SoftUni Team Technical Trainers Software University
Software University Curriculum, Courses, Exams, Jobs SoftUni Team Technical Trainers Software University
.NET Framework Overview
Fundamentals SoftUni Welcome to Software University SoftUni Team Technical Trainers Software University
Advanced JavaScript Course Introduction SoftUni Team Technical Trainers Software University
Project Tracking Tools Trello, Asana, Basecamp, GitHub Issue Tracker, TRAC SoftUni Team Technical Trainers Software University
Programming Basics Course Introduction SoftUni Team Technical Trainers Software University
Software Testing Lifecycle Exit Criteria Evaluation, Continuous Integration Ivan Yonkov Technical Trainer Software University.
Teamwork and Personal Skills Course Introduction Software University SoftUni Team Technical Trainers.
Fundamentals SoftUni Welcome to Software University SoftUni Team Technical Trainers Software University
Design Patterns: Structural Design Patterns
Course Program, Evaluation, Exams
1.1 Introduction to Programming academy.zariba.com 1.
Database APIs and Wrappers
Microsoft Azure SoftUni Team Technical Trainers Software University
Svetlin Nakov Technical Trainer Software University
Build Processes and Continuous Integration Automating Build Processes Software University Technical Trainers SoftUni Team.
Project Tracking Tools Trello, Asana, Basecamp, GitHub Issue Tracker, TRAC Angel Georgiev Part-time Trainer Software University
Test-Driven Development Learn the "Test First" Approach to Coding SoftUni Team Technical Trainers Software University
Introduction to Java The Java Platform, The Java Language, JDK, Eclipse Svetlin Nakov Technical Trainer Software University
JavaScript Basics Course Introduction Svetlin Nakov Technical Trainer Software University
Creating and Running Your First C# Program Svetlin Nakov Telerik Software Academy academy.telerik.com Manager Technical Training
Asynchronous Web Services Writing Asynchronous Web Services SoftUni Team Technical Trainers Software University
C# Basics Course Introduction Svetlin Nakov Technical Trainer Software University
Web Fundamentals (HTML and CSS) Course Introduction SoftUni Team Technical Trainers Software University
Jekyll Static Site Generator Template-Based Site Generation Svetlin Nakov Technical Trainer Software University
The Java Platform, The Java Language, JDK, IntelliJ
Web Development Tools Tools for Front-End Developers Writing HTML and CSS Code SoftUni Team Technical Trainers Software University
Exam Preparation Algorithms Course: Sample Exam SoftUni Team Technical Trainers Software University
Processing JSON in.NET JSON, JSON.NET LINQ-to-JSON and JSON to XML SoftUni Team Technical Trainers Software University
High-Quality Code: Course Introduction Course Introduction SoftUni Team Technical Trainers Software University
Design Patterns: Structural Design Patterns General and reusable solutions to common problems in software design Software University
Advanced C# Course Introduction SoftUni Team Technical Trainers Software University
Object-Oriented Programming Course Introduction Svetlin Nakov Technical Trainer Software University
Reflection Programming under the hood SoftUni Team Technical Trainers Software University
Mocking with Moq Tools for Easier Unit Testing SoftUni Team Technical Trainers Software University
Lecture Set 1 Part B: Understanding Visual Studio and.NET – Structure and Terminology 1/16/ :04 PM.
Data Structures Curriculum, Trainers, Evaluation, Exams SoftUni Team Technical Trainers Software University
Mocking with Moq Mocking tools for easier unit testing Svetlin Nakov Technical Trainer Software University
JavaScript Tools Tools for Writing / Editing / Debugging JavaScript Code Svetlin Nakov Technical Trainer Software University
Programming for Beginners Course Introduction SoftUni Team Technical Trainers Software University
.NET Framework, CLR, MSIL, Assemblies, CTS, etc..
High-Quality Code: Course Introduction Course Introduction SoftUni Team Technical Trainers Software University
Functional Programming Data Aggregation and Nested Queries Ivan Yonkov Technical Trainer Software University
Programming Fundamentals Course Introduction SoftUni Team Technical Trainers Software University
Doctrine The PHP ORM SoftUni Team Technical Trainers Software University
ASP.NET MVC Course Program, Trainers, Evaluation, Exams, Resources SoftUni Team Technical Trainers Software University
Inheritance Class Hierarchies SoftUni Team Technical Trainers Software University
Stacks and Queues Processing Sequences of Elements SoftUni Team Technical Trainers Software University
Generics SoftUni Team Technical Trainers Software University
C# OOP Advanced Course Introduction SoftUni Team Technical Trainers Software University
Java OOP Advanced Course Introduction SoftUni Team Technical Trainers Software University
High-Quality Programming Code Code Correctness, Readability, Maintainability, Testability, Etc. SoftUni Team Technical Trainers Software University
Version Control Systems
Introducing the Microsoft® .NET Framework
C# Basic Syntax, Visual Studio, Console Input / Output
Debugging and Troubleshooting Code
ASP.NET MVC Introduction
C# Advanced Course Introduction SoftUni Team C# Technical Trainers
Version Control Systems
Presentation transcript:

Introduction to Programming Creating and Running Your First C# Program SoftUni Team Technical Trainers Software University http://softuni.bg © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Table of Contents What is Computer Programming? Your First C# Program What is .NET Framework? What is Visual Studio? Compiling, Running and Debugging C# Programs What is MSDN Library? © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

What is Computer Programming? © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Define: Computer Programming Computer programming: creating a sequence of instructions to enable the computer to do something Definition by Google © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Software Development Phases Define a task / problem Plan your solution Find suitable algorithm / data structures to use Find suitable libraries / platforms / frameworks Write source code (step by step) Fix program errors (bugs) Install, configure and run the software Fix / improve the software over time = Specification = Architecture / Design = Implementation = Testing & Debugging = Deployment = Maintenance © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Your First C# Program © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

First Look at C# Sample C# program: https://dotnetfiddle.net/ using System; class HelloCSharp { static void Main() Console.WriteLine("Hello, C#"); } © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

C# Code – How It Works? Include the standard .NET namespace "System" Define a class called "HelloCSharp" using System; class HelloCSharp { static void Main() Console.WriteLine("Hello, C#"); } Define the Main() method – the program entry point Print a text on the console by calling the method "WriteLine" of the class "Console" © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

The C# Code Should Be Well Formatted Class names should use PascalCase and start with a CAPITAL letter. using System; class HelloCSharp { static void Main() Console.WriteLine("Hello, C#"); } The { symbol should be alone on a new line. The } symbol should be under the corresponding {. The block after the { symbol should be indented by a TAB. © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Example of Bad Code Formatting Such formatting makes the source code unreadable using System ; class HelloCSharp { static void Main( ) { Console . WriteLine ("Hello, C#" ) ;Console. WriteLine ( "Hello again" ) ;}} © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

What is "C#"? C# is a modern programming language C# features: A syntax that allows to give instructions to the computer C# features: Extremely powerful Easy to learn Easy to read and understand Object-oriented Functional programming features © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

What You Need to Program? A programming language C# Problem to solve IDE, compilers, SDK Visual Studio, .NET Framework SDK Set of useful standard classes Microsoft .NET Framework FCL Help documentation MSDN Library © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Your First C# Program Live Demo © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

What is .NET Framework? Download .NET Framework 4.5 © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

What is .NET Framework? Environment for execution of .NET programs (CLR) Powerful library of classes (FCL) Programming model Common execution engine for many programming languages C# Visual Basic .NET Managed C++ ... and many others © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Inside .NET Framework The building blocks of .NET Framework Languages VB.NET Managed C++ F# Python Delphi … ASP.NET MVC, Web Forms, Web API, SignalR WPF & XAML Windows Store Apps Windows Forms Silverlight, WP7 / WP8 FCL WCF, WWF (Communication / Workflow Tier) ADO.NET, Entity Framework, LINQ, XML (Data Tier) Base Class Library (BCL) – I/O, Threading, Collections, Strings, … CLR Common Language Runtime (CLR) + DLR (for Dynamic Languages) OS Operating System (Windows / Linux) © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

CLR – The Heart of .NET Framework Common Language Runtime (CLR) Managed execution environment (virtual machine) Executes .NET applications Controls the execution process Automatic memory management (garbage collection) Programming languages integration Multiple versions support for assemblies Integrated type safety and security CLR © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Framework Class Library Framework Class Library (FCL) Provides basic classes for developers: Console applications Web applications and web services XAML, WPF, Silverlight rich-media applications Windows Forms and WPF GUI applications Windows Store applications Database applications Applications for mobile devices © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

What is Visual Studio? Download Visual Studio Community 2013 © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Visual Studio Visual Studio – Integrated Development Environment (IDE) Development tool that helps us to: Write code Design user interface Compile code Execute / test / debug applications Browse the help Manage project's files © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Benefits of Visual Studio Single tool for: Writing code in many languages (C#, VB.NET, Python, …) Using different technologies (Web Forms, MVC, WPF, EF, WCF, …) For different platforms (Win8, Silverlight, Windows Phone, …) Full integration of most development activities (coding, compiling, testing, debugging, deployment, version control, ...) Very easy to use! © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Visual Studio – Example © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Compiling, Running and Debugging C# Programs Visual Studio Compiling, Running and Debugging C# Programs © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Creating New Console Application File  New  Project ... Choose Visual C#  Console Application Choose project directory and name © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Creating New Console Application (2) Visual Studio creates some source code for you Most imports are not required Namespace not required Class name should be changed File name should be changed © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Compiling the Source Code The process of compiling includes: Syntactic checks Type safety checks Translation of the source code to lower level language (MSIL) Creating executable files (assemblies) You can start compilation by Using Build->Build Solution/Project Pressing [F6] or [Shift+Ctrl+B] © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Running Programs The process of running application includes: Compiling (if project not compiled) Starting the application You can run application by: Using Debug->Start menu By pressing [F5] or [Ctrl+F5] * NOTE: Not all types of projects can be started! © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Debugging The Code The process of debugging application includes: Spotting an error Finding the lines of code that cause the error Fixing the error in the code Testing to check if the error is gone and no new errors are introduced Iterative and continuous process Debuggers help a lot © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Debugging in Visual Studio Visual Studio has a built-in debugger It provides: Breakpoints Ability to trace the code execution Ability to inspect variables at runtime © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Compiling, Running and Debugging C# Programs – Live Demo Visual Studio Compiling, Running and Debugging C# Programs – Live Demo © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Visual Studio Blank Solution Creating a Solution without any Projects © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

What Is a Blank Solution? A Visual Studio blank solution Solution with no projects in it Projects to be added later Why we need a blank solution in Visual Studio? First create a blank solution for your homework Then create a project for each assignment from the homework © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Creating a Blank Solution in Visual Studio © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Visual Studio Blank Solution Live Demo © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Creating Projects Exercise

What is MSDN Library? © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

What is MSDN Library? Complete documentation of all classes and their functionality With descriptions of all methods, properties, events, etc. With code examples For all Microsoft technologies Related articles Library of samples MSDN Library is available at msdn.microsoft.com/library © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Press [F1] to view the documentation How to Use MSDN Library? Search in Google for certain class / method / property E.g. Or Use Visual Studio's built-in help system Press [F1] in Visual Studio in the code Browse http://msdn.microsoft.com Press [F1] to view the documentation © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Browsing the Documentation – Live Demo MSDN Library Browsing the Documentation – Live Demo © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Summary Programming: creating a sequence of instructions (source code) C#: modern programming language, easy to learn C# programs: class + main method + code in it .NET Framework – a modern platform for software development by Microsoft Visual Studio – powerful IDE for .NET developers: write / compile / execute / debug code MSDN Library – the C# and .NET documentation © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Introduction to Programming https://softuni.bg/courses/programming-basics/ © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Homework Review Live Demo © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

License This course (slides, examples, demos, videos, homework, etc.) is licensed under the "Creative Commons Attribution- NonCommercial-ShareAlike 4.0 International" license Attribution: this work may contain portions from "Fundamentals of Computer Programming with C#" book by Svetlin Nakov & Co. under CC-BY-SA license "C# Part I" course by Telerik Academy under CC-BY-NC-SA license © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Free Trainings @ Software University Software University Foundation – softuni.org Software University – High-Quality Education, Profession and Job for Software Developers softuni.bg Software University @ Facebook facebook.com/SoftwareUniversity Software University @ YouTube youtube.com/SoftwareUniversity Software University Forums – forum.softuni.bg © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.