Skip to Content
Computer Programming for Absolute Beginners
book

Computer Programming for Absolute Beginners

by Joakim Wassberg
July 2020
Beginner
430 pages
9h 3m
English
Packt Publishing
Content preview from Computer Programming for Absolute Beginners

Chapter 8: Understanding Functions

There are a number of useful concepts that we, as programmers, always should follow. One is to write code that is easy to read and understand. Another is to avoid duplicating code. When you start out your career as a programmer, you will find yourself copying and pasting code and just changing some small things here and there. This is a bad habit as it nullifies the first concept of code that is easy to read because reading more or less the same lines over and over is tedious and it is hard to spot the tiny differences.

A better solution is to package code that we want to reuse several times into a function. A function is a way for us to give a name to a block of code and then, with this name, the code block ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming Languages: Concepts and Implementation

Programming Languages: Concepts and Implementation

Saverio Perugini
Computer Programming and IT

Computer Programming and IT

ITL Education Solutions Limited, Ashok N. Kamthane, Raj Kamal

Publisher Resources

ISBN: 9781839216862