Coding For Beginners Over 450 Tips & Hints Inside techgo Step-by-step Tutorials Clear Full Colour Guides Jargon-free Tips & Advice Discover more of our guides... Photoshop For Beginners Over 437 Tips & Hints Inside techgo Step-by-step Tutorials Clear Full Colour Guides Jargon-free Tips & Advice Android For Beginners Over 426 Tips & Hints Inside techgo Step-by-step Tutorials Clear Full Colour Guides Jargon-free Tips & Advice Mac For Beginners Over 459 Tips & Hints Inside techgo Step-by-step Tutorials Clear Full Colour Guides Jargon-free Tips & Advice Black & White Photography For Beginners techgo Step-by-step Tutorials Clear Full Colour Guides Jargon-free Tips & Advice Over 445 Tips & Hints Inside Cloud Computing For Beginners Over 453 Tips & Hints Inside techgo Step-by-step Tutorials Clear Full Colour Guides Jargon-free Tips & Advice Python For Beginners Over 435 Tips & Hints Inside techgo Step-by-step Tutorials Clear Full Colour Guides Jargon-free Tips & Advice Coding For Beginners Over 450 Tips & Hints Inside techgo Step-by-step Tutorials Clear Full Colour Guides Jargon-free Tips & Advice C++ & Python For Beginners Over 446 Tips & Hints Inside techgo Step-by-step Tutorials Clear Full Colour Guides Jargon-free Tips & Advice Photography For Beginners Over 435 Tips & Hints Inside techgo Step-by-step Tutorials Clear Full Colour Guides Jargon-free Tips & Advice FRITZ!Box For Beginners Over 430 Tips & Hints Inside techgo Step-by-step Tutorials Clear Full Colour Guides Jargon-free Tips & Advice Google For Beginners BDM’s Made Easy Series The Complete Guidebook Volume 19 Learn how to master Google’s unmissable free apps Enhance & protect your privacy Get the best applications for free Discover apps for work & play Keep your photos & docs safe NEW! | Gmail | Drive | Chrome | Maps | Play BDM’s Made Easy Series Over 827 hints & tips inside £9.99 Volume 19 US$19.99 Can$19.99 Aus$17.99 NZ$18.99 100% Independent Over 449 Tips & Hints Inside techgo Step-by-step Tutorials Clear Full Colour Guides Jargon-free Tips & Advice GoPro For Beginners Over 430 Tips & Hints Inside techgo Step-by-step Tutorials Clear Full Colour Guides Jargon-free Tips & Advice Instagram For Beginners Over 448 Tips & Hints Inside techgo Step-by-step Tutorials Clear Full Colour Guides Jargon-free Tips & Advice iPhone For Beginners Over 448 Tips & Hints Inside techgo Step-by-step Tutorials Clear Full Colour Guides Jargon-free Tips & Advice iPad For Beginners Over 440 Tips & Hints Inside techgo Step-by-step Tutorials Clear Full Colour Guides Jargon-free Tips & Advice Landscape Photography For Beginners Over 455 Tips & Hints Inside techgo Step-by-step Tutorials Clear Full Colour Guides Jargon-free Tips & Advice Starting something new can be daunting. Learning a skill or mastering a new piece of hardware is tough. Even tougher if you have no-one at hand to help. Conversely as the complexity of our consumer technology increases, the size of the requisite instruction manual decreases or in some cases it simply disappears. At numerous times in our lives we have all been “beginners”, there is no shame in that fact and rightly so. How many times have you asked aloud, “What does this button do?”. “Why doesn’t that work?”. “What do you mean it doesn’t do that?”. “HELP!”. At the start of any new journey or adventure we are all beginners but fortunately for you we are here to stand beside you at every stage. Over this extensive series of titles we will be looking in great depth at the latest consumer electronics, software, hobbies and trends out of the box! We will guide you step-by-step through using all aspects of the technology that you may have been previously apprehensive at attempting. Let our expert guide help you build your technology understanding and skills, taking you from a novice to a confident and experienced user. Over the page our journey begins. We would wish you luck but we’re sure with our support you won’t need it. techgo Coding For Beginners 36 Equipment You Will Need 38 Getting to Know C++ 40 How to Set Up C++ in Windows 42 How to Set Up C++ on a Mac 44 How to Set Up C++ in Linux 46 Other C++ IDEs to Install 8 Choosing a Programming Language 10 Learning to Code – Study Tips 12 Coding Tools and Resources 14 Being a Programmer 18 Why Python? 20 Equipment You Will Need 22 Getting to Know Python 24 How to Set Up Python in Windows 26 How to Set Up Python on a Mac 28 How to Set Up Python in Linux 30 Installing a Text Editor 34 Why C++? Contents www.bdmpublications.com 4 6 Coding and Programming 16 Say Hello to Python 32 Say Hello to C++ 48 Coding on Linux 50 Why Linux? 52 Equipment You Will Need 54 Transfer Mint to DVD or USB 56 Installing VirtualBox 58 Testing Linux Mint’s Live Environment 60 Installing Linux Mint on a PC 62 Installing Linux Mint in VirtualBox 64 Getting Ready to Code in Linux 66 Creating Bash Scripts– Part 1 68 Creating Bash Scripts– Part 2 Contents www.bdmpublications.com 5 70 Creating Bash Scripts– Part 3 72 Creating Bash Scripts– Part 4 74 Creating Bash Scripts– Part 5 76 Command Line Quick Reference 78 A-Z of Linux Commands BDM Publications www.bdmpublications.com @bdmpubs © 2020 Papercut Limited All rights reserved. No part of this publication may be reproduced in any form, stored in a retrieval system or integrated into any other publication, database or commercial programs without the express written permission of the publisher. Under no circumstances should this publication and its contents be resold, loaned out or used in any form by way of trade without the publisher’s written permission. While we pride ourselves on the quality of the information we provide, Papercut Limited reserves the right not to be held responsible for any mistakes or inaccuracies found within the text of this publication. Due to the nature of the tech industry, the publisher cannot guarantee that all apps and software will work on every version of device. It remains the purchaser’s sole responsibility to determine the suitability of this book and its content for whatever purpose. Any app images reproduced on the front and back cover are solely for design purposes and are not representative of content. We advise all potential buyers to check listing prior to purchase for confirmation of actual content. All editorial opinion herein is that of the reviewer - as an individual - and is not representative of the publisher or any of its affiliates. Therefore the publisher holds no responsibility in regard to editorial opinion and content. This is an independent publication and as such does not necessarily reflect the views or opinions of the producers of apps or products contained within. This publication is 100% unofficial. All copyrights, trademarks and registered trademarks for the respective companies are acknowledged. Relevant graphic imagery reproduced with courtesy of brands and products. Additional images contained within this publication are reproduced under licence from Shutterstock. Prices, international availability, ratings, titles and content are subject to change. All information was correct at time of publication. Some content may have been previously published in other volumes or titles. Papercut Limited Registered in England & Wales No: 4308513 Coding For Beginners 4th Edition ISBN: 978-1-912847-12-9 Published by: Papercut Limited Digital distribution by: Readly AB, Zinio, Magzter, Cafeyn, PocketMags “…learning how to code is an on-going experience, where you learn something new every day and every time you run your code…” BDM’s Code Portal 60+ Python programs 21,500+ lines of code Master Python with the help of our fantastic Code Portal, featuring code for games, tools and more. Visit: https://bdmpublications.com/ code-portal, and log in to get access! Coding and Programming 6 www.bdmpublications.com Coding and Programming www.bdmpublications.com 7 So you want to start coding? It’s not going to be an easy road, and there are many pitfalls along the way, but learning to program is an amazing skill and one that will stand you in good stead for the future. One of the hardest steps in learning to code is the first: which programming language to learn. Then, where do you go to find the tools you need and what do all those terms mean? Don’t worry, we’re here to help you on your way. In this section we look at what you need to take those first tentative steps into the world of coding. Coding and Programming Coding and Programming 8 Choosing a Programming Language It would be impossible to properly explain every programming language in a single book of this size. New languages and ways in which to ‘talk’ to a computer or device and set it instructions are being invented almost daily; and with the onset of quantum computing, even more complex methods are being born. Here is a list of the more common languages along with their key features. www.bdmpublications.com www.bdmpublications.com 8 9 Choosing a Programming Language SQL stands for Structured Query Language. SQL is a standard language for accessing and manipulating databases. Although SQL is an ANSI (American National Standards Institute) standard, there are different versions of the SQL language. However, to be compliant, they all support at least the major commands such as Select, Update and Delete in a similar manner. SQL JavaScript (often shortened to JS) is a lightweight, interpreted, object-oriented language with first class functions. JavaScript runs on the client side of the web, that can be used to design or program how the web pages behave on the occurrence of an event. JavaScript is an easy to learn and also powerful scripting language, widely used for controlling web page behaviour. JAVASCRIPT Java is the foundation for virtually every type of networked application and is the global standard for developing enterprise software, web-based content, games and mobile apps. The two main components of the Java platform are the Java Application Programming Interface (API) and the Java Virtual Machine (JVM) that translates Java code into machine language. JAVA C# is an elegant object-oriented language that enables developers to build a variety of secure and robust applications that run on the .NET Framework. You can use C# to create Windows client applications, XML Web services, client server applications, database applications and much more. The curly-brace syntax of C# will be instantly recognisable to anyone familiar with C, C++ or Java. C# Python is a widely used high level programming language used for general purpose programming, created by Guido van Rossum and first released in 1991. An interpreted language, Python has a design philosophy that emphasises code readability and a syntax that allows programmers to express concepts in fewer lines of code. This can make it easier for new programmers to learn. PYTHON C++ (pronounced cee plus plus) is a general purpose programming language. It has imperative, object-oriented and generic programming features. It was designed with a bias toward system programming and embedded, resource-constrained and large systems, with performance, efficiency and flexibility of use as its design highlights. C++ Ruby is a language of careful balance. Its creator, Yukihiro “Matz” Matsumoto, blended parts of his favourite languages (Perl, Smalltalk, Eiffel, Ada and Lisp) to form a new language. From its release in 1995, Ruby has drawn devoted coders worldwide. Ruby is seen as a flexible language; essential parts of Ruby can be removed or redefined, at will. Existing parts can be added to. RUBY Perl is a general purpose programming language, used for a wide range of tasks including system administration, web development, network programming, GUI development and more. Its major features are that it’s easy to use, supports both procedural and object-oriented (OO) programming, has powerful built-in support for text processing and has one of the most impressive collections of third-party modules. PERL Swift is a powerful and intuitive programming language for macOS, iOS, watchOS and tvOS. Writing Swift code is interactive and fun; the syntax is concise yet expressive and Swift includes modern features that developers love. Swift code is safe by design, yet also produces software that runs lightning fast. A coding tutorial app, Swift Playgrounds, is available on iPad. SWIFT www.bdmpublications.com www.bdmpublications.com 9 Coding and Programming 10 Programming is one of the most valuable skills you can pick up these days, particularly for your career prospects; and great just to test your brain and get to create something cool too. When you’re new to coding, it can be hard to know where to start and it’s easy to get sucked down paths that could waste a whole lot of your time and money. If you’re just getting started on your coding journey, here are some tips to set you off in the right direction. Learning to Code – Study Tips CHOOSE YOUR LANGUAGE It may sound obvious but choosing the right coding or programming language to start learning is important if you want the creative process to be successful. If you need learn to code for a specific reason, finding a job for example, then you obviously need to learn the language that’s relevant. If you simply want to learn coding, then picking a language like Python, that is both powerful and relatively easy to learn, can make success more likely. LEARN WHAT BEING A CODER MEANS Take some time to look at the things coding languages are used for; so if you are interested in web design, look at how JavaScript is being used on the sites you use every day; if you are in to mobile apps, look into Java or Swift and see how they make apps work. It can also be useful and encouraging to check out what qualified coders can expect to get paid by looking at local job sites. We are not saying that if you learn to code Python you are immediately going to be offered a £70,000 a year job but it can help spur you on to study harder. PUT THEORY INTO PRACTICE If you are completely new to coding, learning any programming language can seem like a huge task. Getting completely bogged down in pages and pages of code examples and explanations is not likely to make the learning process much fun. In our experience it is often better to learn through practice, or to choose a task you want to perform with code, and then work backwards to learn how to complete that task. By learning small chunks and repeating what you have already learned at differing intervals is called Spaced Repetition. www.bdmpublications.com 10