This document provides an overview of C++ programming concepts including:
- Procedure-oriented programming focuses on tasks like reading, calculating and printing using functions, while object-oriented programming emphasizes data through objects and classes.
- Some problems with C include lack of consideration for data elements and lack of security for networks.
- C++ classes contain variables and functions to characterize objects. Data and functions are tied together and data is hidden.
- Key concepts explained include objects, member functions, constructors, destructors, inheritance and polymorphism.
- Examples demonstrate basic C++ programs, classes, objects, arrays of objects, function overloading and the this pointer.
The document contains a sample question paper for CBSE Grade 12 Computer Science exam. It includes multiple choice, short answer and long answer questions on topics like C++ programming, object oriented concepts, data structures, databases and computer networks. Some questions ask to write C++ code for tasks like defining classes, sorting arrays, implementing stacks. Others involve evaluating C++ code snippets, answering conceptual questions, writing SQL queries and solving problems on Boolean algebra and logic circuits.
The document contains code snippets demonstrating different C++ programming concepts including structures, arrays, functions, parameters, and pointers. Some key examples are:
1) A structure defined to store student name and roll number, with an array of structures to hold multiple student records.
2) Functions demonstrated with and without return values, including passing parameters to functions.
3) Arrays used to store integer values and an array of structures to hold multiple student records.
4) Pointers passed as parameters to functions to modify passed in values.
The document provides a variety of short code examples illustrating common programming concepts in C++.
The document provides a 3-hour computer science exam containing multiple questions related to C++ programming. It includes questions about automatic type conversion vs type casting, header files, syntax errors, output of code snippets, polymorphism, class definitions, function definitions, arrays, memory allocation, stacks, and postfix notation evaluation.
This document contains instructions and questions for a computer science exam. It covers topics like call by value vs call by reference in C++, header files, class definitions, functions, arrays, pointers, structures, inheritance, and file input/output. There are multiple choice, short answer, and code writing questions testing a variety of programming concepts.
This document discusses structures in C++. It defines a structure as a collection of related data items stored together under one name. It shows how to declare a structure with members, declare structure variables, assign and access values of structure members, and use arrays of structures. The objectives are to declare and use structure variables, understand the difference between structures and arrays, and use arrays in structures.
1. The document provides an introduction to object-oriented programming concepts and C++ programming.
2. It discusses the need for OOP over procedure-oriented programming and highlights the differences between the two approaches.
3. The document then covers basic C++ concepts like data types, functions, classes, inheritance and polymorphism through examples.
In this chapter we will understand how to define custom classes and their elements. We will learn to declare fields, constructors and properties for the classes. We will revise what a method is and we will broaden our knowledge about access modifiers and methods.
This document provides an overview of C++ programming concepts including:
- Procedure-oriented programming focuses on tasks like reading, calculating and printing using functions, while object-oriented programming emphasizes data through objects and classes.
- Some problems with C include lack of consideration for data elements and lack of security for networks.
- C++ classes contain variables and functions to characterize objects. Data and functions are tied together and data is hidden.
- Key concepts explained include objects, member functions, constructors, destructors, inheritance and polymorphism.
- Examples demonstrate basic C++ programs, classes, objects, arrays of objects, function overloading and the this pointer.
The document contains a sample question paper for CBSE Grade 12 Computer Science exam. It includes multiple choice, short answer and long answer questions on topics like C++ programming, object oriented concepts, data structures, databases and computer networks. Some questions ask to write C++ code for tasks like defining classes, sorting arrays, implementing stacks. Others involve evaluating C++ code snippets, answering conceptual questions, writing SQL queries and solving problems on Boolean algebra and logic circuits.
The document contains code snippets demonstrating different C++ programming concepts including structures, arrays, functions, parameters, and pointers. Some key examples are:
1) A structure defined to store student name and roll number, with an array of structures to hold multiple student records.
2) Functions demonstrated with and without return values, including passing parameters to functions.
3) Arrays used to store integer values and an array of structures to hold multiple student records.
4) Pointers passed as parameters to functions to modify passed in values.
The document provides a variety of short code examples illustrating common programming concepts in C++.
The document provides a 3-hour computer science exam containing multiple questions related to C++ programming. It includes questions about automatic type conversion vs type casting, header files, syntax errors, output of code snippets, polymorphism, class definitions, function definitions, arrays, memory allocation, stacks, and postfix notation evaluation.
This document contains instructions and questions for a computer science exam. It covers topics like call by value vs call by reference in C++, header files, class definitions, functions, arrays, pointers, structures, inheritance, and file input/output. There are multiple choice, short answer, and code writing questions testing a variety of programming concepts.
This document discusses structures in C++. It defines a structure as a collection of related data items stored together under one name. It shows how to declare a structure with members, declare structure variables, assign and access values of structure members, and use arrays of structures. The objectives are to declare and use structure variables, understand the difference between structures and arrays, and use arrays in structures.
1. The document provides an introduction to object-oriented programming concepts and C++ programming.
2. It discusses the need for OOP over procedure-oriented programming and highlights the differences between the two approaches.
3. The document then covers basic C++ concepts like data types, functions, classes, inheritance and polymorphism through examples.
In this chapter we will understand how to define custom classes and their elements. We will learn to declare fields, constructors and properties for the classes. We will revise what a method is and we will broaden our knowledge about access modifiers and methods.
Here we are going to learn why is a good practice to use interfaces and how they are different from abstraction classes. Further more we are going to see how which one of them to use.
The document discusses various concepts related to abstraction in software development including project architecture, code refactoring, enumerations, and the static keyword in Java. It describes how to split code into logical parts using methods and classes to improve readability, reuse code, and avoid repetition. Refactoring techniques like extracting methods and classes are presented to restructure code without changing behavior. Enumerations are covered as a way to represent numeric values from a fixed set as text. The static keyword is explained for use with classes, variables, methods, and blocks to belong to the class rather than object instances.
Object Oriented Programming using C++ Part IIIAjit Nayak
The document discusses inheritance in object-oriented programming. It defines inheritance as a technique where a new subclass inherits attributes and behaviors from an existing superclass without needing to redefine them. This allows code reuse and reduces development costs. The document provides examples of single inheritance with classes like Employee and Manager, and multi-level inheritance with Student, Test, and Result classes. It also discusses polymorphism through method overriding and different types of inheritance like public, private and protected.
The document provides an overview of the Python programming language. It discusses that Python is an interpreted, interactive, object-oriented, and high-level programming language. It can be used to develop desktop and web applications. Popular applications built using Python include Instagram, Google, Dropbox, Yahoo Maps, Spotify, and Reddit. The document also covers Python variables, data types, operators, and basic control structures like if/else statements and while loops. It provides examples of how to write, run, and execute Python code in both interactive and script modes.
Lambdaj is an internal DSL that allows manipulating collections without loops. It provides static methods to filter, sort, extract, and otherwise operate on collections. By treating collections as single objects and allowing method references, lambdaj can concisely represent operations that would otherwise require loops. While lambdaj is generally 4-6 times slower than iterative versions, it improves readability of collection operations.
The document discusses principles and best practices for writing clean code, including using meaningful names, separating commands and queries, avoiding repetition, using exceptions instead of return codes, and following object-oriented principles like polymorphism instead of switch statements on objects. It provides examples of good and bad code for concepts like single responsibility, primitive obsession, and refused bequest. The overall goal is to write code that is readable, maintainable, and extendable.
La teoria delle categorie sta alla programmazione funzionale come i GoF design pattern stanno a quella ad oggetti. Vista l’imminente introduzione delle lambda expression, è tempo anche per gli sviluppatori Java di imparare qualcosa in più riguardo ai più comuni pattern di programmazione funzionale. Le monadi sono probabilmente le più espressive (e forse le più incomprese) fra questi pattern, per cui lo scopo del talk è quello di introdurle, chiarendo con esempi pratici come e quando dovrebbero essere usate, sottolineando i loro vantaggi e mostrando come possono essere implementate in Java8.
ESOFT Metro Campus - Diploma in Software Engineering - (Module V) Windows Based Application Development in C#
(Template - Virtusa Corporate)
Contents:
Introduction to .NET Framework
.NET Framework Platform Architecture
Microsoft Visual Studio
C# Language
C#, VS and .NET Framework Versions
Your First C# Application
Printing Statements
Comments in C#
Common Type System
Value Types and Reference Type
Variables Declaration in C#
Type Conversion
Arithmetic Operators
Assignment Operators
Comparison Operators
Logical Operators
If Statement
If… Else Statement
If… Else if… Else Statement
Nested If Statement
Switch Statement
While Loop
Do While Loop
For Loop
Arrays
Accessing Arrays using foreach Loop
Two Dimensional Arrays
Classes and Objects in C#
Inheritance in C#
Partial Classes
Namespaces
Windows Forms Applications
Using Buttons, Labels and Text Boxes
Displaying Message Boxes
Error Handling with Try… Catch… finally…
Using Radio Buttons
Using Check Boxes
Using List Boxes
Creating Menus
Creating ToolStrips
MDI Forms
Database Application in C#
Creating a Simple Database Application
SQL Insert / Update / Retrieving / Delete
SQL Command Execute Methods
Data Sets
The document discusses object oriented programming concepts like class, object, encapsulation, inheritance and polymorphism. It provides examples of defining a class with data members and member functions in C++. It also explains constructors, destructors, different types of constructors like default, parameterized and copy constructor. Examples are given to illustrate how objects are created from a class and how member functions can be defined internally or externally.
Beauty and/or elegance in functional programmingSilviaP24
This document discusses the concepts of beauty and elegance in functional programming. It begins by exploring definitions of beauty from various historical periods and fields like mathematics. It then examines characteristics that make code beautiful, like separation of concerns, non-repetitiveness, conciseness, modularity, reusability and simplicity. The document provides examples of how functional programming exhibits these traits through techniques like immutable data, pure functions, parametricity and category theory abstractions. It concludes by noting that static typing, functional paradigms and separation of concerns can help produce higher quality code according to certain metrics.
Encapsulation provides benefits such as reducing complexity, ensuring structural changes remain local, and allowing for validation and data binding. It works by hiding implementation details and wrapping code and data together. Objects use private fields and public getters/setters for access. Access modifiers like private, protected, and public control visibility. Validation occurs in setters through exceptions. Mutable objects can be modified after creation while immutable objects cannot. The final keyword prevents inheritance, method overriding, or variable reassignment.
Domain Modeling Made Functional (KanDDDinsky 2019)Scott Wlaschin
(video at https://fsharpforfunandprofit.com/ddd/)
Statically typed functional programming languages encourage a very different way of thinking about types. The type system is your friend, not an annoyance, and can be used in many ways that might not be familiar to OO programmers. Types can be used to represent the domain in a fine-grained, self documenting way. And in many cases, types can even be used to encode business rules so that you literally cannot create incorrect code. You can then use the static type checking almost as an instant unit test — making sure that your code is correct at compile time. In this talk, we'll look at some of the ways you can use types as part of a domain driven design process, with some simple real world examples in F#. No jargon, no maths, and no prior F# experience necessary.
Functional programming can be an excellent approach to designing decoupled, reusable systems with a rich domain model. In fact, the lessons from applying DDD in a functional language translate well to object-oriented programming.
The document discusses various object-oriented programming concepts in C++ including inheritance, polymorphism, composition, and aggregation. It provides examples of how to implement inheritance with base and derived classes, defines abstract classes, and demonstrates composition using aggregation relationships between classes. Vector containers are described as a way to implement dynamic arrays. Polymorphism is explored through pointer-based references to base classes and virtual functions.
The document discusses variables and operators in Java. It defines variables as containers that store data like numbers and letters, and notes that data types determine what values can be stored. It then covers various data types including primitive types like int and float, and reference types like Strings and Arrays. The document also discusses operators like arithmetic, logical, and assignment operators. It provides examples of declaring and using variables and operators in Java code.
Defining Simple Classes
Using Own Classes and Objects
Access Modifiers
Constructors and Initializers
Defining Fields
Defining Properties, Getters and Setters
Defining Methods
Exercises: Defining and Using Own Classes
Rule 1: Follow a consistent coding standard
Rule 2: Name things properly, long variable and function names are allowed
Rule 3: Be expressive, write code as you speak and be optimally verbose
Rule 4: Max indent per method should be 2, in case of exceptions 3
Rule 5: Avoid creating god object and long methods
Rule 6: Keep the method in one place, inject the class and call it, DRY
Rule 7: Avoid in-line comments (comment with code), put comments in the method doc
This document discusses principles and best practices for writing clean code. It defines clean code as code that works, is easy to read, understand and extend. It emphasizes writing code for other developers who will maintain it. Some key points include writing small, focused methods with meaningful names; avoiding duplicated code; using exceptions appropriately; formatting code consistently; and writing thorough automated tests. The overall goal is to communicate intent in the code as clearly as possible through these practices.
This document discusses polymorphism, abstract classes, and abstract methods. It defines polymorphism as an object's ability to take on many forms and describes how it allows reference variables to refer to objects of child classes. It also distinguishes between method overloading and overriding, and explains the rules for each. Abstract classes are introduced as classes that cannot be instantiated directly but can be inherited from, and it is noted they may or may not contain abstract methods.
This document discusses techniques for working with legacy code, including sprout method, wrap method, and wrap class. Sprout method involves extracting part of an existing method into a new method. Wrap method surrounds an existing method with new code. Wrap class creates a new class that delegates to the original class, allowing new behavior to be added. The techniques allow new functionality to be added to legacy code in a way that does not disrupt existing behavior and allows the new code to be tested independently.
Here we are going to learn why is a good practice to use interfaces and how they are different from abstraction classes. Further more we are going to see how which one of them to use.
The document discusses various concepts related to abstraction in software development including project architecture, code refactoring, enumerations, and the static keyword in Java. It describes how to split code into logical parts using methods and classes to improve readability, reuse code, and avoid repetition. Refactoring techniques like extracting methods and classes are presented to restructure code without changing behavior. Enumerations are covered as a way to represent numeric values from a fixed set as text. The static keyword is explained for use with classes, variables, methods, and blocks to belong to the class rather than object instances.
Object Oriented Programming using C++ Part IIIAjit Nayak
The document discusses inheritance in object-oriented programming. It defines inheritance as a technique where a new subclass inherits attributes and behaviors from an existing superclass without needing to redefine them. This allows code reuse and reduces development costs. The document provides examples of single inheritance with classes like Employee and Manager, and multi-level inheritance with Student, Test, and Result classes. It also discusses polymorphism through method overriding and different types of inheritance like public, private and protected.
The document provides an overview of the Python programming language. It discusses that Python is an interpreted, interactive, object-oriented, and high-level programming language. It can be used to develop desktop and web applications. Popular applications built using Python include Instagram, Google, Dropbox, Yahoo Maps, Spotify, and Reddit. The document also covers Python variables, data types, operators, and basic control structures like if/else statements and while loops. It provides examples of how to write, run, and execute Python code in both interactive and script modes.
Lambdaj is an internal DSL that allows manipulating collections without loops. It provides static methods to filter, sort, extract, and otherwise operate on collections. By treating collections as single objects and allowing method references, lambdaj can concisely represent operations that would otherwise require loops. While lambdaj is generally 4-6 times slower than iterative versions, it improves readability of collection operations.
The document discusses principles and best practices for writing clean code, including using meaningful names, separating commands and queries, avoiding repetition, using exceptions instead of return codes, and following object-oriented principles like polymorphism instead of switch statements on objects. It provides examples of good and bad code for concepts like single responsibility, primitive obsession, and refused bequest. The overall goal is to write code that is readable, maintainable, and extendable.
La teoria delle categorie sta alla programmazione funzionale come i GoF design pattern stanno a quella ad oggetti. Vista l’imminente introduzione delle lambda expression, è tempo anche per gli sviluppatori Java di imparare qualcosa in più riguardo ai più comuni pattern di programmazione funzionale. Le monadi sono probabilmente le più espressive (e forse le più incomprese) fra questi pattern, per cui lo scopo del talk è quello di introdurle, chiarendo con esempi pratici come e quando dovrebbero essere usate, sottolineando i loro vantaggi e mostrando come possono essere implementate in Java8.
ESOFT Metro Campus - Diploma in Software Engineering - (Module V) Windows Based Application Development in C#
(Template - Virtusa Corporate)
Contents:
Introduction to .NET Framework
.NET Framework Platform Architecture
Microsoft Visual Studio
C# Language
C#, VS and .NET Framework Versions
Your First C# Application
Printing Statements
Comments in C#
Common Type System
Value Types and Reference Type
Variables Declaration in C#
Type Conversion
Arithmetic Operators
Assignment Operators
Comparison Operators
Logical Operators
If Statement
If… Else Statement
If… Else if… Else Statement
Nested If Statement
Switch Statement
While Loop
Do While Loop
For Loop
Arrays
Accessing Arrays using foreach Loop
Two Dimensional Arrays
Classes and Objects in C#
Inheritance in C#
Partial Classes
Namespaces
Windows Forms Applications
Using Buttons, Labels and Text Boxes
Displaying Message Boxes
Error Handling with Try… Catch… finally…
Using Radio Buttons
Using Check Boxes
Using List Boxes
Creating Menus
Creating ToolStrips
MDI Forms
Database Application in C#
Creating a Simple Database Application
SQL Insert / Update / Retrieving / Delete
SQL Command Execute Methods
Data Sets
The document discusses object oriented programming concepts like class, object, encapsulation, inheritance and polymorphism. It provides examples of defining a class with data members and member functions in C++. It also explains constructors, destructors, different types of constructors like default, parameterized and copy constructor. Examples are given to illustrate how objects are created from a class and how member functions can be defined internally or externally.
Beauty and/or elegance in functional programmingSilviaP24
This document discusses the concepts of beauty and elegance in functional programming. It begins by exploring definitions of beauty from various historical periods and fields like mathematics. It then examines characteristics that make code beautiful, like separation of concerns, non-repetitiveness, conciseness, modularity, reusability and simplicity. The document provides examples of how functional programming exhibits these traits through techniques like immutable data, pure functions, parametricity and category theory abstractions. It concludes by noting that static typing, functional paradigms and separation of concerns can help produce higher quality code according to certain metrics.
Encapsulation provides benefits such as reducing complexity, ensuring structural changes remain local, and allowing for validation and data binding. It works by hiding implementation details and wrapping code and data together. Objects use private fields and public getters/setters for access. Access modifiers like private, protected, and public control visibility. Validation occurs in setters through exceptions. Mutable objects can be modified after creation while immutable objects cannot. The final keyword prevents inheritance, method overriding, or variable reassignment.
Domain Modeling Made Functional (KanDDDinsky 2019)Scott Wlaschin
(video at https://fsharpforfunandprofit.com/ddd/)
Statically typed functional programming languages encourage a very different way of thinking about types. The type system is your friend, not an annoyance, and can be used in many ways that might not be familiar to OO programmers. Types can be used to represent the domain in a fine-grained, self documenting way. And in many cases, types can even be used to encode business rules so that you literally cannot create incorrect code. You can then use the static type checking almost as an instant unit test — making sure that your code is correct at compile time. In this talk, we'll look at some of the ways you can use types as part of a domain driven design process, with some simple real world examples in F#. No jargon, no maths, and no prior F# experience necessary.
Functional programming can be an excellent approach to designing decoupled, reusable systems with a rich domain model. In fact, the lessons from applying DDD in a functional language translate well to object-oriented programming.
The document discusses various object-oriented programming concepts in C++ including inheritance, polymorphism, composition, and aggregation. It provides examples of how to implement inheritance with base and derived classes, defines abstract classes, and demonstrates composition using aggregation relationships between classes. Vector containers are described as a way to implement dynamic arrays. Polymorphism is explored through pointer-based references to base classes and virtual functions.
The document discusses variables and operators in Java. It defines variables as containers that store data like numbers and letters, and notes that data types determine what values can be stored. It then covers various data types including primitive types like int and float, and reference types like Strings and Arrays. The document also discusses operators like arithmetic, logical, and assignment operators. It provides examples of declaring and using variables and operators in Java code.
Defining Simple Classes
Using Own Classes and Objects
Access Modifiers
Constructors and Initializers
Defining Fields
Defining Properties, Getters and Setters
Defining Methods
Exercises: Defining and Using Own Classes
Rule 1: Follow a consistent coding standard
Rule 2: Name things properly, long variable and function names are allowed
Rule 3: Be expressive, write code as you speak and be optimally verbose
Rule 4: Max indent per method should be 2, in case of exceptions 3
Rule 5: Avoid creating god object and long methods
Rule 6: Keep the method in one place, inject the class and call it, DRY
Rule 7: Avoid in-line comments (comment with code), put comments in the method doc
This document discusses principles and best practices for writing clean code. It defines clean code as code that works, is easy to read, understand and extend. It emphasizes writing code for other developers who will maintain it. Some key points include writing small, focused methods with meaningful names; avoiding duplicated code; using exceptions appropriately; formatting code consistently; and writing thorough automated tests. The overall goal is to communicate intent in the code as clearly as possible through these practices.
This document discusses polymorphism, abstract classes, and abstract methods. It defines polymorphism as an object's ability to take on many forms and describes how it allows reference variables to refer to objects of child classes. It also distinguishes between method overloading and overriding, and explains the rules for each. Abstract classes are introduced as classes that cannot be instantiated directly but can be inherited from, and it is noted they may or may not contain abstract methods.
This document discusses techniques for working with legacy code, including sprout method, wrap method, and wrap class. Sprout method involves extracting part of an existing method into a new method. Wrap method surrounds an existing method with new code. Wrap class creates a new class that delegates to the original class, allowing new behavior to be added. The techniques allow new functionality to be added to legacy code in a way that does not disrupt existing behavior and allows the new code to be tested independently.
Paulo Morgado presented an overview of new features in C# 6.0. Some key points:
- The .NET Compiler Platform ("Roslyn") reimplements the C# and VB compilers in C# with public APIs.
- New C# 6.0 features include auto-property initializers, primary constructors, string interpolation, null propagation, expression-bodied members, and await in catch/finally blocks.
- Many features are still being implemented or considered for inclusion in C# 6.0 based on the April 2014 preview release.
- The presentation demonstrated examples of the new C# 6.0 language features and their syntax. Attendees were encouraged to try
The document provides an overview and summary of key features of C# classes, including:
- Class declaration syntax and default access levels
- Constructors and initializing fields
- Static and readonly fields
- Value and reference parameters
- Arrays as reference types that can be initialized with shorthand syntax
It also briefly discusses the System.Array base class and how to safely access elements in multi-dimensional arrays.
The document summarizes new features that have been added to C# programming language over different versions of Visual Studio. It discusses features such as generics, lambda expressions, LINQ, tuples, pattern matching, exception filters, auto-property initializers, expression-bodied members and more. It also provides code examples to illustrate some of these features like tuples, deconstruction, pattern matching with case statements, async Main method and others.
This document provides an overview of Metro style apps and the C++ language features for building them. It compares the architecture and frameworks of Metro style apps to desktop apps. It then summarizes key C++ language features for Metro style development including reference types, memory management, pointers, events, generics and libraries. The document promotes C++ for building high performance Metro style apps and provides examples of key language concepts.
The document discusses the key ideas and features of the C# programming language. It covers C# being the first component-oriented language in the C/C++ family, that everything in C# is an object, and that C# enables robust and durable software while preserving investments in existing code and technologies. It provides examples of core C# concepts like classes, interfaces, properties, events, generics, operator overloading, and more.
1. The document discusses the evolution of the C# programming language from versions 1.0 through 4.0, highlighting new features introduced in each version such as generics, LINQ, dynamic programming, and covariance/contravariance.
2. It provides code examples to illustrate key concepts like generics, LINQ queries, dynamic binding, and how covariance/contravariance enables safer usage of generics.
3. The last section summarizes some of the main features introduced in each C# version from managed code to generics to dynamic programming.
All you need to know about JS functions. talk was given by Oluwaleke Fakorede in JavaScript Ife Meetup.
Contains ways to declare javascript functions
methods in JavaScript.
This document discusses optimizing C# code for speed, maintainability, and flexibility. It provides tips for using profilers to optimize for speed, establishing coding standards to improve maintainability, and refactoring code. Exceptions, allocation in loops, string concatenation, and validating enum values are discussed as examples of code that could be optimized. Guidelines are provided around using exceptions, GC.Collect, and designing enums.
A brief overview about how to write human readable and meaningful code. Here is described why and how to write meaningful names of variables or method, what to follow about writing a function for SRP / Open-Closed principle rule, when to write comments and rules of Code Formatting. Advantages of clean code is also described here.
The document provides an introduction to the C# programming language. It discusses some of the key ideas and concepts of C# including that it is a component-oriented language where everything is an object. It aims to provide robust and durable software through features like garbage collection, exceptions, and type safety. C# also aims to preserve investments in existing code through interoperability and allowing C++ constructs. The document then provides examples and explanations of various C# language features like classes, structs, interfaces, properties, events, and attributes.
Introduction to Csharp (C-Sharp) is a programming language developed by Micro...NALESVPMEngg
The document provides an introduction to the C# programming language. It discusses some of the key ideas and concepts of C# including that it is a component-oriented language where everything is an object. It aims to provide robust and durable software through features like garbage collection, exceptions, and type safety. C# also aims to preserve investments in existing code through interoperability and allowing C++ constructs. The document then provides examples and explanations of various C# language features like classes, structs, interfaces, properties, events, and attributes.
C# is a component-oriented language that introduces object-oriented improvements to the C/C++ family of languages. Everything in C# is an object, providing a unified type system without performance costs. C# aims to produce robust, durable software using techniques like garbage collection and exceptions, while preserving investments in existing C/C++ code through interoperability. The document provides an overview of key C# concepts like classes, interfaces, attributes, events, operators and more.
C# is a component-oriented language that introduces object-oriented improvements to the C/C++ family of languages. Everything in C# is an object, providing a unified type system without performance costs. C# aims to produce robust, durable software using techniques like garbage collection and exceptions, while preserving investments in existing C/C++ code through interoperability. The document provides an overview of key C# concepts like classes, interfaces, attributes, and events to illustrate how C# supports component-based development.
The document introduces C# as the first component-oriented language in the C/C++ family. It discusses key features of C# including everything being an object, robust and durable software through garbage collection and exceptions, and preservation of investment from C++. It provides examples of basic C# concepts like classes, structs, interfaces, enums, delegates, properties and events.
Similar to Practices For Becoming A Better Programmer (20)
"Scaling RAG Applications to serve millions of users", Kevin GoedeckeFwdays
How we managed to grow and scale a RAG application from zero to thousands of users in 7 months. Lessons from technical challenges around managing high load for LLMs, RAGs and Vector databases.
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfChart Kalyan
A Mix Chart displays historical data of numbers in a graphical or tabular form. The Kalyan Rajdhani Mix Chart specifically shows the results of a sequence of numbers over different periods.
Discover top-tier mobile app development services, offering innovative solutions for iOS and Android. Enhance your business with custom, user-friendly mobile applications.
ScyllaDB is making a major architecture shift. We’re moving from vNode replication to tablets – fragments of tables that are distributed independently, enabling dynamic data distribution and extreme elasticity. In this keynote, ScyllaDB co-founder and CTO Avi Kivity explains the reason for this shift, provides a look at the implementation and roadmap, and shares how this shift benefits ScyllaDB users.
In the realm of cybersecurity, offensive security practices act as a critical shield. By simulating real-world attacks in a controlled environment, these techniques expose vulnerabilities before malicious actors can exploit them. This proactive approach allows manufacturers to identify and fix weaknesses, significantly enhancing system security.
This presentation delves into the development of a system designed to mimic Galileo's Open Service signal using software-defined radio (SDR) technology. We'll begin with a foundational overview of both Global Navigation Satellite Systems (GNSS) and the intricacies of digital signal processing.
The presentation culminates in a live demonstration. We'll showcase the manipulation of Galileo's Open Service pilot signal, simulating an attack on various software and hardware systems. This practical demonstration serves to highlight the potential consequences of unaddressed vulnerabilities, emphasizing the importance of offensive security practices in safeguarding critical infrastructure.
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...DanBrown980551
This LF Energy webinar took place June 20, 2024. It featured:
-Alex Thornton, LF Energy
-Hallie Cramer, Google
-Daniel Roesler, UtilityAPI
-Henry Richardson, WattTime
In response to the urgency and scale required to effectively address climate change, open source solutions offer significant potential for driving innovation and progress. Currently, there is a growing demand for standardization and interoperability in energy data and modeling. Open source standards and specifications within the energy sector can also alleviate challenges associated with data fragmentation, transparency, and accessibility. At the same time, it is crucial to consider privacy and security concerns throughout the development of open source platforms.
This webinar will delve into the motivations behind establishing LF Energy’s Carbon Data Specification Consortium. It will provide an overview of the draft specifications and the ongoing progress made by the respective working groups.
Three primary specifications will be discussed:
-Discovery and client registration, emphasizing transparent processes and secure and private access
-Customer data, centering around customer tariffs, bills, energy usage, and full consumption disclosure
-Power systems data, focusing on grid data, inclusive of transmission and distribution networks, generation, intergrid power flows, and market settlement data
Northern Engraving | Modern Metal Trim, Nameplates and Appliance PanelsNorthern Engraving
What began over 115 years ago as a supplier of precision gauges to the automotive industry has evolved into being an industry leader in the manufacture of product branding, automotive cockpit trim and decorative appliance trim. Value-added services include in-house Design, Engineering, Program Management, Test Lab and Tool Shops.
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...Jason Yip
The typical problem in product engineering is not bad strategy, so much as “no strategy”. This leads to confusion, lack of motivation, and incoherent action. The next time you look for a strategy and find an empty space, instead of waiting for it to be filled, I will show you how to fill it in yourself. If you’re wrong, it forces a correction. If you’re right, it helps create focus. I’ll share how I’ve approached this in the past, both what works and lessons for what didn’t work so well.
Introduction of Cybersecurity with OSS at Code Europe 2024Hiroshi SHIBATA
I develop the Ruby programming language, RubyGems, and Bundler, which are package managers for Ruby. Today, I will introduce how to enhance the security of your application using open-source software (OSS) examples from Ruby and RubyGems.
The first topic is CVE (Common Vulnerabilities and Exposures). I have published CVEs many times. But what exactly is a CVE? I'll provide a basic understanding of CVEs and explain how to detect and handle vulnerabilities in OSS.
Next, let's discuss package managers. Package managers play a critical role in the OSS ecosystem. I'll explain how to manage library dependencies in your application.
I'll share insights into how the Ruby and RubyGems core team works to keep our ecosystem safe. By the end of this talk, you'll have a better understanding of how to safeguard your code.
What is an RPA CoE? Session 2 – CoE RolesDianaGray10
In this session, we will review the players involved in the CoE and how each role impacts opportunities.
Topics covered:
• What roles are essential?
• What place in the automation journey does each role play?
Speaker:
Chris Bolin, Senior Intelligent Automation Architect Anika Systems
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...Alex Pruden
Folding is a recent technique for building efficient recursive SNARKs. Several elegant folding protocols have been proposed, such as Nova, Supernova, Hypernova, Protostar, and others. However, all of them rely on an additively homomorphic commitment scheme based on discrete log, and are therefore not post-quantum secure. In this work we present LatticeFold, the first lattice-based folding protocol based on the Module SIS problem. This folding protocol naturally leads to an efficient recursive lattice-based SNARK and an efficient PCD scheme. LatticeFold supports folding low-degree relations, such as R1CS, as well as high-degree relations, such as CCS. The key challenge is to construct a secure folding protocol that works with the Ajtai commitment scheme. The difficulty, is ensuring that extracted witnesses are low norm through many rounds of folding. We present a novel technique using the sumcheck protocol to ensure that extracted witnesses are always low norm no matter how many rounds of folding are used. Our evaluation of the final proof system suggests that it is as performant as Hypernova, while providing post-quantum security.
Paper Link: https://eprint.iacr.org/2024/257
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/temporal-event-neural-networks-a-more-efficient-alternative-to-the-transformer-a-presentation-from-brainchip/
Chris Jones, Director of Product Management at BrainChip , presents the “Temporal Event Neural Networks: A More Efficient Alternative to the Transformer” tutorial at the May 2024 Embedded Vision Summit.
The expansion of AI services necessitates enhanced computational capabilities on edge devices. Temporal Event Neural Networks (TENNs), developed by BrainChip, represent a novel and highly efficient state-space network. TENNs demonstrate exceptional proficiency in handling multi-dimensional streaming data, facilitating advancements in object detection, action recognition, speech enhancement and language model/sequence generation. Through the utilization of polynomial-based continuous convolutions, TENNs streamline models, expedite training processes and significantly diminish memory requirements, achieving notable reductions of up to 50x in parameters and 5,000x in energy consumption compared to prevailing methodologies like transformers.
Integration with BrainChip’s Akida neuromorphic hardware IP further enhances TENNs’ capabilities, enabling the realization of highly capable, portable and passively cooled edge devices. This presentation delves into the technical innovations underlying TENNs, presents real-world benchmarks, and elucidates how this cutting-edge approach is positioned to revolutionize edge AI across diverse applications.
How information systems are built or acquired puts information, which is what they should be about, in a secondary place. Our language adapted accordingly, and we no longer talk about information systems but applications. Applications evolved in a way to break data into diverse fragments, tightly coupled with applications and expensive to integrate. The result is technical debt, which is re-paid by taking even bigger "loans", resulting in an ever-increasing technical debt. Software engineering and procurement practices work in sync with market forces to maintain this trend. This talk demonstrates how natural this situation is. The question is: can something be done to reverse the trend?
1. Practices for becoming a better programmer Srikanth P Shreenivas [email_address] http://www.srikanthps.com
2. Joys of the craft The Mythical Man-Month, Frederick P. Brooks. Jr Slide Why is programming fun? What delights may its practitioner expect as reward? First is the sheer joy of making things. Second is pleasure of making things that are useful to other people. Third is the fascination of fashioning complex puzzle-like objects of interlocking moving parts and watching them work in subtle cycles, playing out the consequences of principles built in the beginning. The programmed computer has all the effects of a pinball machine or jukebox mechanism, carried to the ultimate. Fourth is the joy of always learning, which springs from non-repeating nature of the task. Finally, there is the delight of working in such a tractable medium. The programmer, like the poet, works only slightly removed from pure thought-stuff. He builds his castles in the air, from the air, creating by exertion of imagination. Programming gratifies creative longings built deep within us
5. Use Meaningful Names int d; //elapsed time in days int elapsedTimeInDays; int fileAgeInDays; int daysSinceLastModification; Intention-revealing names
9. Meaningful names Slide int r = 0; for (int j = 0; j < 5; j++) { r = r + j * 8; } Use searchable names int workingDaysInWeek = 5; int workingHoursPerDay = 8; int hoursInWeek = 0; for (int dayIndex = 0; dayIndex < workingDaysInWeek ; dayIndex ++) { hoursInWeek = hoursInWeek + dayIndex * workingHoursPerDay; }
10. Meaningful names Slide Class names Should be nouns or noun phrases. Examples: Car, Account, DataRetrievalService, AddressParser
11. Meaningful names Slide Method names Should be verb or verbPhrases Examples: parseData , deletePage , save Methods that return boolean values should sound like question. Example: isAuthenticated , hasNoErrors , isEmpty if (user.isAuthenticated()) { String data = parseData(input); if (hasErrors(data)) { throw ErrorInDataException(); } }
12. Meaningful names Slide Pick one word per concept Don’t mix words like “fetch”, “get”, “retrieve”. Be consistent.
13. Meaningful names Slide Don’t use same word for two different concepts Example: Don’t use “add”, where “insert” makes sense.
14. Meaningful names Slide Use names from problem/solution domain Prefer “InvoiceGenerator” to “DataExtractor”
16. Turning Comments into Code Slide class InchToPointConvertor { //convert the quantity in inches to points. static float parseInch(float inch) { return inch * 72; //one inch contains 72 points. } } class InchToPointConvertor { final static int POINTS_PER_INCH=72; static float convertToPoints (float inch) { return inch * POINTS_PER_INCH ; } }
17. Turning Comments into Code Slide class Account { ... //check if the password is complex enough, i.e., //contains letter and digit/symbol. boolean isComplexPassword(String password) { //found a digit or symbol? boolean dg_sym_found=false; //found a letter? boolean letter_found=false; for(int i=0; i<password.length(); i++){ char c=password.charAt(i); if(Character.isLowerCase(c)||Character.isUpperCase(c)) letter_found=true; else dg_sym_found=true; } return (letter_found) && (dg_sym_found); } } class Account { ... boolean isComplexPassword(String password){ return containsLetter(password) && (containsDigit(password) || containsSymbol(password)); } boolean containsLetter(String password) { ... } boolean containsDigit(String password) { ... } boolean containsSymbol(String password) { ... } }
20. Functions Slide Write small functions … .and try to write even smaller functions. Aim for functions that are not longer than 4 to 5 lines. Split the big methods in smaller methods (Extract method) Use intention-revealing names for methods. Public List<Person> filterList(List<Person> input) { List filteredList = new ArrayList(); for (Person p : input) { if (p.getDateOfBirth().getYear() > 1997) { filteredList.add(p); } if (p.getAddress().getCity().equals(“Bangalore”)) { filteredList.add(p); } } return filterdList; } Public List<Person> selectTeenAgersFromBangalore (List<Person> input) { List filteredList = new ArrayList(); for (Person p : input) { if (isTeenAger(p) || isFromBangalore(p)) { filteredList.add(p); } } return filterdList; }
21. Functions Slide Do one thing in a function (Single responsibility) Public List<Person> filterList(List<Person> input) { List filteredList = new ArrayList(); for (Person p : input) { if (p.getDateOfBirth().getYear() > 1997) { filteredList.add(p); } if (p.getAddress().getCity().equals(“Bangalore”)) { filteredList.add(p); } } return filterdList; } Public List<Person> selectTeenAgersFromBangalore (List<Person> input) { List filteredList = new ArrayList(); for (Person p : input) { if (isTeenAger(p) && isFromBangalore(p)) { filteredList.add(p); } } return filterdList; } Filtering logic moved out
22. Functions Slide All statements should be at same level of abstraction. Employee employee = employeeRepository.get(“m100XXXX”); employee.getSalaryDetails().setBasic( employee.getSalaryDetails().getBasic () * 1.10); employeeRepository.save(employee); Employee employee = employeeRepository.get(“m100XXXX”); raiseSalary(empoyee, “10%”); employeeRepository.save(employee); Functions should be read like top-down narrative. Every function should be followed by functions of next level of abstraction.
23. Functions Slide Have no side effects. Public boolean checkPassword(String userName, String password) { User user = userService.getUser(userName); if (user.password.equals(password)) { Session.initalize(); return true; } return false; }
24. Functions Slide Command query separation. Public boolean set(String attribute, String value) { … . } if (set(“color”, “red”)) { … . } if (attributeExists(“color”)) { }
28. Code which started well… Slide public class BookRental { String id; String customerName; ... } public class BookRentals { private Vector rentals; public String getCustomerName(String rentalId) { for (int i = 0; i < rentals.size(); i++) { BookRental rental = (BookRental) rentals.elementAt(i); if (rental.getId().equals(rentalId)) { return rental.getCustomerName(); } } throw new RentalNotFoundException(); } } public class RentalNotFoundException extends Exception { ... } Book Rentals Applications: Maintains a list of books rented to customers. New requirement: Add a method to delete rental given its id.
29. Code updated for new requirement… Slide public class BookRental { String id; String customerName; ... } public class BookRentals { private Vector rentals; public String getCustomerName(String rentalId) { for (int i = 0; i < rentals.size(); i++) { BookRental rental = (BookRental) rentals.elementAt(i); if (rental.getId().equals(rentalId)) { return rental.getCustomerName(); } } throw new RentalNotFoundException(); } public void deleteRental(String rentalId) { for (int i = 0; i < rentals.size(); i++) { BookRental rental = (BookRental) rentals.elementAt(i); if (rental.getId().equals(rentalId)) { rentals.remove(i); return; } } throw new RentalNotFoundException(); } } public class RentalNotFoundException extends Exception { ... } Duplicate Code
30. Duplicate code should be avoided Slide What’s wrong with duplicate code? If there is a bug in the code or code requires changes, then, one has to change it at multiple places. This is error-prone. public class BookRentals { private Vector rentals; public String getCustomerName(String rentalId) { int rentalIdx = getRentalIdxById(rentalId); return ((BookRental) rentals.elementAt(rentalIdx)).getCustomerName(); } public void deleteRental(String rentalId) { rentals.remove(getRentalIdxById(rentalId)); } private int getRentalIdxById(String rentalId) { for (int i = 0; i < rentals.size(); i++) { BookRental rental = (BookRental) rentals.elementAt(i); if (rental.getId().equals(rentalId)) { return i; } } throw new RentalNotFoundException(); } }
31. Removing duplicate code Slide Point out and remove duplicate code class Organization { String id; String eName; //English name String cName; //Chinese name String telCountryCode; String telAreaCode; String telLocalNumber; String faxCountryCode; String faxAreaCode; String faxLocalNumber; String contactPersonEFirstName; //First name and last name in English String contactPersonELastName; String contactPersonCFirstName; //First name and last name in Chinese String contactPersonCLastName; String contactPersonTelCountryCode; String contactPersonTelAreaCode; String contactPersonTelNumber; String contactPersonFaxCountryCode; String contactPersonFaxAreaCode; String contactPersonFaxLocalNumber; String contactPersonMobileCountryCode; String contactPersonMobileAreaCode; String contactPersonMobileLocalNumber; ... } Organization’s and Person’s Telephone number format is same Organization’s and Person’s names are stored in English and Chinese.
35. How to remove a long if-then-else-if Slide class Shape { } class Line extends Shape { Point startPoint; Point endPoint; } class Rectangle extends Shape { Point lowerLeftCorner; Point upperRightCorner; } class Circle extends Shape { Point center; int radius; } class CADApp { void drawShapes(Graphics graphics, Shape shapes[]) { for (int i = 0; i < shapes.length; i++) { if (shapes[i] instanceof Line) { Line line = (Line)shapes[i]; graphics.drawLine(line.getStartPoint(),line.getEndPoint()); } else if (shapes[i] instanceof Rectangle) { Rectangle rect = (Rectangle)shapes[i]; graphics.drawLine(...); graphics.drawLine(...); graphics.drawLine(...); graphics.drawLine(...); } else if (shapes[i] instanceof Circle) { Circle circle = (Circle)shapes[i]; graphics.drawCircle(circle.getCenter(), circle.getRadius()); } } } }
36. How to remove a long if-then-else-if Slide class CADApp { void drawShapes(Graphics graphics, Shape shapes[]) { for (int i = 0; i < shapes.length; i++) { if (shapes[i] instanceof Line) { draw the line } else if (shapes[i] instanceof Rectangle) { draw the rectangle } else if (shapes[i] instanceof Circle) { draw the circle } } } } To remove long if-else conditions, try to make the code identical in each of the if else blocks class CADApp { void drawShapes(Graphics graphics, Shape shapes[]) { for (int i = 0; i < shapes.length; i++) { if (shapes[i] instanceof Line) { draw the shape } else if (shapes[i] instanceof Rectangle) { draw the shape } else if (shapes[i] instanceof Circle) { draw the shape } } } } class CADApp { void drawShapes(Graphics graphics, Shape shapes[]) { for (int i = 0; i < shapes.length; i++) { draw the shape } } } class CADApp { void drawShapes(Graphics graphics, Shape shapes[]) { for (int i = 0; i < shapes.length; i++) { shapes[i].draw(graphics); } } }
37. How to remove a long if-then-else-if Slide abstract class Shape { abstract void draw(Graphics graphics); } class Line extends Shape { Point startPoint; Point endPoint; void draw(Graphics graphics) { graphics.drawLine(getStartPoint(), getEndPoint()); } } class Rectangle extends Shape { Point lowerLeftCorner; Point upperRightCorner; void draw(Graphics graphics) { graphics.drawLine(...); graphics.drawLine(...); graphics.drawLine(...); graphics.drawLine(...); } } class Circle extends Shape { Point center; int radius; void draw(Graphics graphics) { graphics.drawCircle(getCenter(), getRadius()); } } interface Shape { abstract void draw(Graphics graphics); } class Line implements Shape { … } class Rectangle implements Shape { … } class Circle implements Shape { … }
38. Improved Code Slide interface Shape { void draw(Graphics graphics); } class Line implements Shape { Point startPoint; Point endPoint; void draw(Graphics graphics) { graphics.drawLine(getStartPoint(), getEndPoint()); } } class Rectangle implements Shape { Point lowerLeftCorner; Point upperRightCorner; void draw(Graphics graphics) { graphics.drawLine(...); graphics.drawLine(...); graphics.drawLine(...); graphics.drawLine(...); } } class Circle implements Shape { Point center; int radius; void draw(Graphics graphics) { graphics.drawCircle(getCenter(), getRadius()); } } class CADApp { void drawShapes(Graphics graphics, Shape shapes[]) { for ( int i = 0; i < shapes.length; i++) { shapes[i].draw(graphics); } } } If we need to support one more shape (e.g., triangle), none of classes needs to change. All it takes is to create a new Triangle class.
39.
40. Original code Slide class UserAccount { final static int USERTYPE_NORMAL = 0; final static int USERTYPE_ADMIN = 1; final static int USERTYPE_GUEST = 2; int userType; String id; String name; String password; Date dateOfLastPasswdChange; public boolean checkPassword(String password) { ... } } class InventoryApp { int getPasswordMaxAgeInDays(UserAccount account) { switch (account.getType()) { case UserAccount.USERTYPE_NORMAL: return 90; case UserAccount.USERTYPE_ADMIN: return 30; case UserAccount.USERTYPE_GUEST: return Integer.MAX_VALUE; } } void printReport(UserAccount currentUser) { boolean canPrint; switch (currentUser.getType()) { case UserAccount.USERTYPE_NORMAL: canPrint = true; break; case UserAccount.USERTYPE_ADMIN: canPrint = true; break; case UserAccount.USERTYPE_GUEST: canPrint = false; } if (!canPrint) { throw new SecurityException("You have no right"); } //print the report. } } Issue is same as long if-then-else!
41. Use subclass to represent type code value Slide abstract class UserAccount { String id; String name; String password; Date dateOfLastPasswdChange; abstract int getPasswordMaxAgeInDays(); abstract boolean canPrintReport(); } class NormalUserAccount extends UserAccount { int getPasswordMaxAgeInDays() { return 90; } boolean canPrintReport() { return true; } } class AdminUserAccount extends UserAccount { int getPasswordMaxAgeInDays() { return 30; } boolean canPrintReport() { return true; } } class GuestUserAccount extends UserAccount { int getPasswordMaxAgeInDays() { return Integer.MAX_VALUE; } boolean canPrintReport() { return false; } } Subclasses differ in values they return.
42. Use an object to represent a type code value Slide class UserAccount { UserType userType; String id; String name; String password; Date dateOfLastPasswdChange; UserType getType() { return userType; } } class UserType { int passwordMaxAgeInDays; boolean allowedToPrintReport; UserType(int passwordMaxAgeInDays, boolean allowedToPrintReport) { this.passwordMaxAgeInDays = passwordMaxAgeInDays; this.allowedToPrintReport = allowedToPrintReport; } int getPasswordMaxAgeInDays() { return passwordMaxAgeInDays; } boolean canPrintReport() { return allowedToPrintReport; } static UserType normalUserType = new UserType(90, true); static UserType adminUserType = new UserType(30, true); static UserType guestUserType = new UserType(Integer.MAX_VALUE, false); } int getPasswordMaxAgeInDays(UserAccount account) { return account.getType().getPasswordMaxAgeInDays(); } void printReport(UserAccount currentUser) { boolean canPrint; canPrint = currentUser.getType().canPrintReport(); if (!canPrint) { throw new SecurityException("You have no right"); } //print the report. }
45. Example Slide A basket contains oranges and apples. Basket Apple Orange Fruits have cost Basket Apple Orange Fruit 1 * * int Price; 1 * Generalize to accommodate new requirements.
46. Example continued… Slide A user has password. Password can be encrypted and decrypted. User Password public String encrypt(); public String decrypt(); 1 1 String userid; Password is encrypted using a encryption service. User Password public String encrypt(); public String decrypt(); 1 1 String userid; EncryptionService public String encrypt(String); public String decrypt(String);
47.
48.
49. Make good use of polymorphism Slide In object oriented languages, power of polymorphism comes from Liskov’s substitution principle . “ A subclass can be used as an argument where a base class is expected” Class Mechanic { public void repair (Car car) { } } class HyundaiCar implements Car { } class MarutiCar implements Car { } class HyundaiSantro extends HyundaiCar { } HyundaiCar faultyHyundai = new HyundaiCar(); mechanic.repair (faultyHyunai); MarutiCar faultyMaruti = new MarutiCar(); mechanic.repair(faultyMaruti);
50. Program to interface, and put polymorphism to better use Slide Class Driver { public void drive (Car car) { } public void drive (Truck truck) { } } Class Driver { public void drive (Vehicle vehicle) { } }
51. Open-closed principle Slide if ( isGoingToMovie() ) { Vehicle vehicle = new Car(); driver.drive (vehicle ) } else ( ifRelocatingToNewHome () ) { Vehicle vehicle = new Truck(); driver.drive (vehicle ); } Vehicle vehicle = getVehicle(conditions); driver.drive (vehicle ); Class should be open for extension, but closed for modification.
58. Don’t live with broken windows The pragmatic programmer by Andrew Hunt, David Thomas Slide http://en.wikipedia.org/wiki/Fixing_Broken_Windows "Consider a building with a few broken windows. If the windows are not repaired, the tendency is for vandals to break a few more windows. Eventually, they may even break into the building, and if it's unoccupied, perhaps become squatters or light fires inside. Or consider a sidewalk. Some litter accumulates. Soon, more litter accumulates. Eventually, people even start leaving bags of trash from take-out restaurants there or breaking into cars." Psychology or culture at work is one of the factors that contribute to bad code. So, try to clean up every time you see a messy code. Broken Windows = Bad Design, Wrong decisions, Poor code
59. Knowledge Portfolio The pragmatic programmer by Andrew Hunt, David Thomas Slide An investment in knowledge always pays the best interest Benjamin Franklin, One of the Founding Fathers of the United States of America Invest regularly Diversify Manage risk Buy low, sell high Review and re-balance Learn at least one new language every year. Read a technical book each quarter. Read non-technical books too. Take classes. Participate in local user groups. Experiment with different environments. Stay current. Get wired. Building investment portfolio Building knowledge portfolio
60. Write programs for fellow humans Slide Any damn fool can write code that a computer can understand, the trick is to write code that humans can understand. Martin Fowler, Author of book “Refactoring” http://martinfowler.com/distributedComputing/refactoring.pdf
61. Books for someone aspiring to become a great (Java) programmer Slide
62.
63. Find a role model and follow them …read about what they are working on, what they consider exciting. Slide Rod Johnson, Founder of Spring Framework Douglas Crockford, Yahoo JavaScript Architect Yukihiro “Matz” Matsumoto , Creator of “Ruby” language David Heinemeier Hansson Creator of “Ruby on RAILS” framework Gavin King Creation of “Hibernate” Framework
64. Copyright notice For more information see http://creativecommons.org/licenses/by/3.0/