Advanced C# Introduction Lecture 00 PDF
Document Details
Dr. Mahmoud R. Morgan
Tags
Summary
This document is an introduction to the C# programming language and the .NET platform. It details the goals of the course, which is aimed at beginners, and provides foundational information on C# and its purpose within the broader landscape of software development.
Full Transcript
Who Is This Course Aimed At? o C# Course is best suited for beginners. o It is intended for anyone who so far has not engaged seriously in programming and would like to begin doing it. o We start from scratch and introduces you step by step into the fundamentals of programming. 1 | Part 1 –...
Who Is This Course Aimed At? o C# Course is best suited for beginners. o It is intended for anyone who so far has not engaged seriously in programming and would like to begin doing it. o We start from scratch and introduces you step by step into the fundamentals of programming. 1 | Part 1 – Itroduction Dr. Mahmoud R. Morgan o It won’t teach you absolutely everything you might need for becoming a software engineer and working at a software company, but it will lay the groundwork on which you can build up technological knowledge and skills, and through them you will be able to turn programming into your profession. 2 | Part 1 – Itroduction Dr. Mahmoud R. Morgan o If you’ve never written a computer program, don’t worry. There is always a first time. o In this Course we will teach you how to program from scratch. We do not expect any previous knowledge or abilities. 3 | Part 1 – Itroduction Dr. Mahmoud R. Morgan o All you need is some basic computer knowledge and a desire to take up programming. o The rest you will learn from the Course. o If you can already write simple programs or if you have studied programming at school, or you’ve coded with friends, do not assume you know everything! 4 | Part 1 – Itroduction Dr. Mahmoud R. Morgan o At the end of this course, you’ll become aware of how many things you’ve missed. o o This course is indeed for beginners, but it teaches concepts and skills that even experienced professional programmers lack. 5 | Part 1 – Itroduction Dr. Mahmoud R. Morgan The C# Programming Language o C# is a modern object-oriented, general- purpose programming language. 6 | Part 1 – Itroduction Dr. Mahmoud R. Morgan o created and developed by Microsoft together with the.NET platform. o There is highly diverse software developed with C# and on the.NET platform such as: o office applications, web applications, websites, desktop applications, mobile applications, games and many others. 7 | Part 1 – Itroduction Dr. Mahmoud R. Morgan o C# is a high-level language that is similar to Java and C++ and, to some extent, languages like Delphi, VB.NET and C. All C# programs are object oriented. o They consist of a set of definitions in classes that contain methods and the methods contain the program logic – the 8 | Part 1 – Itroduction Dr. Mahmoud R. Morgan instructions which the computer executes. o Nowadays C# is one of the most popular programming languages. It is used by millions of developers worldwide. 9 | Part 1 – Itroduction Dr. Mahmoud R. Morgan o Because C# is developed by Microsoft as part of their modern platform for development and execution of applications, the.NET Framework, the language is widely spread among Microsoft-oriented companies, organizations and individual developers. 10 | Part 1 – Itroduction Dr. Mahmoud R. Morgan Who owns.NET platform? o The. NET Framework (pronounced as "dot net") is a proprietary software framework developed by Microsoft that runs primarily on Microsoft Windows. 11 | Part 1 – Itroduction Dr. Mahmoud R. Morgan What is.NET? o Formally,.NET is “an open source developer platform, created by Microsoft, for building many different types of applications. o You can write.NET apps in C#, F#, Visual C++, or Visual Basic, others”. 12 | Part 1 – Itroduction Dr. Mahmoud R. Morgan o.NET is the tool that lets you build and run C# programs (we’ll avoid F#, Visual C++, Visual Basic for now). 13 | Part 1 – Itroduction Dr. Mahmoud R. Morgan When you download.NET, you’re really downloading a bunch of programs that: Translate your C# code into instructions that a computer can understand. 14 | Part 1 – Itroduction Dr. Mahmoud R. Morgan Provide utilities for building software, like tools for printing text to the screen and finding the current time. Define a set of data types that make it easier for you to store information in your programs, like text, numbers, and dates. 15 | Part 1 – Itroduction Dr. Mahmoud R. Morgan o There are a few versions of.NET, They do the same job but they are meant for different operating systems:.NET Framework is the original version of.NET that only runs on Windows computers. 16 | Part 1 – Itroduction Dr. Mahmoud R. Morgan.NET Core is the new, cross-platform version of.NET that runs on Windows, MacOS, and Linux computers. o Finally, we have to understand that because C# language and the.NET platform are maintained and managed entirely by Microsoft and are not open to third parties, all other large software 17 | Part 1 – Itroduction Dr. Mahmoud R. Morgan corporations like IBM, Oracle and SAP base their solutions on the Java platform and use Java as their primary language for developing their own software products. 18 | Part 1 – Itroduction Dr. Mahmoud R. Morgan Why C#? There are many reasons why we chose C# for our course. o It is a modern programming language o widely spread, used by millions of programmers around the entire world. o it is a very simple and easy to learn. 19 | Part 1 – Itroduction Dr. Mahmoud R. Morgan o It is natural to start with a language that is suitable for beginners while still widely used in the industry by many large companies, making it one of the most popular programming languages nowadays. 20 | Part 1 – Itroduction Dr. Mahmoud R. Morgan Advantages of C# o C# is an object-oriented programming language. Such are all modern programming languages used for serious software systems (like Java, Python and others). 21 | Part 1 – Itroduction Dr. Mahmoud R. Morgan o By starting to program with C# and the.NET Framework platform, you are on a very perspective track. o If you open a website with job offers for programmers, you’ll see for yourself that the demand for C# and.NET specialists is huge and is close to the demand for Java programmers. 22 | Part 1 – Itroduction Dr. Mahmoud R. Morgan A Look at the Course’s Contents o Introduction to Programming o Conditional Statements o Primitive Types and Variables o Loops o Operators and Expressions o Arrays o Console Input and Output o Methods 23 | Part 1 – Itroduction Dr. Mahmoud R. Morgan Introduction to Programming 24 | Part 1 – Itroduction Dr. Mahmoud R. Morgan What Does It Mean "To Program"? o Nowadays computers have become irreplaceable. o We use them to solve complex problems at the workplace, look for driving directions, have fun and communicate. o They have countless applications in the business world, the entertainment 25 | Part 1 – Itroduction Dr. Mahmoud R. Morgan industry, telecommunications and finance. o It’s not an over-statement to say that computers build the neural system of our contemporary (modern, current) society, and it is difficult to imagine its existence without them. 26 | Part 1 – Itroduction Dr. Mahmoud R. Morgan o In reality, it is not the computers, but the programs (the software), which run on them, that matter. It is the software that makes computers valuable to the end user, allowing for many different types of services that change our lives. 27 | Part 1 – Itroduction Dr. Mahmoud R. Morgan Conclusion To program is to tell a computer which tasks to perform in order to solve problems. You can think of programming as a collaboration 28 | Part 1 – Itroduction Dr. Mahmoud R. Morgan between humans and computers, in which humans create instructions for a computer to follow (code) in a language computers can understand. How Do Computers Process Information? The hard drive, along with the 70 Fundamentals of Computer Programming with C# files on it, and the operating memory 29 | Part 1 – Itroduction Dr. Mahmoud R. Morgan (RAM) represent the warehouses, and the different protocols are the transportation systems, which provide the input and output of information. The computer is a machine for information processing. o the input information is taken from (files or RAM) Afterwards, it is processed by 30 | Part 1 – Itroduction Dr. Mahmoud R. Morgan one or more processes and it comes out modified as a new product. o Web based applications serve as a prime example. They use HTTP to transfer raw materials and products, and information processing usually has to do with extracting content from a database and 31 | Part 1 – Itroduction Dr. Mahmoud R. Morgan preparing it for visualization in the form of HTML. 32 | Part 1 – Itroduction Dr. Mahmoud R. Morgan The Essence of Programming The essence of programming is to control the work of the computer on all levels. This is done with the help of "orders" and "commands" from the programmer, also known as programming instructions. 33 | Part 1 – Itroduction Dr. Mahmoud R. Morgan Once more!! o To "program" means to organize the work of the computer through sequences of instructions. o These commands (instructions) are given in written form and are implicitly followed by the computer (respectively by the operating system, the CPU and the peripheral devices). 34 | Part 1 – Itroduction Dr. Mahmoud R. Morgan Note: To “program” means writing sequences of instructions in order to organize the work of the computer to perform something. These sequences of instructions are called “computer programs” or “scripts”. 35 | Part 1 – Itroduction Dr. Mahmoud R. Morgan An algorithm is: A sequence of steps to achieve, complete some work or obtain some result is called an algorithm. This is how programming is related to algorithms. Programming involves describing what you want the computer to do by a sequence of steps, by algorithms. 36 | Part 1 – Itroduction Dr. Mahmoud R. Morgan Programmers are the people who create these instructions, which control computers. These instructions are called programs. 37 | Part 1 – Itroduction Dr. Mahmoud R. Morgan Stages in Software Development o Writing software can be a very complex and time-consuming task, involving a whole team of software engineers and other specialists. 38 | Part 1 – Itroduction Dr. Mahmoud R. Morgan o As a result, many methods and practices, which make the life of programmers easier, have emerged. o All they have in common is that the development of each software product goes through several different stages: 39 | Part 1 – Itroduction Dr. Mahmoud R. Morgan 1. Gathering the requirements for the product and creating a task. 2. Planning and preparing the architecture and design. 3. Implementation (includes the writing of program code). 4. Product trials (testing). 5. Deployment and exploitation. 6. Support. 40 | Part 1 – Itroduction Dr. Mahmoud R. Morgan Note: Implementation, testing, deployment and support are mostly accomplished using programming. 41 | Part 1 – Itroduction Dr. Mahmoud R. Morgan Gathering the Requirements The requirements for the product are usually defined in the form of documentation, written in English or any other language. There is no programming done at this stage. The requirements are defined by experts, who are familiar with the problems in a certain field. They can also write them up in such a way that they are easy to understand by the programmers. In the general case, these experts are not programming specialists, and they are called business analysts. Planning and Preparing the Architecture and Design After all the requirements have been gathered comes the planning stage. At this stage, a technical plan for the implementation of the project is created, describing the platforms, technologies and the initial architecture (design) of the program. This step includes a fair amount of creative work, which is done by software engineers with a lot of experience. They are sometimes called software architects. 42 | Part 1 – Itroduction Dr. Mahmoud R. Morgan Note: software architects are software engineers with a lot of experience, responsible about creating the technical plan for the implementation of the project, which describes the platforms, technologies and the initial architecture (design) of the program. 43 | Part 1 – Itroduction Dr. Mahmoud R. Morgan According to the requirements, the following parts are chosen: A. The type of the application – for example: console application, desktop application GUI (Graphical User Interface application) client-server application Web application Rich Internet Application (RIA) mobile application peer-to-peer application or other. 44 | Part 1 – Itroduction Dr. Mahmoud R. Morgan B. The architecture of the software – for example: single layer double layer. triple layer. multi-layer. SOA (Service Oriented Architecture). C. The programming language most suitable for the implementation for example: C#, F#, Java, PHP, Python, Ruby, JavaScript or C++, or a combination of different languages. 45 | Part 1 – Itroduction Dr. Mahmoud R. Morgan D. The technologies that will be used: Platform (Microsoft.NET, Java EE, LAMP or another) Database server (Oracle, SQL Server, MySQL, NoSQL database or another). Technologies for the user interface (Flash, JavaServer Faces, Eclipse RCP, ASP.NET, Windows Forms, Silverlight, WPF or another). Technologies for data access (for example Hibernate, JPA or ADO.NET Entity Framework). Reporting technologies (SQL Server Reporting Services, Jasper Reports or another) and many other combinations of technologies that will be used for the implementation of the various parts of the software system. 46 | Part 1 – Itroduction Dr. Mahmoud R. Morgan E. The development frameworks that will simplify the development, e.g. ASP.NET MVC (for.NET), Knockout.js (for JavaScript), Rails (for Ruby), Django (for Python) and many others. F. The number and skills of the people who will be part of the development team. G. The development plan – separating the functionality in stages, resources and deadlines for each stage. H. Others (size of the team, locality of the team, methods of communication etc.). 47 | Part 1 – Itroduction Dr. Mahmoud R. Morgan Implementation o The stage, most closely connected with programming, is the implementation stage. At this phase, the program (application) is implemented (written) according to the given task, design and architecture. 48 | Part 1 – Itroduction Dr. Mahmoud R. Morgan o Programmers participate by writing the program (source) code o creating a programmer’s mindset and building the knowledge to use all the resources provided by the C# language and the.NET platform, in order to create software applications. 49 | Part 1 – Itroduction Dr. Mahmoud R. Morgan Product Testing o Product testing is a very important stage of software development. Its purpose is to make sure that all the requirements are strictly followed and covered. o This process can be implemented manually, but the preferred way to do it is by automated tests. 50 | Part 1 – Itroduction Dr. Mahmoud R. Morgan o These tests are small programs, which automate the trials as much as possible. There are parts of the functionality that are very hard to automate, which is why product trials include automated as well as manual procedures to ensure the quality of the code. 51 | Part 1 – Itroduction Dr. Mahmoud R. Morgan The testing (trials) process o is implemented by quality assurance engineers (QAs). They work closely with the programmers to find and correct errors (bugs) in the software. At this stage, it is a priority to find defects in the code and almost no new code is written. 52 | Part 1 – Itroduction Dr. Mahmoud R. Morgan o Many defects and errors are usually found during the testing stage and the program is sent back to the implantation stage. o These two stages are very closely tied, and it is common for a software product to switch between them many times before it covers all the requirements and is ready for the deployment and usage stages. 53 | Part 1 – Itroduction Dr. Mahmoud R. Morgan Deployment and Operation o Deployment is the process which puts a given software product into exploitation. o After the deployment is successfully completed, the product is ready for operation. o The next step is to train employees to use it. 54 | Part 1 – Itroduction Dr. Mahmoud R. Morgan Technical Support o During the exploitation (operation) process, it is inevitable (usual - expected) that problems will appear. o They may be caused by many factors such as: errors in the software incorrect usage or faulty configuration 55 | Part 1 – Itroduction Dr. Mahmoud R. Morgan most problems occur when the users change their requirements. Documentation o The documentation stage is not a separate stage but accompanies all the other stages. o Documentation is an important part of software development and aims to pass 56 | Part 1 – Itroduction Dr. Mahmoud R. Morgan knowledge between the different participants in the development and support of a software product. o Information is passed along between different stages as well as within a single stage. o The development documentation is usually created by the developers, architects, programmers, QA engineers and others). 57 | Part 1 – Itroduction Dr. Mahmoud R. Morgan Very Important Note o software development is much more than just coding (writing code), and it includes a few other processes such as: requirements analysis, design, planning, testing and support, which require a wide variety of specialists called software engineers. 58 | Part 1 – Itroduction Dr. Mahmoud R. Morgan o Programming is just a small, but very essential part of software development. 59 | Part 1 – Itroduction Dr. Mahmoud R. Morgan To be continue. 60 | Part 1 – Itroduction Dr. Mahmoud R. Morgan