Introduction
Are you a newcomer in programming and IT? Does it look complicated, painful and unclear? Is it a gray area for you? So, here it is. The course is designed especially for you. During the course, we're going to get through the essentials of the main areas of IT starting with computer hardware and finishing with data structures and algorithms. We'll help you to make your first steps to your path of the success and fortune!
The main goal to achieve is to prepare the students without experience in IT for the next courses and to give them a minimal amount of information which is necessary for a successful start in the bussiness area.
Computer hardware
Task 1
Provide the photos of your computer and add the description of it's hardware
as much as possible (CPU, RAM, Storage and etc).
The module itself mostly focused on the basics of computer hardware and it's components. A student is going to understand how it works under the hood and learn a bunch of new terms. The self-study materials are partitioned into groups by the level of complexity.
Self-study materials
- Early Computing (Watch)
- Electronic Computing (Watch)
- Boolean Logic & Logic Gates (Watch)
- Representing Numbers and Letters with Binary (Watch)
- How Computers Calculate - the ALU (Watch)
- Registers and RAM (Watch)
- The Central Processing Unit (CPU) (Watch)
- Computer Hardware (Read)
Computer hardware notes
Information Technology (IT)
The use of digital technology, like computers and the Internet, to store and process data into useful information. Network Engineers, Hardware technicians, desktop support personnel.
Computer - a device that stores and processes data by performing calculations.
Evolution
- Abacus - primitive calculating device.
- Mechanical Calculator - 17th century by Blaise Pascal ---> textile industry
- Punch card - Joseph Jacquard - programmable loom - textile industry - holes on cards to hook a thread and spun up a design pattern(Punch cards were the first binary system used for machines);
- Charles Babbage - machines of modern computing - difference engine - complicated math probs;
- Charles Babbage - Analytical Engine - used punch card ideology to automatically perform computing - used punch cards to enable people to predefine a series of calculations they wanted to perform.
- Ada Lovelace - used the analytical engine - developed the first algorithm for computer engine - first eg of computer programming.(Analytic Engine - first general purpose computing machine in history);
Algorithm - a series of steps that solve specific problems.
Path to Modern Computing
Major Developments post World War II
- Cryptography - The art of writing and solving code.
- Alan Turing - mathematician and famous computer scientist - top-secret Enigma machine - helped allied forces decode access message during world war II.
- Until 1950s - punch cards were used to store data, stacks in ordered were needed to retrieve the data.
- New technological innovations like - magnetic tape and counterparts - store more data on more reliable media.
- A magnetic tape - worked by magnetizing data onto a tape - vinyl records / cassette tapes;
- Early machines took up a lot of space
- huge machines to read data.
- racks of vacuum tubes to help move that data.
- vacuum tubes control the electricity voltages and electronic equipments like televisions and radios. (Bulky and broken)
- Grace Hopper - Harvard Mark II computer - source of a problem in a relay -> actually moth;
- ENIAC - Earliest forms of general purpose computers - 17,000 vacuum tubes , 1800 square feet floor space;
- Transistors (replacements for vacuum tubes) are now used to control electricity voltages - fundamental component of electronic devices;
- Grace Hopper invented the first compiler;
- Compiler - Translate human language via a programming language into a machine code.
- Emergence of the hard disk drives and microprocessors , then programming languages - way to develop computer software.
- Xerox Alto - first modern compuer; It had GUI - used icons, mouse and a window; (Xerox started building machines affordable and smaller form factor);
- 1970's - Steven Wozniak - invented Apple I - single-board computer MIT for hobbyists; Apple II success and afforable;
- 1980's - IBM - personal computer - os - MS DOC (Microsoft Disk Operating System); - partnership with microsoft.
- Microsoft - founded by Bill Gates - created Microsoft windows - dominated - cause it could be run on any compatible hardware.
- Video Games - 1970's - 80's - coin-operated entertainment machines - arcades - popular - Company Atari -1972 - pong;
- Unix - operating system developed by Ken Thompson and Dennis Ritchie;
- Richard Stallman - developed a free Unix-like operating system. He created GNU - open source - to paved way to one of the largest open source operating system - Linux - created by Linus Torvalds.
- PDAs - Personal Digital Assistants - mobile computing - Nokia introduced a PDA with mobile phone functionality;
Computer Architecture Layer
Abstraction. To take a relatively complex system and simplify it for our use. We have a mouse, keyboard to use and interact with the computer system without having to know and understand the underlying technical details (under the hood) or undelying implementation of the technology.
Computer Architecture Overview
- Hardware - physical components of a computer;
- Operating System - allows hardware to communicate with the system;
- Software - humans interact with computers;
- Users - Interacts with a computer - operate, program , etc;
Introduction to computer hardware
- Ports - Connection points that we can connect devices to that extend the functionality of our computer.
- CPU - central processing unit - it communicates heavily with the RAM.
- RAM (Random Access Memory) - Computer's short-term memory - used to store data temporarily.
- Hard drive - holds all of our data, which includes all of our music, pictures and applications. (long term memory);
- Motherboard - foundation of the computer - the body or circuitory system of the computer that connects all the pieces together.
- Power supply - electricity from wall outlet onto a format that our computer can use.
Program and Hardware
Programs - instructions that tell the computer what to do.
Inside the CPU there are components known as Registers. Registers - stores the data that our CPU works with. To add two numbers - one is stores in register A and the other in register B, and the result is stored in register C.
RAM is not the fastest way to get more data to the CPU, the CPU also uses cache. Cache - smaller than RAM but let's us store data often use / quickly reference. Cache - there are three different cache levels in a CPU : L1, L2, and L3. L1 - smallest and fastest cache;
How does the CPU know when the set of instructions ends, and when a new one begins? CPU - has an internal clock - that keeps the operation in sync, it connects to a clock wire.Overclocking - Increase the rate of CPU clock cycles in order to perform more tasks.
Hardware Components
CPU.
Common CPU/ chipset manufacturers - Intel (Intel Core i7), AMD (AMD Athlon), Qualcomm (Snapdragon 810), Apple (Apple A8). CPU has an instruction set that enables it to process instructions. When you select your CPU, you'll need to make sure it's compatible with your motherboard -- the circuit board that connects all the components together;
2 types of motherboard sockets - CPU and motherboard socket must match:
- Land grid array (LGA)
- Pin grid Array (PGA)
Require a Heat sink - to prevent the CPU from overheating. It takes the heat from the CPU and dissipates it through a fan/ another medium;
CPU architecture - based on the way CPU handles data.
- 32 bit
- 64 bit - handles large amounts of RAM more effectively (4GB), more responsive when running several programs at the same time and switching between them frequently.
RAM (RAM stick needs to be compatible with the motherboard)
Computer's Short Term Memory - store data that we want to access quickly, it is volatile. The computer is comprised of programs, to run a program we need to make a copy of it in the RAM so that the CPU can process it. RAM - 16GB - 16 Gb of programs can be run in that time.
Lots of RAMS, commonly found is - DRAM (Dynamic Random-Access Memory).
DRAM: When a 1 or 0 is sent to DRAM it stores eash bit in a microscopic capacitor. Based on the value 1 or 0 the capitor is charged or discharged. These semiconductors are put into a chip that are on the RAM and store the data.
SDRAM - Synchronous DRAM. This RAM is synchronized to the system's clock speed allowing quicker processing of data.
DDR SDRAM - Double Data Rate SDRAM. DDR1, DDR2, DDR3, DDR4. Faster, less power, larger capacity. Programs can run faster and more programs can be run simultaneously;
Motherboards
Foundation that holds the computer together. Expands computer functionality by adding expansion cards. Routes power from supply. Enables different parts of the computer to communicate with each other (manages data between CPU, RAM and peripherals);
Chipset - decides how components communicate with each other in the machine. Chipset is made of 2 chips.
- Northbridge - interconnected RAM, Video cards , etc; (it could be integrated into CPU);
- Southbridge - maintain I/O controllers - hard drives, USB devices;
Pheripherals - external devices we connect to our computer- mouse, keyboard, monitor, etc. Expansion Slots - provide the ability to increase the functionality of the computer. Standard for expansion slots - PCI Express - Pheripheral Component Interconnect Express
Form factor. Different mother board sizes available, decide the amount that can be put into them. Common form factor - ATX (Advanced Technology eXtended) - diffeerent sizes. ITX - Information Technology eXtended;
Storage
Data size:
- smallest unit of a data storage is a bit; (1/0)
- byte - comprised of 8 bits;
- 1 Kilobyte - 1024 bytes;
- 1 MB - 1024 KB
- 1 GB - 1024 MB
- 1 TB -> 1024GB
Hard Drive - allows to store programs files. Two basic types of hard drives used:
Hard disk drives - HDDs - use a spinning platter and a mechanical arm to read and write information. The speed the platter rotates allows you to read and write data faster. RPM (Revolution per Minute) (eg hard drive - 500gb - 5400 rpm). Affordable.
Solid state drives - SSDs - no moving parts - similar to USB stick information is stored on microchips and data travels a lot faster than HDDs. Form factor is slimmer than HDDs; expensive.
Hybrid SSD and HDD drives;
Power supplies
Computers - convert electricity from volts to useable. Consists of fan, voltage information, cables -> motherboard, power cable.
Peripherals
USB - Universal Serial Bus - popular connections for gadgets; USB 2.0,3.0, and 3.1. USB 2.0 - Transfer spead - 480 Mb/s (megabit per second) and not megabytes. USB 3.0 - Transfer speed of 5 Gb/s. USB 3.1 - Transfer speed of 10 Gb/s. Backward compatible, olderr ones are compatible with newer ports.
Type-C Connector - new and common - outputs audio, video, data and power.
Display peripherals - monitors have them:
- DVI cables are for video output;
- HDMI - Video and audio output;
- DisplayPort - outputs video and audio;
Essentials of Networking and the Internet
Task 2
Prepare a presentation or a schema about Web and the Internet.
It should include the answers to the questions below:
What's the Internet?
How does it work?
What's a protocol?
What protocols are vital for the Internet?
What's a server and a client?
Using the command-line interface
and ping utility just Google website (google.com).
Using the command-line interface and traceroute utility,
gather the information about the way to the Google website (google.com).
Using the command-line interface and nslookup utility
provide the IP address of the Google website (google.com).
The module itself mostly focused on the essentials of the Internet and WWW. A student is going to understand how it works under the hood and learn a bunch of new terms.
Self-study materials
- How the Internet Works in 5 Minutes (Watch)
- How The Web Works - The Big Picture (Watch)
- How does the Internet work? (Read and Watch)
- Computer Networks (Watch)
- The Internet (Watch)
- The World Wide Web (Watch)
- The very-very basics of web development: websites and a browser (Read)
- Windows Command-line Tools
Additional materials
- Computer Networking Complete Course - Beginner to Advanced by Google (Watch)
- How the Web Works: A Primer for Newcomers to Web Development. (Read)
- How the Web Works Part II: Client-Server Model & the Structure of a Web Application (Read)
- How the Web Works Part III: HTTP & REST (Read)
Essentials of Networking and the Internet notes
Networking
Internet - The physical connection of the computers and wires around the world; Web - Information on the internet. Ways to access the internet - Web, Email, Chat, File-sharing programs;
The Internet is composed of a massive network of satellites, cellular networks, and physical cables buried beneath the ground; Computers called servers connect to the internet directly and not all pc, desktops; Servers - store the websites we use - wikipedia, google, etc. These websites serve the content requested by the client (mobile phines, laptops, etc). Internet (Satellites/Cellular networks/cables) -> Server -> Websites (Google, wikipedia) -> Client (phone, desktop);
Clients don't connect directly to the internet, but connect to a network run by the ISP (Internet Service Provider) like - Beltelecom (Minsk), and etc;
ISPs have built networks and run all the necessary physical cabling that connects millions of computers together in one network. They also connect to other networks and ISPs; The other network connect to google, universities, etc. Together form the Internet;
Computers on a network have an identifier called an IP address which is composed of digits and dots. To access websites like - www.coursera.org - go to the IP address. Devices that can connect to the network have another unique identifier MAC address permanemt ad hardcoded onto a device. Eg: - 82:4f:23:59:47:4. When data is sent or received on a network both IP and MAC address must be available. Data sent through a network is sent in packets (bits of binary data);
Networking Hardware
The ways to connect to the Internet:
- Ethernet cable - physically connect to the network through a cable;
- WIFI - wireless networking, through radios and antennas;
- Fiber optics - expensive and allow greater speed that other methods, contains of glass fibers that move data through light instead of electricity;
Router - connects lots of different devices together and helps route the network traffic. Router utilizes network protocols to determine where to send the data packet; Switches and hubs are devices that help the data travel;
Network Stack - a set of hardware or software that provides the infrastructure for a computer;
The Language of the Internet
Network protocols - Set of rules in order to route data through a network. Route efficiently, aren't corrupted, secure, destination, names appropriately;
TCP (Transmission Control Protocol) and the IP (Interpet Protocol) - TCP/IP:
- IP - delivers packets to the right computers;
- TCP - handles reliable data transfer between networks;
Web
Many ways to access the internat - web, mail, chat, file sharing, etc;
All websites can be access through the Web. Websites are text documents that are formatted with HTML - hypertext markup language - coding language used by web browsers. Web pages - made of very basic components, multimedia content.
To navigate into a website you type a url - www.google.com. URL - Uniform Resource Locator - is a web address.
Domain Name - can be registered to ICANN (Internet Corporation for Assigned Names and Numbers). Domain Endings
- .edu - education institutions;
- .org - organizations, etc;
172.217.6.46 - maps to google homepage through a protocal called DNS (Domain Name System). DNS - acts like the Internet's directory and uses human readable words to map to an IP address.
Limitations
- IPv4 - It is an address that consist of 32 bits separated into four groups; (Totally < 4.3 billion IP address # websites , users more);
- IPv6 - consists of 128bits (4 times of IPv4); - 379f:3e7d:4860:0370:7334:0000; (possibilities 2 power 128);
NAT - Network Address Translation - Lets organizations use one public IP address and many private IP addresses within the network The router may need to be configured with NAT to facilitate communication between the company's network and the outside world.
Programming basics
Task 3
Hello, my dear friend. If you're here you did an awesome job!
You've spent plenty of time learning the basics of computers and programming,
thus I hope you can handle the next task as well easily.
Please, recall the flowchart term and have a look at the "draw.io" service.
Afterwards, please prepare the flowcharts for the algorithms listed below:
Imagine that you are really-really hungry and you have several eggs in the fridge,
so draw the flowchart of cooking fried eggs.
The first one was simple and clear, that's why let's change the dish to the hard-boiled eggs.
Do not forget about the cooking time (use conditions).
The module itself mostly focused on the basics of programming languages, understand the main terms and get acquainted with pseudocode, flowcharts, basics of programming languages and conditions, realize their first algorithm.
Self-study materials
- History. Early Programming (Watch)
- History. The First Programming Languages (Watch)
- Intro to Algebra (Watch)
- Introduction to programming (Watch)
- What is a Computer program & how does it work? (Watch)
- Pseudocode and Flowchart (Watch)
- Pseudocode (Read)
- Flowcharts (Read)
- Programming language syntax (Watch)
- Data types and operators (Read)
- Conditions (Watch)
- Conditions (Read)
- What is an Algorithm? (Watch)
- Creating an algorithm/flowchart and then adding a counter (Watch)
- Programming basics (Watch)
- Quick guide to preudocode (Read)
Programming basics notes
What is programming?
Before we can introduce you to some key concepts, we need to make sure we understand what programming really is.
A computer is a hardware machine that can store and process information. The language of a computer is Binary, a complex set of ones and zeroes. Programming is essentially the larger-scale process of developing a complex machine program that acts according to our wishes. Programming is the basic communication between human input and machine output. It is the way that a computer knows how and when to process data.
So, what is coding, then?
Think of coding as a translator between English (or a different human language) and the computer’s binary. Coding involves the actual syntax and structure by which we write commands. A computer can then take those commands, translate it into binary, and do what is written. Coding involves writing commands in a language that a computer can understand. Coding is the initial step in communication with a computer.
What is hardware? What is software?
In order for a computer to work, it requires both hardware and software. Software is a collection of instructions and programs that are downloaded to a computer. These enable a user to interact with the computer. The apps on an iPad or Microsoft Word are examples of software. Hardware, on the other hand, is the physical device that stores, delivers, and executes that software. The physical iPad or monitor would be an example of hardware.
A hardware engineer is responsible for manufacturing and designing devices that interact with software. They will usually have a background in Electrical and Computer Engineering. A software engineer, on the other hand, develops and codes software programs for those devices. They will usually have a background in Software Engineering or Computer Science.
What is front-end? What is back-end?
Within the world of software development, there are two common camps that programmers fall into that utilize different tools, skills, and end-goals: front-end and back-end development.
Front-end development focuses on what the user will actually see on their screen. This involves the design, application debugging, and coding for user experience. This job is all about the feel, look, and design of a program or website.
Back-end development focuses on everything that makes the front-end possible. This job is all about how a site or application works, how quickly it functions, and how it communicates with databases (where data is stored). Many programmers are more generalists on both sides. They are called full-stack developers. What do I need to learn to be a programmer?
Now that you have your bearings on the world of programming, let’s discuss what you will actually need to learn to become a programmer. We will start with the fundamentals of programming on the whole.
In this section, we will discuss the following need-to-know concepts to become a programmer:
Programming languages Coding syntax, vocabulary, and lingo Data structures and algorithms
Programming languages
As we discussed earlier, a programmer writes code that a computer can understand and translate into binary. Just as we use different human languages to communicate, we also use programming languages to communicate with a computer. A programming language is a formal set of notations and rules that function similarly to a human language. They generate instructions and implement algorithms based on the predetermined rules of that language. A computer can then produce an output from that text.
Let’s introduce some of the most important programming languages that you should be aware of as a beginner.
The need-to-know programming languages There are tons of programming languages, and they each serve different purposes, styles, and specializations. Many programming languages build off of previous ones, and some are developed for particular careers. For example, some languages are better for game development, while others are used for complex robotics.
In order to get you started, let’s get familiar with the ten most popular programming languages out there. Keep in mind that there are many more, and these lists are notoriously subjective!
If you want to get started with any of these languages from scratch, check out Educative’ free beginner’s courses on a variety of programming languages.
Java: this is one of the older, more established programming languages. It is used in universities and large-scale businesses. Java is known for being cross-platform compatible. As programmers say, with Java you can “write once, run everywhere”.
Python: this is a very user-friendly language preferred by many beginners. The syntax is simple and clear, so many newbies get started on Python. It is commonly used for machine learning, amongst many other uses.
Ruby: similar to Python, this language is known for being beginner-friendly. It’s easy to read, and it was built on the notion that programming should be fun. Over the years, developers have expressed a consistent love for Ruby.
JavaScript: this is a text-based language for web development. It must be run through a browser and an HTML document (the basic language of the internet). JavaScript is foundational to all websites.
C: this is one of the original programming languages, so it’s like the parent language. C is known for being hard to learn, but it works great for high-performance applications.
C++: this language is based on C and adds new features to the old language. It’s also an older one and is known for having a bit of a learning curve. Many universities still teach C++. Some developers say it makes learning other languages far easier.
C#: this language, created by Microsoft, is based on C and C++ to make really robust things, like large websites. It is still a very sought-after language, especially for those who have a preference for Windows.
PHP: this is a scripting language that uses HTML to make websites, but it’s taken off for a lot of other uses. It’s well-loved by programmers and web developers for its broad range usage and simplicity.
Swift: this language, developed by Apple, is great for iOS and Mac OS apps. It’s designed similarly to Python and Ruby; it is simple and easy to learn. There is a general push to get more Swift programmers in the field.
Objective-C: this is an older language that is being slowly replaced by Swift, but it is an important language for the history of software development. It is especially useful for creating applications on Mac OS X and iPhone iOS.
Imperative vs. Declarative Paradigms
As we mentioned, programming languages have different styles. In fact, every programming language operates according to a paradigm. A paradigm is basically the way that a computer will logically approach a problem. It is the style of that language. There are many different paradigms out there, and they all fall under two branches: imperative and declarative.
For imperative programming, you tell the compiler what you want to happen to your code. You give it all the steps, and it “listens” to your imperative commands. You give the instructions, not the desired outcome.
For declarative programming, you will write code that describes what you want to happen, but you don’t explain how to get that result. You give the outcome you want, not the instructions to get there.
As a beginner, there are really only two paradigms that you need to know about: Object-Oriented and Functional.
Object-Oriented programming is an imperative paradigm that largely dominates the field. In this paradigm, everything is treated like an object, a thing you can interact with or alter.
Functional programming is a declarative paradigm that thinks about data through sets of tasks, which we call functions.
Compiled vs. Interpreted Languages
A programming language isn’t the only tool necessary for communicating with a computer. After all, the computer “thinks” in binary. Compilers and interpreters take human-readable code and translate it to computer-readable code. A compiled language means that the machine directly translates the program that you input. These tend to be faster and more efficient but require an extra “build” step. An interpreted language, however, requires another program to read and execute the code, sort of like a middle-man. These are generally more portable and require less effort to change the code later.
Basics of coding syntax
Now that you’re familiar with programming languages, let’s take a deeper look at how you write them. We will go over the key concepts and vocab terms to get you familiar with coding syntax.
Note: for these examples, we will be using Python for its readability, so keep in mind that other languages will look different!
Keywords
Just like any human language, a programming language has words with reserved meaning. That’s how any language conveys meaning! Keywords are reserved words that have pre-determined meanings and uses. Each programming language has its own set of keywords, though there is a lot of cross-over.
The keyword var, for example, defines a variable, and the keyword return runs that function and returns the result. Take a look below and try it out yourself once you understand how it works.
Note: In many languages, you can use the # to make notes. The compiler will ignore anything after the number sign.
Identifiers
Identifiers are similar to keywords, but these are the names that the programmer would create to label different entities in their program. We use these to differentiate one entity from another. To create an identifier, you must follow the syntactic rules as outlined by the programming language of your choice. For example, in Python, identifiers must follow these rules:
Identifiers can be a combination of lowercase letters, uppercase letters, digits (0-9), or an underscore Keywords cannot be used as identifiers Identifiers cannot include any special characters like !, @, &, $, %, etc. They cannot begin with a digit
Variables
Variables allow you to store information that can be accessed over and over again. These are similar to variables in algebra. But in programming, we name our variables according to the syntax of that language. Naming a variable is called declaring a variable. These are useful for any data or value that you want to use more than once. Take a look below and test it out for yourself.
name = "Amanda" # declaring the name age = 23 # declaring the age
Data Types
As we have learned, programming is all about data processing, and each language has different kinds of data. Data types are like classifications that tell the compiler or interpreter how to use a piece of information. Let’s take a look at four commonly used data types to get a better sense of how they work.
Integers are numbers without decimals, just like in algebra. In fact, they can be used to do algebra in your programs. Integers can be stored in variables so we can use them over and over again.
123 number_of_bagels = 10 - 2 print(number_of_bagels)
Boolean is basically a yes or no response. They will return either True or False. These can serve tons of different purposes, like comparing the equality of two numbers or variables.
123 print(10 > 20) # False print (10 > 5) # True
Strings are commonly pieces of text in programming languages, such as our Hello World! statement They are written with quotation marks.
print ("Let's learn programming!")
Operators
Operators are symbols that perform mathematical functions to your data. There are different categories of operators. The most important operators for you at this stage are the following:
Arithmetic (for simple arithmetic)
Assignment (to assign value)
Relational (for comparison, returning boolean values)
Logical (to return boolean from a boolean input)
a + b = 30 c = a + b 40 > 30 abc == abc (2 < 3) and (2 < 5)
Conditionals
Conditionals allow us to perform certain actions depending on a condition. We use booleans to determine if data meets certain requirements, and then define what the program should do if that requirement is or is not met. In other words, we want to tell the computer, “if this thing is true, do this other thing”.
Programming basics II
Task 4
And here you are. Let's start the next challenge.
What you have to do is the following:
Imagine that you were snowed under at your job and forgot to wash dishes.
Now you have to do that immediately because your mom is coming.
Create a flowchart of the algorithm and take into account the amount of the dishes (10).
Your friend asked you to go to grocery shopping and gave you a list.
Create a flowchart of the algorithm (use given arrays of goods).
And the last one, you need to prepare the list of favourite films of your friend.
Create a flowchart of the algorithm (use array).
Good luck!
The module opens the door to the next key topics of the programming such as variables, data types, loops and arrays. And of course, there will be intro to the functions.
Self-study materials
- What Are Data Structures? (Watch)
- What is an Array? (Watch)
- Working with variables Data Types and Arrays (Watch)
- An Overview of Arrays and Memory (Watch)
- Arrays (Read)
- Operators Loops and Control Structures (Watch)
- Flowchart and Loops (Watch)
- More on loops (Watch)
- Loops (Read)
- Programming Basics: Statements & Functions (Watch)
Programming basics II notes
Arrays
A list is a sequence of several variables, grouped together under a single name. Instead of writing a program with many variables x0, x1, x2, … you can define a single variable x and access its members x[0], x[1], x[2], etc. More importantly, you can put other expressions and variables inside the square brackets, like x[i] and x[i+1]. This allows us to deal with arbitrarily large data sets using just a single small piece of code.
One way to create an array is by enclosing several values, separated with commas, between square brackets:
myList = ["the first value in the list", 1999, 4.5]
This creates a list called myList of length 3. Each element of the list gets a number called its index: the initial element has index 0, the next element has index 1, and so forth. The individual variables comprising the list have the names «listName»[«indexNumber»]
Loops
Loops are among the most basic and powerful of programming concepts. A loop in a computer program is an instruction that repeats until a specified condition is reached. In a loop structure, the loop asks a question. If the answer requires action, it is executed. The same question is asked again and again until no further action is required. Each time the question is asked is called an iteration.
A computer programmer who needs to use the same lines of code many times in a program can use a loop to save time.
Just about every programming language includes the concept of a loop. High-level programs accommodate several types of loops. C, C++, and C# are all high-level computer programs and have the capacity to use several types of loops.
Types of Loops
- A for loop is a loop that runs for a preset number of times.
- A while loop is a loop that is repeated as long as an expression is true. An expression is a statement that has a value.
- A do while loop or repeat until loop repeats until an expression becomes false.
- An infinite or endless loop is a loop that repeats indefinitely because it has no terminating condition, the exit condition is never met or the loop is instructed to start over from the beginning. Although it is possible for a programmer to intentionally use an infinite loop, they are often mistakes made by new programmers.
- A nested loop appears inside any other for, while or do while loop.
- A goto statement can create a loop by jumping backward to a label, although this is generally discouraged as a bad programming practice. For some complex code, it allows a jump to a common exit point that simplifies the code.
Loop Control Statements
A statement that alters the execution of a loop from its designated sequence is a loop control statement. C#, for example, provides two loop control statements.
- A break statement inside a loop terminates the loop immediately.
- A continue statement jumps to the next iteration of the loop, skipping any code in between.
Functions
In programming, a named section of a program that performs a specific task. In this sense, a function is a type of procedure or routine. Some programming languages make a distinction between a function, which returns a value, and a procedure, which performs some operation but does not return a value.
Most programming languages come with a prewritten set of functions that are kept in a library. You can also write your own functions to perform specialized tasks.
The term function is also used synonymously with operation and command. For example, you execute the delete function to erase a word.
Javascript Basics
Task 5
Here you are. Your fabulous adventure is just started.
From now and ever you'll use the programming languages instead of painting the logic.
Home task is the following:
Implement the tasks from Programming basics module on JS.
Using if..else, write the code which gets a number via prompt and then shows in alert:
1, if the value is greater than zero,
-1, if less than zero,
0, if equals zero.
In this task, we assume that the input is always a number.
Good luck!
Dear friend, it's the time to write some code! In this section, you'll able to write a couple lines of pure Javascript! That's what you wanted, didn't you? Let's get started then.
Self-study materials
- Rolling Scopes School Poland. JS Basics (Watch)
- What Is JavaScript? (Read)
- Intro to Javascript (Watch)
- Variables (Watch)
- Conditions (Watch)
- Intro to Javascript (Read)
- Manuals and specifications (Read)
- Developer console (Read)
- Hello world! (Read)
- Code structure (Read)
- Strict mode (Read)
- Variables (Read)
- Data types (Read)
- Operators (Read)
- Comparison (Read)
- Conditions (Read)
- Logical operators (Read)
- Interaction: alert, prompt, confirm (Read)
Javascript Basics II
Task 6
You've proved yourself as a JS warrior! Let's do one more task.
So, first off, please, implement the algorithm you've written in Module 6 on Javascript.
The second part is way interesting than just rewriting your own solution:
Task 1:
Given an array arr consists of upper/lower-case alphabets and empty space characters ' ',
return the length of the last word in the array.
If the array is empty, return 0.
Example:
Input: ["Hello", "World"] Output: 5
Task 2:
Given two arrays arr1 and arr2. Return array which consists of these two arrays.
Example:
Input: ["Hello"], ["World"] Output: ["Hello", "World"]
Task 3:
Given an array of numbers arr, please find the maximum value in the array.
Example:
Input: [1,2,3,4] Output: 4
Task 4:
Given an array of numbers, return the sum of all elements in the array.
Example:
Input: [1,2,3,4] Output: 10
Task 5:
Given an array of objects with property salary, return the average salary in the array.
Example:
Input: [{ salary: 10 }, { salary: 4 }] Output: 7
After the first part where you've realized your first algorithm, you should dig deeper and iterate through arrays using loops in Javascript!
Self-study materials
- Rolling Scopes School Poland. JS Basics Part 2 (Watch)
- Surveying JS (Read)
- Intro to Arrays (Watch)
- Introduction to Iterators (Watch)
- Intro to Objects (Watch)
- Rolling Scopes School Poland. Functions (Watch)
- Intro to Functions (Watch)
- Intro to Scope (Watch)
- Arrays (Read)
- Objects (Read)
- The "switch" statement (Read)
- Loops: while and for (Read)
- Basics of functions (Read)
- Hello Modules (Watch)
- Coding Style (Read)
- Comments (Read)
Code Editors and IDEs
Task 7
You've learned a bunch of new terms such as IDEs, DevTools and so on.
So, the home task is the following:
1) Install the IDE and just play with it;
2) Publish your code on the codepen or jsbin;
3) Try to use console and network tab in the chrome dev tools.
4) Sign up on the github and pass though the course https://lab.github.com/githubtraining/introduction-to-github.
5) Additionally, create repository and push your code from previous lessons to it.
Hi, hero! You've already passed through the basics of programming. Congrats! The next part is to add a few tools to your programmer's toolbelt.
Self-study materials
- Rolling Scopes School Poland. IDE lecture (Watch)
- Code editors (Read)
- Getting started with Visual Studio Code (Read)
- Getting started with Visual Studio Code (Watch)
- Visual Studio Code extensions (Read)
- Getting started with Atom (Read)
- Code sharing & collaboration (JSbin)
- Code sharing & collaboration (Codepen)
- Chrome Dev Tools I (Read)
- Chrome Dev Tools II (Read)
- Debugging in Chrome (Read)
- Learn Git (Watch)
- Git Handbook (Read)
- Learning Git branching (Play)
Data structures and Algorithms
Task 8
Let's challenge your skills.
Please, sing up the leetcode website and try to solve the brain teasers.
1) https://leetcode.com/problems/remove-duplicates-from-sorted-array/
2) https://leetcode.com/problems/merge-sorted-array/
3) https://leetcode.com/problems/intersection-of-two-arrays/
Welcome back! In this section, you're going to pass with flying colors "Data structure and Algorithms" basics.
Self-study materials
- Introduction to Linked Lists (Watch)
- Introduction to Big O Notation and Time Complexity (Watch)
- Introduction to Trees (Watch)
- Algorithms: Bubble Sort (Watch)
- Bubble Sort JS implementation (Watch)
- Algorithms: Binary Search (Watch)
- Algorithms: Solve 'Ice Cream Parlor' Using Binary Search (Watch)
- CS50 Data Structures (Watch)
- CS50 Algorithms (Watch)
- Code samples (Read)
- Grokking Algorithms (Read)
What's next?
And you've nailed it! However, I don't wanna make you upset but it's just a beginning of your developer path. What should you learn next? Actually, it depends on what you'll choose. Please refer to the https://roadmap.sh website. There you can find the "algorithms" of self-improvement in different areas for the next few years.
Despite that, do not forget to try yourself in computer science, you're able to join for free to the courses below on coursera.org.
- https://www.coursera.org/learn/algorithms-part1
- https://www.coursera.org/learn/algorithms-part2
- https://www.coursera.org/specializations/data-structures-algorithms
In addition to that, there is an option to study and get the bachelor or master degree online!
And let me give you several advices:
- always stick to one task at a time
- don’t be afraid to ask for help or to help people back
- it might be hard but don’t give up
- don’t compare yourself to others, people are different
- it’s okay if you don’t understand
- don’t over-practice though, think of your health as well
Useful sources
- Free Code Camp (free)
- Codecademy (mostly free)
- Pluralsight (paid subscription)
- edX (mostly free, pay for certificate)
- Udemy (a couple of courses are free)
- Udacity (mostly free, pay for certificate)
- Khan Academy (free)
- Eduonix (a couple of courses are free)
- SoloLearn (free)
- Code School (paid subscription)
- Code College (pay per course or paid subscription)
- Dash General Assembly (free)
- Skill Crush (mostly free)
- CSS Tricks (free)
- Quora m (free)
- Stack Overflow (free)
- Lambda School (a couple of courses are free)
- Launch School (paid subscription)
- Hacker Rank (free)
- Coderbyte (free)
- Egghead.io (a couple of courses are free)
- Coursera (a couple of courses are free)
- Firehose Project (paid subscription)
- Hack design (free)