Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Applied Computational Thinking with Python

You're reading from   Applied Computational Thinking with Python Algorithm design for complex real-world problems

Arrow left icon
Product type Paperback
Published in Dec 2023
Publisher Packt
ISBN-13 9781837632305
Length 438 pages
Edition 2nd Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Sofía De  Jesús Sofía De Jesús
Author Profile Icon Sofía De Jesús
Sofía De Jesús
 Martinez Martinez
Author Profile Icon Martinez
Martinez
Arrow right icon
View More author details
Toc

Table of Contents (25) Chapters Close

Preface 1. Part 1: An Introduction to Computational Thinking
2. Chapter 1: Fundamentals of Computer Science FREE CHAPTER 3. Chapter 2: Elements of Computational Thinking 4. Chapter 3: Understanding Algorithms and Algorithmic Thinking 5. Chapter 4: Understanding Logical Reasoning 6. Chapter 5: Errors 7. Chapter 6: Exploring Problem Analysis 8. Chapter 7: Designing Solutions and Solution Processes 9. Chapter 8: Identifying Challenges within Solutions 10. Part 2: Applying Python and Computational Thinking
11. Chapter 9: Introduction to Python 12. Chapter 10: Understanding Input and Output to Design a Solution Algorithm 13. Chapter 11: Control Flow 14. Chapter 12: Using Computational Thinking and Python in Simple Challenges 15. Chapter 13: Debugging 16. Part 3: Data Processing, Analysis, and Applications Using Computational Thinking and Python
17. Chapter 14: Using Python in Experimental and Data Analysis Problems 18. Chapter 15: Introduction to Machine Learning 19. Chapter 16: Using Computational Thinking and Python in Statistical Analysis 20. Chapter 17: Applied Computational Thinking Problems 21. Chapter 18: Advanced Applied Computational Thinking Problems 22. Chapter 19: Integrating Python with Amazon Web Services (AWS) 23. Index 24. Other Books You May Enjoy

Understanding computing

In computer science, computing refers to the activities that computers perform to communicate, manage, and process information. Computing is usually divided into four main areas: algorithms, architecture, programming languages, and theory.

Since we discussed theory and algorithms in previous sections, we will now focus on defining architecture and programming languages.

Architecture

Computer architecture refers to the set of instructions that interact with computer systems. In more basic terms, the architecture includes the instructions that allow software and hardware to interact. Computer architecture has three main subcategories:

  • Instruction Set Architecture (ISA)
  • Microarchitecture
  • System Design

Instruction Set Architecture (ISA)

The ISA is the boundary that exists between hardware and software. It is classified in multiple ways, but two common ones are complex instruction set computer (CISC) and reduced instruction set computer (RISC):

  • CISC is a computer that has explicit instructions for many tasks, such as simple mathematical operations and loading something from memory. CISC includes everything that is not included in RISC.
  • RISC is a computer with an architecture that has reduced cycles per instruction (CIP).

CISC tries to do more things with a fewer number of instructions, while RISC only uses simple instructions. CISC is multi-step, while RISC is single-step, performing one task at a time. The CISC process includes instructions, microcode conversion, microinstructions, and execution. In contrast, RISC includes instructions and execution.

In CISC, microcode conversion refers to interpreting language at a lower level. It considers the hardware resources to create microinstructions. Microinstructions are single instructions in microcode. After the microcode creates the microinstructions, the microinstructions can be executed. The following diagram shows the process for both RISC and CISC:

Figure 1.8 – Difference between RISC and CISC

Figure 1.8 – Difference between RISC and CISC

Both RISC and CISC are necessary for computer programmers. There are advantages and disadvantages to having a single-step process (RISC) versus a multi-step process (CISC). RISC reduces the cycles per instruction, doing one thing at a time. CISC reduces the instructions in a program but at the cost of cycles per instruction. Depending on what our needs are, we can choose the best path to take.

Programming languages

Programming languages are the way we write instructions for computers and other devices. Different languages are used depending on what is needed, ease of use, and much more. Examples of programming languages include the following:

  • Ruby and Python: Ruby is a programming language mostly used for web applications. Ruby is stable and easy to use; however, many developers choose to use Python over Ruby because Python is faster in many cases and has a larger ecosystem. Although Ruby has not been as popular and had some performance issues, the language is very much alive in 2023 and continues to grow. Python, on the other hand, is widely used for multiple purposes, such as web applications, user interface applications, and websites, among others. It is also one of the languages that is being adopted as schools around the world begin to require programming courses for graduation from secondary schools. We will explore Python in greater depth later in this book.
  • C: The C language is a critically important part of computer science as C was the first language to be used and is still the most widely used language. C has been around since 1972 when Dennis Ritchie invented it, but it has been used by others since 1978 when it was first published. While other languages have grown in popularity since, C is still used in 2023. Some of its uses include OSs, hardware drivers, and applications, among others. C is a base-level language, which means it requires almost no abstraction.
  • C++: C++ was developed by Bjarne Stroustrup as an extension of C in 1985. The goal of the language was to add object-oriented capabilities. The language is still widely used both in conjunction with the C language in OSs and for other software. C++ is an intermediate-level programming language.
  • C#: (C sharp (C#) is a high-level programming language. Much like C++, it has object-oriented capabilities and is an extension of the C programming language. One of the main differences between C++ and C# is that C++ uses machine code while C# uses bytecode. Machine code can be executed directly by a computer. The user’s code is compiled into bytecode, which is a low-level code that needs to be interpreted.
  • Swift: The Swift programming language was developed by Apple Inc. in 2014. As programming languages go, Swift is one of the newest. Apple released it as an open source programming language with version 2.2, which was released in 2015. The language is considered to be a general-purpose and compiled programming language and version 5.7 was released in September 2022. This language is important in the development of apps in the iOS ecosystem for Apple products.
  • Scratch: Scratch was developed as a visual programming, block-coding language in 2002 by MIT Media Lab. As a block programming language, it is used extensively in schools to teach students of all ages how to code. Scratch is now adapted for multiple uses, including some robotic applications, such as Vex Code, incorporating machine learning and artificial intelligence, and much more. It is compatible with popular classroom peripherals such as Makey Makey, which is a circuit that interacts with a computer and can be fully controlled with a Scratch program. While it is popular for educational purposes, the power of the programming language cannot be understated and the language itself and its functionalities continue to grow.
  • JavaScript: JavaScript is a scripting language that is used only within browsers. It is used to create websites and web applications. Java, on the other hand, is a general-purpose programming language. JavaScript helps us make websites animated or add interactive functionalities to them.
  • Java: Java is compiled into bytecode and is widely used to develop Android devices and applications. It is an object-oriented programming language that allows programs to run in any environment.
  • PHP: PHP is otherwise known as Hypertext Preprocessor. Much like Java, it is a general-purpose programming language. It is widely available and used in website design and applications. PHP is considered to be easy to learn, yet has many advanced features. It can also be used to write desktop applications.
  • SQL: Structured query language (SQL) is a programming language that’s used to interact with data. SQL is domain-specific. It has been around for almost as long as C, making its first appearance in 1974. The main importance of SQL is that it can interact with databases, whereas other languages are not able to do so.

In computational thinking, we use many different programming languages, depending on what our goals are, what information we have or need, and what our application or software requirements are. Choosing a language is dependent on not just our knowledge of the language, but the possible functionalities of the language.

We will work more extensively with Python in this book because of its open source nature, ease of use, and the large number of applications it can be used for. However, Python is not the only option. Knowing about other languages is important, especially for developers.

With that, we’ve learned about computing and a few of its areas, namely, architecture and programming languages. We also learned about the ISA and its types, as well as various programming languages. In the next section, we’ll look at data types and structures.

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Applied Computational Thinking with Python
You have been reading a chapter from
Applied Computational Thinking with Python - Second Edition
Published in: Dec 2023
Publisher: Packt
ISBN-13: 9781837632305
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Modal Close icon
Modal Close icon