🎧 New: AI-Generated Podcasts Turn your study notes into engaging audio conversations. Learn more

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Full Transcript

**GET 211 NOTE 3** **Introduction to Programming Languages** Programming languages are formal languages designed to communicate with computers. They consist set of rules, syntax and semantics that define how instructions should be written and interpreted by a computer processor. Programming langua...

**GET 211 NOTE 3** **Introduction to Programming Languages** Programming languages are formal languages designed to communicate with computers. They consist set of rules, syntax and semantics that define how instructions should be written and interpreted by a computer processor. Programming languages serve as a bridge between human-readable code and machine-executable code. Developers could create software applications that solve real-world problems via programming languages. Also, programming languages can be described as the foundation blocks for computer software and modern technology. They provide a structured way for humans to communicate with computers by giving instructions on how to perform specific tasks. There are different types of programming languages with diverse applications in engineering field. They enable engineers to create innovative solutions to complex problems. The proficiency of engineers in at least one programming language is an excellent means to success in the field because the knowledge will enhance them to tackle the engineering challenges of this generation. Thus, taking technology to the next level. **Types of Programming Languages** **Programming languages can be divided into three main types** 1. High-level Languages - these languages are closer to human language and are easier for programmers to read and write programs. These include C++, Java, Ruby and Python. **Importance of Programming Languages in Engineering** 1. Problem-solving - programming languages teach logical thinking and problem-solving skills. These are essential for engineers to solve problems with new innovations. 2. Automation - programming enables engineers to automate repetitive tasks. This saves time and reduce the likelihood of errors. 3. Data Analysis - programming languages provide tools for collecting, processing and analyzing data. This is important in making informed decisions in engineering projects. 4. Simulation and Modeling - programming is used to create simulations and models of complex systems. It allows engineers to test and optimize their designs before building physical prototypes. 5. Communication -- programming allows engineers to create clear, concise and well-documented code that enhances communication between engineers and stakeholders. **Implementation of programming languages in a computer system** A programmer utilizes a programming language to instruct a computer the action to take. Step 1- a programmer writes a code which could be set of letters, numbers and other characters. Step 2 -- a complier converts each line of code into a language a computer can understand Step 3 -- the computer scans the code and executes it. Step 4 -- then, computer performs a task or series of tasks. These tasks include displaying an image on a webpage or changing the font of a section text. It could be performing some arithmetic operations, etc. **Mostly used programming languages by the developers in this era** Java script is used by about 65% of the developers while about 55% of them used HTML/CSS. SQL was used by about 49% of them, Python was used by about 48% and Type Script was used by about 34% of the developers. These programming languages are popularly used by the developers to meet their goals in computing in this generation. However, other computer users, such as students make use of programming languages of their choices to bring about new innovations and informed decisions in their area of interests. I. JavaScript is implemented on web browsers. It allows users to add complex features to a web page. These features could be interactive maps, content updates, develop games, animated graphics, etc. II. HTML/CSS languages are used to create web pages and web applications. HTML (HyperText Markup Language) is used for building web page structure while CSS (Cascading Style Sheets) are used to determine the page styling. III. SQL (Structured Query Language) is used for communication with database. It is majorly implemented for updating and retrieving data. IV. Python is implemented basically for machine learning, web development and desktop applications. It is a popular language among those new in programming because its syntax is easy to understand and easy to learn. **Applications of Programming Languages** 1. Web Development - JavaScript, PHP and Ruby are used to create dynamic websites and web applications. 2. Mobile App Development - Java, Swift, and Kotlin are used to develop mobile apps for Android and iOS platforms. 3. Game Development - C++, C\#, and Rust are used to create video games for various platforms. 4. Data Science and Machine Learning - Python and R are popular choices for data analysis, visualization and building machine learning models. 5. System Programming - C and Rust are used to write low-level system software, such as operating systems and device drivers. **Paradigms of programming language** Programming languages can be categorized via their paradigms. Paradigms are fundamental styles or approaches to designing, writing and structuring software programs. They provide a framework for organizing and solving problems. Also, they have influence on the developer design and implementation of software. The paradigms include imperative programming, declarative programming, procedural programming and object - oriented programming. Procedural programming and object-oriented programming (OOP) paradigm will be discussed in this class. Both has unique approaches that can assist in software development. **Procedural programming** It is a programming paradigm that follows a linear top-down approach, step-by-step execution, procedures or functions, local variables and control structures (loops, conditional statements). It focuses on writing procedures or routine. The primary goal is to break down a task into smaller and manageable parts. It is composed of a sequence of statements that are executed orderly. Code is organized into reusable functions that can be called to perform specific tasks. Variables can be defined within functions that are affecting their scope and lifetime. Some of the procedural programming languages are C, Pascal, Fortran and BASIC **Applications** Procedural languages are often used for system-level programming. These include operating systems and embedded systems. They are widely used in scientific computing applications where performance is critical. Scripting languages make use of procedural approach for automating tasks. These include Perl and Bash programming languages. **Object-Oriented Programming Languages** Object-oriented programming (OOP) is a paradigm that uses \"objects\" to represent data and methods to manipulate (that) data. It allows flexibility and modular coding. Also, it emphasizes encapsulation, inheritance and polymorphism. It is most commonly used among the programmers **Popularly used Object-Oriented Languages** are Java, C++, Python, Ruby and C\# **Key Concepts of OOP** **Objects** - instances of classes that represent real-world entities. - have attributes (data) and methods (functions). - example: A Car object might have attributes like make, model, and year, and methods like start, stop, and accelerate. **Classes** - blueprints or templates for creating objects. - define the structure and behavior of objects. - example: The Car class would define the common properties and behaviors of all cars. **Encapsulation** - The bundling of data (attributes) and methods (functions) within a single unit (object). - Protects data from unauthorized access. - Promotes modularity and reusability. **Inheritance** - The ability of one class (subclass) to inherit properties and methods from another class (superclass). - Enables code reuse and creates hierarchical relationships between classes. **Polymorphism** - The ability of objects of different classes to be treated as if they are of the same type. - Allows for flexible and extensible code. 1. **Modularity -** breaks down complex systems into smaller, manageable components. 2. **Reusability - e**ncourages code reuse, reducing development time and effort. 3. **Maintainability - m**akes code easier to understand, modify, and extend. 4. **Scalability - f**acilitates the creation of large, complex systems. 5. **Collaboration -** promotes collaboration among developers by providing a common framework. **Applications** a. Software development - OOP is used in software development for building complex applications such as web applications and enterprise systems. b. Game development - game engines implement OOP principles to manage game objects and behaviors effectively. c. Graphical User Interfaces (GUIs) - OOP is commonly used to create interactive applications with better user interfaces. Object-Oriented Programming promotes remarkable innovation for Engineers. **It** encourages real world modeling which involves collection of objects that interact with each other. It is an approach that enhances engineers in their various fields. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Innovation of OOP in some of the engineering fields --------------------------------------------------- Computer Engineers ------------------ **Database Management -** Object-relational databases (ORDBMS) such as MySQL and PostgreSQL incorporate OOP concepts for efficient data management. --------------------------------------------------------------------------------------------------------------------------------------------------- **GUI Development -** OOP makes the creation of graphical user interfaces (GUIs) easier by modeling components as objects. -------------------------------------------------------------------------------------------------------------------------- **Software Development -** OOP is the foundation of modern software development. C++, C\#, Java, Rubby and Python programming languages are widely used for building complex software systems. ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Electrical Engineers -------------------- **Embedded Systems -** implementation of OOP in the design of embedded systems (microcontrollers and digital signal processors) makes the task of an electrical engineer easier and commendable. **Simulation and Modeling -** OOP is used to create simulations and models of electrical circuits and systems. **Hardware-Software Co-Design -**OOP facilitates the integration of hardware and software components in electronic systems. **Civil Engineers** **Building Information Modeling (BIM) -** OOP is useful in representing building components as objects in BIM software. It output better collaboration and coordination among design teams. **Structural Analysis -** OOP is used in the development of software tools for structural analysis and design **Simulation and Modeling -**simulation of the behavior of structures under different conditions. **Mechanical Engineers** Computer-Aided Design/Computer-Aided Manufacturing **(**CAD/CAM Software) **-** many CAD/CAM software packages use OOP to represent geometric shapes and design elements. **Finite Element Analysis (FEA) -** OOP is useful to develop FEA software for simulating the behavior of mechanical components. **Robotic -** OOP can be used to model and control robotic systems. Especially, their kinematics, dynamics and sensing.

Use Quizgecko on...
Browser
Browser