IFB104 – Building IT Systems

IFB104 Code Presentation Guide

Overview

Writing computer program, scripting or mark-up language code is no different from any other style of writing. Its purpose is to communicate concisely and clearly. Any computer language document must communicate effectively in two ways:

  • Telling the computer what to do. The “executable” part of the program, script or mark-up tells the computer what actions you want performed. We know if this has been done properly if the document gets the computer to do or display what we intended.
  • Informing other programmers. These may be your immediate colleagues if you’re working in a team or someone else who reads your code many months or years from now, perhaps with the intention of modifying or extending your code’s behaviour.

Our concern here is with the second of these. Part of the profession of “building IT systems” is to create a well-presented computer language document. Over the years, programmers have developed style guides and conventions for most pro- gramming, scripting and mark-up languages, and you will be able to find many of these online. For the purposes of IFB104, however, we do not want to be too pre- scriptive. Our main goal is that you follow a consistent style that meets the criteria listed below. The examples below are for Python program code, but the same prin- ciples should be applied to any other code you write, including SQLite scripts and HTML/CSS documents.

General Principles

As a general guide, consider that whether you’re writing a text message, a novel, a technical report or a computer program, there is one rule that always applies:

Whatever is quick and convenient for the author is slow and awkward for the reader.

For instance, frequent use of abbreviations allows you to type quickly, but makes your writing harder to understand. Studies have shown that even expert “texters” are slower to read and comprehend heavily-abbreviated SMS messages than the equivalent English text.

Another important rule, highly relevant to long-lived computer programs that are often modified during their lifetime, is:

Code is written once but read many times.

This means that any extra effort expended during writing will be paid back to us lat- er on.

While these principles are mainly relevant to large-scale software development (ra- ther than small university assignments) our goal is to get you into the habit of think- ing about your code’s presentation at an early stage.

Code Presentation Criteria

You should think of your code’s presentation in terms of the following criteria.

1.   Clear, uncluttered layout

Your code should be laid out neatly and consistently. To a large extent Python pro- grammers are forced to adopt a particular layout because indentation is significant in the language. Nevertheless you should give thought to choices of vertical white space, line breaks and commenting. Many people frown upon overly wide lines, which inhibit readability and make it necessary to scroll back and forth horizontally. In general lines should not be wider than about 80 characters. (You can see the cur- rent column number in the bottom of IDLE’s editing window.)

Consideration should also be given to consistent horizontal spacing, in order to avoid cluttered code and improve its readability. Always put a space after a comma, and surround operators with spaces, e.g., “7 * 9 != 9 + 7”, rather than “7*9!=9+7”. However, don’t include a space between a function/method name and the opening parenthesis.

Lines of related code should be blocked together to improve readability. Blocks can be formed simply by adding appropriate line breaks.

2.   Meaningful choices of variable and function identifiers

You usually have a free choice of variable and function names in your code. You should make good use of this to explain the purpose of the variable or function, i.e., its role in the computation.  Consider the following code segment.

def a(b):

x = len(b) // 2 y = b[:x]

z = b[x:]

return [y, z]

This code is hard to understand because none of the identifiers explain the func- tion’s or the variables’ purposes.

Now consider exactly the same code with well-chosen identifiers.

def split_in_half(text): midpoint = len(text) // 2 first_half = text[:midpoint]

second_half = text[midpoint:]

return [first_half, second_half]

Even without comments this code is now easy to understand. We can see from the function signature that its purpose is to split some text in half. The role of each vari- able is made clear by its name, e.g., the first one finds the midpoint of the given text, and so on. Choosing sensible variable and function names has a dramatic impact on the understandability of your code.

Avoid the use of abbreviations when it comes to variables and function names.

Function/method names should be verbs, or ‘doing’ words which reflect the pur- pose of the function/method. Variable names should reflect the value/s intended to be stored in them.

IMPORTANT NOTE: Some old-fashioned programming languages, and even text- books, encourage the use of single-character identifiers, especially for loop varia- bles, typically ‘i’, ‘j’, ‘k’ and so on. These languages usually do not offer Python’s ability to iterate over all values in a sequence (e.g., a list or string). Thus, where in Python we would write

for letter in word:

print(letter)

to print each letter in a given string, each on one line, older languages force the pro- grammer to introduce an “index” variable and express this computation in a form equivalent to:

for i in range(len(word)): print(word[i])

Notice how much more obscure the second version is. The index variable is unnec- essary and the meaningless choice of identifier ‘i’ is unhelpful. In Python each vari- able introduced has a specific purpose and should be given a name describing the values it contains. Code like the second for loop above, containing unneces- sary, single-character loop variable names, should be avoided.

3.   Concise, helpful commenting

Your program code should be commented to explain features that are not obvious from the code itself. In particular, you can assume that the reader can understand what the code does by inspecting it, but will not necessarily understand why. Your comments should thus explain the purpose of obscure code segments. However, you should not clutter the code with comments that add no helpful information for the reader.

For instance, the following comment is useless and should not be included, because it does not tell us anything we can’t see from the code itself.

amount = amount + 1 # add one to amount

On the other hand, the comment below (taken from one of the IFB104 lecture demonstrations) makes the purpose of the following statements clearer than just the code itself.

# Draw the middle circle penup()

home() pendown() color(“orange”)

dot(middle_radius * 2)

The comment in this case tells us what the code does (but how the code does this job can be seen from the code itself and needs little or no commenting).

A comment should precede (i.e., come before) the relevant code block and be in- dented to the same level as the code to which it refers.

4.   No magic numbers

A “magic number” is a constant in your code whose purpose and choice of value is not immediately apparent. Although the term is normally applied to numerical val- ues, it is equally applicable to any literal value, regardless of its type. Magic num- bers make code harder to understand. They also make code harder to maintain be- cause if the number appears in several places, and we want to change it, then we have to search the code for all of its occurrences.

We can eliminate magic numbers in either of two ways:

  • By explaining the number’s purpose in a comment where it appears.
    • By giving the number a meaningful name.

The first of these is acceptable if the number only appears in a few places in the code. However, if the number is used in several places it is better to name it, be- cause this means only one code change is needed to modify the number.

For example, the following code segment is obscure due to the use of a poor variable name, no commenting and the unexplained magic number ‘7’.

x = (x + 1) % 7

The following version is longer but much clearer.

days_in_week = 7 # days are numbered from 0 to 6

day = (day + 1) % days_in_week # advance to next day

(Observation: Should the ‘1’ in the ‘day’ example above or the ‘2’ in the ‘circle’ ex- ample previously shown be considered as magic numbers? Arguably not because their purpose is very obvious in both cases. The number 1 is clearly being used to

increment variable day and the number 2 is clearly being used to double a radius to produce a diameter. It would clutter the code to give special names to these ‘obvi- ous’ uses. However, if in doubt, it never hurts to add a brief comment. Also, we ac- cept that it’s very difficult to write Turtle graphics code without using a lot of specif- ic numbers for coordinates and distances, so these “magic” numbers are usually ac- ceptable since these numbers are used once only and for a clear purpose, e.g., to go to a specific location on screen.)

5.   No unnecessary duplication of code segments

You should aim to develop as concise a solution as possible.   For instance, we learn in this teaching unit how functions allow us to reuse code segments that would oth- erwise appear more than once in your program. You should aim to use them to eliminate duplicated code wherever possible. Similarly, loops should be used rather then repeating similar code many times.

6.   Correct grammar and spelling

You should present your computer language code as professionally as you would any other document that will be seen by your colleagues. Code that contains spelling and grammatical errors in either the variable/function names or the com- ments gives a poor impression.

Order Now

Get expert help for IFB104 – Building IT Systems and many more. 24X7 help, plag free solution. Order online now!

Universal Assignment (October 3, 2022) IFB104 – Building IT Systems. Retrieved from https://universalassignment.com/ifb104-building-it-systems/.
"IFB104 – Building IT Systems." Universal Assignment - October 3, 2022, https://universalassignment.com/ifb104-building-it-systems/
Universal Assignment September 11, 2022 IFB104 – Building IT Systems., viewed October 3, 2022,<https://universalassignment.com/ifb104-building-it-systems/>
Universal Assignment - IFB104 – Building IT Systems. [Internet]. [Accessed October 3, 2022]. Available from: https://universalassignment.com/ifb104-building-it-systems/
"IFB104 – Building IT Systems." Universal Assignment - Accessed October 3, 2022. https://universalassignment.com/ifb104-building-it-systems/
"IFB104 – Building IT Systems." Universal Assignment [Online]. Available: https://universalassignment.com/ifb104-building-it-systems/. [Accessed: October 3, 2022]

Please note along with our service, we will provide you with the following deliverables:

Please do not hesitate to put forward any queries regarding the service provision.

We look forward to having you on board with us.

Get 45%* OFF on Assignment Help

Most Frequent Questions & Answers

Universal Assignment Services is the best place to get help in your all kind of assignment help. We have 172+ experts available, who can help you to get HD+ grades. We also provide Free Plag report, Free Revisions at a Pocket Friendly cost, We offer Best Price in the industry guaranteed.

We provide all kinds of assignmednt help, Report writing, Essay Writing, Dissertations, Thesis writing, Research Proposal, Research Report, Home work help, Question Answers help, Case studies, mathematical and Statistical tasks, Website development, Android application, Resume/CV writing, SOP(Statement of Purpose) Writing, Blog/Article, Poster making and so on.

We are available round the clock, 24X7, 365 days. You can appach us to our Whatsapp number +1 (613)778 8542 or email to info@universalassignment.com . We provide Free revision policy, if you need and revisions to be done on the task, we will do the same for you as soon as possible.

We provide services mainly to all major institutes and Universities in Australia, Canada, China, Malaysia, India, South Africa, New Zealand, Singapore, the United Arab Emirates, the United Kingdom, and the United States.

We provide lucrative discounts from 28% to 70% as per the wordcount, Technicality, Deadline and the number of your previous assignments done with us.

After your assignment request our team will check and update you the best suitable service for you alongwith the charges for the task. After confirmation and payment team will start the work and provide the task as per the deadline.

Yes, we will provide Plagirism free task and a free turnitin report along with the task without any extra cost.

No, if the main requirement is same, you don’t have to pay any additional amount. But it there is a additional requirement, then you have to pay the balance amount in order to get the revised solution.

The Fees are as minimum as $10 per page(1 page=250 words) and in case of a big task, we provide huge discounts.

We accept all the major Credit and Debit Cards for the payment. We do accept Paypal also.

Popular Assignments

Plant Production System Assignment Help

The Best Instant Academic Assistance Online Instant Plant Production System Assignment Help for Students Plant production system assignment help students help them understand the various theoretical and practical aspects of the subject. It is an intensive study of the scientific methods of plant production for an effective and economized production

Read More »

Integrated Science Assignment Help to Boost your Grades Immediately

Integrated Science Assignment Help for Students Integrated Science is taught from a high-school level. This consists of an investigative study of physics, chemistry, biology, forensic science, biotechnology, and geology. This is a course that introduces young students to the interconnectedness between all the scientific knowledge. Students require integrated science assignment

Read More »

Top Human Biology Assignment Help from Experts

Ask an Expert for top Human Biology Assignment Help Sometimes, expert guidance with Human Biology assignment help is all you need in order to boost your grades. Universal Assignment Help Service is a top-ranking student-help platform that offers a wide range of services for students. Students can order human biology

Read More »

Aviation Assignment Help from Experts

The Most Trusted Guidance for Students Aviation Assignment Help for All Challenging Problems Aviation assignment help online from the greatest experts can relieve student pressure to a great extent. It is well known that aviation is an extremely challenging stream, as it is, and students have to keep too many

Read More »

Growing demand for Assignment Help in Ireland

The number of multinational corporations choosing Ireland as their regional headquarters is increasing. So more and more students are choosing Ireland as an idle place to take their degrees. But studying in universities and keeping up the pace is not an easy task and getting good marks is not enough

Read More »

Board appraisal report

Weight: 40% Format: 2,000-word written report. Note: All written assessments should be submitted as Word files (.docx) (Word is available from your AIB Office 365 account) Summary Write a 2000-word Board Appraisal Report where you will evaluate an organisation’s corporate governance practices, board structure including committees and board diversity against

Read More »

49102: Traffic and Transportation

Assignment 2: Transport Modelling and Operations Due: 7 October 2022 This is an individual assignment Please answer the following questions and present your work in a report format clearly including your name and student ID on the cover page. Submit a PDF of your report into the Assignment Activity shown

Read More »

ENV3105 Hydrology Assignment 2

Assignment 2 Due date:       04 October 2022 Weighting:   25% (250 marks) 1. Overview This assessment is designed to test your achievement of selected learning objectives of Modules 6 to 9. In particular, the assignment involves estimation of urban design discharges, reservoir routing and water balance. It is intended to reinforce and

Read More »

Assessment 1: The Journal of Biological Chemistry

Guide abstract All cells within the body are bathed in a fluid. The composition of this fluid is tightly regulated to contain specific levels of various ions. Disruption in the balance of these ions can lead to cell death and damaging inflammation. However, standard surgical practice fails to consider these

Read More »

Project 2: Assignment on Scheme

Due: Oct 1, before midnight. This document first provides the aims of this project. It then lists the requirements as explicitly as possible. It then hints at how these requirements can be met. Finally, it describes how it can be submitted. Aims The aims of this project are as follows:

Read More »

Analysis of Rube Goldberg machine

Week 5 homework for tutorial  In week 4 we needed to also look at how many failures we could have to meet our six sigma level – we will also need to look at this for the times for each stage and total time. To effectively put the flame out

Read More »

PROCESS AND PHILOSOPHY OF ENGINEERING

ASSESSMENT BRIEF 3: Calculations Summary Title Calculations Due Date Monday the 3rd of October at 11:59 (NSW) AEST – End of Week 5 Length 1000-word (does not include equations, charts, graphs or tables) Weighting  35% Submission  WORD document submitted to Turnitin Unit Learning Outcomes  ULO 3: apply basic statistical analysis

Read More »

THT3114 Research Proposal

Mini Report Assignment 2 Executive Summary (100- 150 words) This is the summary of your research and thus needs to be completed after you have completed writing your research proposal. This is not counted towards the word count. Mention the key aspects of the research proposal. Separate paragraphs Area of

Read More »

LITERATURE REVIEW – DATA MINING TO RESEARCH PROPOSAL

ASSESSMENT TWO: LITERATURE REVIEW – DATA MINING TO RESEARCH PROPOSAL – DESIGN RESEARCH INSTRUMENT – PRESENTATION) Task Length: Mini Report (750 words) – Research Proposal) Presentation – Not more than 15 Slides –  (Templates Provided for both the mini report and presentation)  Duration of the Video Presentation – Not more

Read More »

Assignment on COVID-19 pandemic in the hospitality industry

Exploring the new health and safety innovative business practice to restore consumer confidence in the COVID-19 pandemic in the hospitality industry Task Length: Report – 2000 words (+-10%) Task Type Individual Due week and submission deadline Week 11 – SUNDAY – 02/10/2022 – 23:59 Value 40%   PART A: On

Read More »

Assignment Help in Israel

Leading assignments help in Israel Israel is known for its high-tech development, innovations, and entrepreneurship, and is home to the best start-ups in the world. Students from all over the world are drawn to this ecosystem of “innovation and development,” which is supported by a robust higher education system with

Read More »

Animal Production System Assignment Help

Animal Production System Assignment Help: Get 100% guaranteed Expert Assistance Immediately Where can you find the best Animal Production System Assignment Help Online?  Animal Production System assignment help online can boost student results while encouraging interest in the field. The hectic schedule of students, along with their burden of various

Read More »

Immediate Calculus Assignment Help from Top Experts

Immediate Calculus Assignment Help from Top Experts Calculus Assignment Help to Boost your Grades Students can now order instant Calculus assignment help on Universal Assignment Help Service in a fast and easy way. Calculus in taught at a slightly advanced stage of school, and can be an exciting subject in

Read More »

Mathematics Foundation Assignment Help

Effective Mathematics Foundation Assignment Help for Students: Order Expert Solutions Immediately Mathematics Foundation Assignment Help for Students Students often require mathematics foundation assignment help for clearing doubts, understanding the derivation of a formula or theorem, or getting urgent solutions to certain mathematical problems. Online mathematics foundation assignment help is extremely

Read More »

Mathematics Application Assignment Help

Top for Students: Order Expert Solutions Immediately for the Best Results Why do students need Mathematics Application Assignment Help? Mathematics Application assignment help can lead students to perform excellently in the subject in a convenient and relaxed way. Many students find it difficult to apply theoretical knowledge in large and

Read More »

The finest assignment helps in Saudi Arabia

Many students dream to study in Saudi Arabia as they offer some of the best facilities, and they boast one of the most spectacular and rapidly expanding higher education systems in the Middle East. So, this should be of no surprise that every year, many international students prefer to register

Read More »

Expert Solutions for the Best Arithmetic Assignment Help Online

Instant Arithmetic Assignment Help for Students Students most often require Arithmetic assignment help online to solve various calculations. Universal Assignment Help Service provides the best solutions to all arithmetic problems for each student. Students simply have to upload their assignment guidelines on their website, and a customized and accurate assignment

Read More »

Assignment help in Cameroon

The Necessity of Assignment help in Cameroon Today management degrees are one of the most prestigious degrees out there and gaining immense popularity, this degree has the most demand in the market as new startups are emerging day by day, and every company needs the best people to run their

Read More »

Assignment Help in South Korea

Difference between a Good vs Great Online Assignment Tutor The e-learning market is growing at a fast rate due to digitalization. This fact causes an increment in the demand for online tutors as students worldwide searches for a suitable solution for online assignment help in South Korea. You might hear

Read More »

Assignment Help in Japan

Outside-The-Classroom Learning Opportunities It is a typical thinking lesson that stands inside the four walls of a classroom. Some educators say the classroom is the abode of learning and knowledge. We cannot prove these statements wrong. However, one thing is certain: they are partially correct. Learning of concepts starts in

Read More »

Assignment Help in Brazil

Why do Students Consider Online Assignment Help in 2022? Academic life is full of ups and downs. Students who experience such a phase struggle to maintain the equilibrium between personal and professional life. It is because of the load of homework, exams, and participation in extracurricular activities. These events cause

Read More »

Assignment Help in Taiwan

What are the Necessities of Assignment Guidance for Students? As technology takes a new turn around, homework assignments become lengthy and complex. This academic work needs lots of core subject knowledge along with proper research to finish it with proper care. Such work is very time-consuming and hectic for the

Read More »

Assignment Help in Hong Kong

Can You Achieve High Academic Results? Every student wishes to get top scores in their exams. Yet it does not happen if you do not get the correct assignment help in Hong Kong from an online tutor. Such support is in the form of tips, advice, hacks, or taking guidance,

Read More »

VU22977 – Practice in a Legal Environment

Advanced Diploma of Legal Practice – 22565VIC PORTFOLIO- CLIENT MATTER FILE Assessment task 1 Prepare a comprehensive portfolio of documents to create a Client Matter File which must include: Element 1 Area of law Cover sheet stating client name and short description of legal matter Client Instruction Sheet, Costs Agreement

Read More »

KIT714 ICT Research Principles: Assignment 1

Practical Qualitative Research Exercise                                                                                                                                         Type:                 In-Semester, Individual Assignment Task Length:   minimum 2,000 words Weighting:     20% of total assessment for this unit Due Date:       Friday 5 August 2022 – 11:55 pm (Week05) Submission:    electronic submission on MyLO (WORD or PDF) Description:    This practical exercise will engage students in a qualitative research

Read More »

Can't Find Your Assignment?

Get Free Assignment

Open chat
1
Free Assistance
Universal Assignment
Hello 👋
How can we help you?