Modules Programming Guides.

Slides:



Advertisements
Similar presentations
Coding Practices. Why do we care? Good code is more than just functionality Other people will read your code You will forget what you code does Debugging.
Advertisements

Database Theory Why use database? Data is a valuable corporate resource which needs adequate accuracy, consistency and security controls. The centralized.
ICS312 Set 11 Introduction to Subroutines. All the combinations in which a subroutine can be written 1. The subroutine may be: a. Internal or b. External.
Introduction to PL/SQL Chapter 9. Objectives Explain the need for PL/SQL Explain the benefits of PL/SQL Identify the different types of PL/SQL blocks.
Using Data Active Server Pages Objectives In this chapter, you will: Learn about variables and constants Explore application and session variables Learn.
The LC-3 – Chapter 7 COMP 2620 Dr. James Money COMP
7 1 User-Defined Functions CGI/Perl Programming By Diane Zak.
PROGRAMMING IN VISUAL BASIC.NET VISUAL BASIC PROGRAMMING FUNDAMENTALS Bilal Munir Mughal 1 Chapter-8.
For Code Next For Code Next A loop is a segment of a code that repeats (changing slightly each time)
Photoshop Image Slicing. Reasons to Image Slide To create links out of sliced images To optimise different areas. (flat areas of colour, such as logos,
Modularity Computer Science 3. What is Modularity? Computer systems are organized into components called modules. The extent to which this is done is.
Separate Compilation Bryce Boe 2013/10/09 CS24, Fall 2013.
1 GLOBAL BIOMETRICS Biostatistics Clinical Data Management Epidemiology & Patient Reported Outcomes Statistical Programming and Analysis Strategic Planning,
Get Going with External Storage Devices. Focusing Questions What is an external storage device? What does it do? What are some examples of external storage.
Creating and Using Modules Sec 9-6 Web Design. Objectives The student will: Know how to create and save a module in Python Know how to include your modules.
Today… Modularity, or Writing Functions. Winter 2016CISC101 - Prof. McLeod1.
Mr H Kandjimi 2016/01/03Mr Kandjimi1 Week 3 –Modularity in C++
A Practical Approach to Version Control for SQL Server Steve Jones SQLServerCentral Redgate Software.
Written by : Oren Frenkel Intel Confidential ® C CD SDS.
A Method for Improving Code Reuse System Prasanthi.S.
e-invoice guide for suppliers
eHealth Standards and Profiles in Action for Europe and Beyond
Data Virtualization Tutorial: Custom Functions
PENN WOOD MIDDLE SCHOOL presents THE DIFFERENT TYPES OF ENERGY SOURCES
Chapter 7: Function.
Data Virtualization Tutorial: Introduction to SQL Script
Introduction The Custom Store Groups folders and functions allows you to create, modify and use store accounts of specific interest to you or your team.
Lesson Objectives Aims You should be able to:
C Programming Lecture-1 Overview and Environment Setup
Coupling and Cohesion 1.
Matlab Training Session 4: Control, Flow and Functions
SHARED MEMORY PROGRAMMING WITH OpenMP
Haleh Kootval, Samuel Muchemi Public Weather Services Programme
Computer Graphics Index Buffers
Electronic Records Management Program
Distribution and components
Variables, Expressions, and IO
Faraday micro:bit challenge
Week 4 Object-Oriented Programming (1): Inheritance
CS1061 C Prgramming Lecture 11: Functions
Functions.
GemBox.Presentation GemBox.Presentation is a.NET component which enables developers to read and write presentation files from.NET applications in a simple.
Learning to Program in Python
Machine Independent Features
High Level Commitments
MSIS 670 Object-Oriented Software Engineering
Getting Started with Scratch
File IO and Strings CIS 40 – Introduction to Programming in Python
Lesson Objectives Aims Key Words
Functions In Matlab.
This presentation document has been prepared by Vault Intelligence Limited (“Vault") and is intended for off line demonstration, presentation and educational.
Data Structures – 2D Lists
Libraries of Code Notes from Wilson, Software Design and Development Preliminary Course pp
Programming Fundamentals Lecture #3 Overview of Computer Programming
Variable Length Data and Records
Functions Christopher Harrison | Content Developer
Basics (Cont...).
Analytics for tracking student engagement
CPS120: Introduction to Computer Science
Announcements Nate’s office hours Card key problems?
CSCI N207 Data Analysis Using Spreadsheet
A function is a group of statements that exist within a program for the purpose of performing a specific task. We can use functions to divide and conquer.
CSCI N207 Data Analysis Using Spreadsheet
Functions.
Process & Methodology Creating a scalable business through efficient, effective delivery with repeatable quality. MODULE 7.
Getting Started with Scratch
TEAM NAME MEMBER 1 MEMBER 2 MEMBER 3 MEMBER 4
Attractive Don’tPayAll Discount Codes Enable Good Savings.
Optimzing the Use of Data Standards Calling for Volunteers
Selamat Datang di “Programming Essentials in Python”
Presentation transcript:

Modules Programming Guides

Modules Modules As we have already seen, we can use functions in our programs to avoid repeating blocks of code. We can pass values into functions and return the result enabling the reuse of code which is a much more efficient way of coding. But wouldn’t it be better to store functions away from the main program so that other programs can make use of them? This is where modules can make things even more efficient!

Modules Modules and their Benefits! 1 Main Program 2 Main Program 1 Function 1 Function 2 Function 3 Main Program 2 Function 1 Function 2 Function 3 Main Program 1 Main Program 2 The first example demonstrates that having functions in the same script as the main program means that only the main program can have access to them. The second example demonstrates that if functions were stored in a separate script (a module), two separate programs could import them and make use of them. Thus reducing the need to duplicate code.

Modules Modules and their Benefits! And there are further benefits. As modules are separate files, a team can work on a project, together, at the same time. Also, modules can be shared across the programming community to help with efficiency and reduce the need to ‘reinvent the wheel’.

e.g.: module_name.function_name() Modules So how do we create a module and make use of it’s functions? We create separate modules with functions written in them and ensure they are saved in the same location as our main program script. We then import these modules in our main program by typing ‘import’ followed by the module name. Then we simply use the functions like we would it they were in our main program file, except that we prefix the function name with the module name. e.g.: module_name.function_name()