0% found this document useful (0 votes)
4 views

cs

Uploaded by

catonpinto
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

cs

Uploaded by

catonpinto
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 11

cs start

Binary Code
The concept of binary code is quite simple. Every 0 means off or disabled, and
every 1 means on or enabled. In other words, you can look at them as a switch or
lever. If you’re looking at binary code and you see a 1, then you know that
particular data point is “on,” or has been initiated. The opposite is true when you
see a 0 in the code.

While that’s a rudimentary definition of binary code, it will certainly help you
understand the language much better.

To quantify how that kind of code can tell a computer what to do, or communicate
rather, you must consider how these machines handle the information.

Not necessarily in this order, computers will:

Receive inputs or commands from users through applications


Collect, store, and process data as information
Deliver output in the form of stored or processed data
Let’s break that down even more. While coding, for example, you interact with your
keyboard to input commands. That is essentially telling your computer what it needs
to know, by providing it “inputs” it can process. It takes that information and
stores it. When you compile and run your code it retrieves the data and begins
processing as it’s supposed to. Then it delivers an output, usually, through
action, which would be whatever your code was telling it to do.
Except, instead of leveraging programming languages — as you know them — the
computer is working with a complex series of 1’s and 0’s that it can understand.

What Does That Have to Do with Programming?


There’s one big problem, here. When we communicate with computers through
programming languages, we are not using 1’s and 0’s, so how do the two relate?

That’s because binary code is the fundamental or core language that computers use
to process and read data. And it would be too difficult for us to work with, at
least as-is. Instead, we use another form of communication, or language, called
programming languages. These languages — of which there are many — translate
information into binary so that the computers can interpret the data and make use
of it.

When you learn to code, really you’re learning to speak to computers in a language
they can understand. So, even though you may not be using binary directly, it’s
still important that you know what it is and how it works.

What Happens with the Binary 1’s and 0’s?


The numbers or 1’s and 0’s are how computers read, process, and store data. It’s a
leftover mechanism from old-school computers which used to have indicators, like
switches, telling their handlers whether a storage point was enabled or disabled.
Old computers, which were incredibly large, used to have lights, and when the
lights were on it meant a 1, and when they were off it meant a 0.

Today’s computers are much more advanced and complex, and those 1’s and 0’s can
represent any symbol, letter, number, or segment of data. Binary just happens to be
how the computers process the information.

They can represent many things, such as:


True or false
On or off
Yes or no
Enabled or disabled
Initiated or uninitiated (at-rest)

How to Store Data Using Bits


Within each of those “switches” is a bit of data. So, if you have five switches you
would have the option to store five bits of data. If you had ten switches, then
ten bits of data, and so forth.

To understand how information is stored in today’s computers, we need to look at


the hardware inside. It’s the hardware that truly retains the more complex
information, while the computer itself deals in 1’s and 0’s.

Every time you store data, inside the computer that information is stored in
something called a capacitor, using electrons. This type of system is what makes up
a memory module, or DRAM. Boiled down to basics, these capacitors are essentially
the same as the switches, but they can hold more information, or rather more
nuanced details.

Today’s computers get most of their data storage and processing power because of
how capable DRAM or advanced capacitors are. Let’s say your computer has 4GB of
DRAM, which is the base capacity of most computers on the market today.

Each GB (Gigabyte) contains a billion bytes or 230 bytes. For every 1 byte, there
are 8 bits. To calculate how many bits there are, or switches, we need to use a
little math.

230 (bytes) x 4 (GB) x 8 (bits) = 34,359,738,368 bits

So, that means there are 34 billion switches in 4GB of RAM. Now imagine higher
capacities of RAM like 8GB, 16GB, or even 64GB! The same is true for massive hard
drives at 1TB or beyond! Any one of those bits, or switches, can be used to store
information. That’s a lot of room to store data.

That is precisely how computers use binary to store long strings of information.
The long strings of 1’s and 0’s can be used to denote particular letters, numbers,
and symbols. This is called binary code, while reading it is called “decoding.”

That’s all good to know, but it doesn’t answer an important question. What is
binary? How does it work and how do computers use it?

How Does Binary Code Work?


Because the storage strings are so long, computers can use what’s called a binary
number system to store and read data.

The standard form of numerics relies on the decimal number system, starting at 0
and it goes up to 9. This is the most basic representation, which we all learn in
school. Computers don’t use this, however, at least not in its direct form.

Also referred to as the base-ten numeral system, in the decimal system, as the
digits grow — beyond the 10’s, 100’s, 1000’s, etc. — we increase by powers of 10,
expanding more and more.
Binary works in a similar way, except it relies on powers of 2, not 10. So, a
computer uses longer strings of binary which correspond with digits beyond 1’s and
0’s.

The first digit is 20, which represents the 1’s


The second digit is 21, which represents the 4’s
The third digit is 22, which represents the 8’s
The fourth digit is 23, which represents the 16’s
The fifth digit is 24, which represents the 32’s
Etc.
This results in long sequences of 1’s and 0’s, like 111010110.

For storing content like text, those strings are used to denote letters. A number 1
would be “A,” the number 2 would be “B,” and so on.

For images and other content, binary is used the same way. This is why images and
photos are displayed in pixels. Every pixel has a numerical value associated with
it, which tells the computer what colors to display.

Ultimately, the massive number of switches, or capacitors, is what makes it


possible to work with computers using binary code. The binary is translated into
more practical information, before being output to us.

Welcome to the Basics of Binary


There you have it! Now you have a basic understanding of binary code, how it works,
and how computers use the language to translate and work with information.

CODING
You’ve seen the craze for learning code. But what exactly is coding? Coding is what
makes it possible for us to create computer software, apps and websites. Your
browser, your OS, the apps on your phone, Facebook, and this website – they’re all
made with code.

Here’s a simple example of code, written in the Python language:

print 'Hello, world!'


Many coding tutorials use that command as their very first example, because it’s
one of the simplest examples of code you can have – it ‘prints’ (displays) the text
‘Hello, world!’ onto the screen.

Coding 101
If you don’t know the first thing about coding, you’ve come to the right place.
We’ve put together a beginner’s tutorial which will give you all the background
information you need on coding, before you start learning it for real.

It starts with an explanation on the benefits of learning coding. Here, you’ll find
out what you’ll be able to do once you know how to work with code. Then, you’ll get
a deeper understanding of how coding works, and how the code you write gets
converted into an instruction that a computer can ‘understand’. Very satisfying to
know!

That’s followed by an outline of today’s coding languages. After all, every


language has a purpose – some are for the web, others for app development, others
for desktop software. You’ll find out why web development is an ideal form of
coding to start off with, and then get a full overview of it. You’ll also be
introduced to web design and app development.

Finally – and most importantly – there’s a step-by-step action plan that will
outline the fastest and easiest way to get started in coding, and become a coder in
6 months.

There are several benefits of coding.

First, you develop an analytical thinking while you learn to code. Instructing the
computer what to do helps us develop the habit of analyzing any process or problem
in a step wise manner. When w learn to break a process into small steps, it becomes
easy for us to solve real world problems by analyzing them in a better manner.
Learning to code also helps you land high paying jobs. Nowadays, programming jobs
are most sought after jobs and you can easily land a $100k job if you learn to code
efficiently in at least one programming language.
Another benefit of coding is continuous learning. If you are a programmer, you have
to learn new things daily to develop softwares. Computer science industry is a
relatively new industry. Due to this, there are various tools, techniques, and
programming languages launched every year. To compete in the job market, you need
to learn the new tools and programming language. Thus, continuous learning becomes
your habit.

Computers only understand binary language. On the other hand, humans cannot work
with binary language at a level more than simple addition or subtraction.
Therefore, we have developed high level programming languages to interact with the
computer.

In programming, we first write a program in high level programming language like C+


+, Java, etc. After writing the program, we compile it. After compilation, a
machine code is generated. The machine code is in binary language and thus
understood by the computer. So, Coding works in three steps namely writing program
in high level programming language followed by compilation and then execution of
the compiled binary code.

There are different types of programming languages with different use cases.

FORTRAN and ALGOL are algorithmic languages mainly designed for mathematical and
algebraic computations.
COBOL and SQL are business oriented programming languages mainly used by businesses
in their operations.
Pascal, Basic, and Logo programming languages are mainly used for educational
purposes.
Python, Java, C++, C#, Ada, and Visual Basic are object oriented programming mainly
used for developing applications. These languages map each real world entity into a
software object. Hence, these languages are most suitable for creating complex
applications with numerous functionalities.

If you want to become a software engineer specialized in app development, you can
start with an object oriented programming language like Python, C++, or Java.
If you want to get into web development, you can start with HTML and CSS for Front
end web development. Subsequently, you can learn to code in JavaScript. Knowing
JavaScript will help you in getting started with various advanced tools for web
development.
If you want to get into data analytics, You can start with SQL or Python.

Following are links to resources in some of the software engineering subdomains.

Introduction to Web Development


Introduction to Web Design
Introduction to App Development

Learning coding has many benefits – whether you’re looking for a career in the
industry, starting a new hobby or just wanting to understand technology. Continue
onto the next page to find out about the benefits of learning coding. You might
also like this article on advantages of being a programmer.

First Website
So your dream is to have your own website. But you don’t have the coding skills to
create it.

Now’s the time to turn your dream into a reality! All you need to make a static
website is a knowledge of HTML and CSS code, the basic languages of websites. If
it’s a dynamic website you want – like a web application – you may also need
JavaScript and/or server-side scripting.

When you’ve written your code, you’re ready to upload your website to the Internet.
It’s as simple as that. For this, you’ll need a domain name (your website’s
address) and a web host (the company that manages your website’s server).

Website Help Articles


The following series of articles will show you how to get your first website
published.

What is Needed for a Website?


As well as HTML and CSS, you need to test your website, buy domain and hosting,
upload your files and more. Find out how to set up these things the right way, with
minimal stress.

Simple HTML Template


Get a head-start creating your first website. Here is a simple HTML template with
the basic structure you need for a web page.

Static vs. Dynamic Websites


When thinking about making your website, it’s important to identify whether you
want it to be static or dynamic. Learn the difference between these two types of
sites.

Client Side vs. Server Side


There are two types of script on a dynamic site – front-end scripts and back-end
scripts, also called client side and server side scripts. Here’s an explanation on
the difference.

How to Learn Web Design


Your finished product should be well-designed, attractive and usable. Here’s how to
learn this important part of the website process, even if you don’t consider
yourself a creative person.
Hex Colors
n CSS there are two main ways of selecting colors. The first is to simply use the
color name, like this:

background-color: blue;
Obviously this is limited. A computer can display millions of different colors, and
remembering the names of every single one of them is impossible. And spare a
thought for that poor guy whose job it is to come up with the names!

This is why CSS uses hex codes, like this:

background-color: #DDEEFF;

You’ve probably used hex codes before. You probably use a hex color picker to
generate your codes. But it’s likely you have no idea what a hex code means or how
it’s generated. Learning this is surprisingly easy and satisfying, and once you’ve
got your head around it you’ll be able to write your own hex codes without the need
for a color picker.

Hex Codes Represent Red, Green and Blue


A computer screen displays a color by combining red light, green light and blue
light. 100% red, 100% green and 100% blue produces white. Zero red, zero green and
zero blue produces black. In fact, equal levels of red, green and blue, whatever
that level may be, will always produce a shade of gray.

The six digits of a hex code are in fact three two-digit numbers, each representing
the level of red, green and blue. So #000100 is zero red, the darkest possible
shade of green without being totally black, and zero blue. #010101, because the
three values are all equal, is the darkest possible shade of grey, and #020202 is
the second darkest. And of course #000000 is black. But what about #FFFFFF for
white – what do the letters mean?

Hex Codes Use The Hexadecimal System to Minimize Length


There are 256 possible shades each of red, green and blue (0 through 255). If we
wanted to produce white (the brightest levels of all three colors combined), we’d
need to write #255255255. That’s nine digits long.

Hex codes use the hexadecimal number system to make it possible for 256 numbers to
be represented with only two digits. Instead of counting 0 through 10 like our
regular decimal number system, it counts 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D,
E, F and then 10, followed by 11, 12, 13, 14, 15, 16, 17, 18, 19, 1A, 1B, 1C, 1D,
1E, 1F and then 20. Make sense?

This means that 256 numbers can be represented using only two digits, instead of
the 100 that are possible with our decimal number system (0 through 99). So the
highest possible two digit number is not 99 but FF (equal to 255). This is why
white is #FFFFFF, pure red is #FF0000, pure green #00FF00 and pure blue #0000FF.

Hex Codes Can Be Abbreviated


You may have seen hex codes like #FFF, #000, #0F0 or even #ABC that only use three
digits. This is just a shorthand of writing a code which is three pairs of
identical digits: #FFFFFF, #000000, #00FF00 or #AABBCC.

Come Up With Your Own Hex Codes


So now you know how a hex code is generated, it becomes possible to write your own
without the need for a color picker. Of course, a color picker is still the easier
option for more obscure colors, but for simple combinations like magenta (blue +
red, #F0F), cyan (blue + green, #0FF) or any shade of grey (examples
are #222, #555 or #CCC), knowing how hex codes work will save you a lot of time.

Free Binary Tutorial

Binary code is a system of representing numbers, letters, commands, images and


sounds. Amazingly, it uses only two types of information to do this – 1 and 0. The
strings of 1’s and 0’s that make up binary code may seem random, but of course
they’re not.

Binary code is at the absolute heart of anything that goes on inside a computer –
and yet it’s something that most code tutorials don’t cover.

Here’s an explanation of the fundamentals of binary. At the end you should have a
basic idea of what all those 1s and 0s mean.

Binary Numbers
The binary number system is a base-two system, meaning it uses two distinct digits
– 0 and 1. The decimal number system we’re all familiar with is a base-ten system,
meaning it uses ten distinct digits – 0 and 1, but also 2, 3, 4, 5, 6, 7, 8 and 9.

Counting in the decimal system, when all ten digits have been exhausted, the next
number is represented as ’10’. In the binary system, it’s the exact same. After 0
and 1 comes 10. In fact, here are the first 15 numbers expressed in binary:

0, 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111.
As you can see, the binary system counts up in a logical order, and whenever a
number made up of entirely 1’s is reached, an extra digit is added. This is exactly
the same thing that happens in the decimal system when a number made up of entirely
9’s is reached.

As you can also see, there are 16 distinct numbers that can be represented in 4
digits or less (1 through 15 as well as 0). This can be calculated because 16 = 24.

However, binary numbers in a computing context are always represented in 8 digits


or less – 8 binary digits forming one byte. The total quantity of distinct numbers
that can be represented in 8 digits is 28 = 256. 1 through 255 as well as 0.

So 255 in binary is 11111111.

Hexadecimal System
The hexadecimal system, or hex system, is closely related to the binary system.
Here’s why.

To represent the number 255 in binary, it takes 8 digits. That’s a lot, considering
the decimal system only needs 3 digits to represent 255. However, the hex system
goes one step further and allows the number 255 to be represented in only two
digits.

This is because the hex system is base-sixteen, and 162 = 256. In other words, the
highest number that can be represented with two digits in hex is 255. In other
words still, any 8-digit binary byte can be represented as a 2-digit hex byte.

This is great for both computers and humans. For computers, it saves space, and for
humans, it improves readability.

If you’re wondering, the 16 ‘digits’ that the hex system utilizes are the numbers 0
through 9 and then the letters A through F. F is the hex code for 15, and FF is the
hex code for 255.

DECIMAL BINARY HEX


0 0 0
1 1 1
2 10 2
3 11 3
4 100 4
5 101 5
6 110 6
7 111 7
8 1000 8
9 1001 9
10 1010 A
11 1011 B
12 1100 C
13 1101 D
14 1110 E
15 1111 F
16 10000 10

Binary Letters
Binary code representing numbers is pretty uniform – there’s only one way to do it.
However, there are multiple methods of representing letters and symbols in binary
code. These methods are called encodings.

For example, the ASCII encoding assigns unique binary bytes to 128 different
characters. This makes it possible to encode any string of text. This is the string
‘Hello World’ encoded in ASCII:

01001000 01100101 01101100 01101100 01101111 00100000 01010111 01101111 01110010


01101100 01100100

Each byte represents a letter (except for the one that represents the space between
the words, of course). The spaces between the bytes are only there to make the
binary more readable for us. Computers do not read them.

Other Applications of Binary


As well as numbers and letters, binary code can represent commands, images and
sounds – but that’s beyond the scope of this tutorial. It really is amazing how
just two digits can do so much.

How to Become a Coder in 6 Months: a Step-by-Step Action Plan

So you want to become a coder.

In short, the fastest and easiest way to become a coder today is to focus on web
development. In fact, you can become a well-rounded web coder in just 6 months, and
this article outlines a month-by-month plan for how to do that. It’s a loose guide
and the aim is to give you a general idea of what coding languages you might want
to learn, and in what order.

Month 1: Make a Simple Website (HTML and CSS)


Spend your first month learning HTML and CSS, the codes used to write websites.
HTML and CSS are arguably the two easiest coding languages to learn. They’ll give
you a gentle introduction to coding before you move on to bigger, more challenging
material. Also, you don’t need to buy any special web design software or web
hosting. All you need is your computer!

Designing and building your own simple website is the best way to learn HTML and
CSS. If you use training like Treehouse, you’ll be walked through this process. You
can also research HTML and CSS on your own, but it will be hard. It’s kind of like
having to first find the pieces of a jigsaw puzzle before you can assemble them.

It should take about a month to get a good, solid HTML and CSS foundation. Then,
you can move on to some real programming…

Months 2 and 3: Front-End Development (JavaScript)


JavaScript is a coding language that makes websites interactive. It’s a good
language to learn for two reasons:

it requires no installation
you can use it to build upon your HTML and CSS website.
JavaScript coding is sometimes called front-end development, because JavaScripts
are run on a user’s computer. Conversely, back-end development refers to scripts
run on a web server.

If you use Treehouse, you’ll get the opportunity to enhance your walked-through
HTML and CSS website with JavaScript. Then, when you feel you have a good grasp of
the language, design and build your own web app with JavaScript. To do this, you
will want to learn how to plan, design and build a coding project.

JavaScript is an exciting language with many possibilities, and will go a long way
towards you becoming a coder. Take two months to learn and start using it.

Months 4 and 5: Back-End Development (PHP or Rails)


The last piece of the web development puzzle is back-end development. If you can
create a website and write both front-end and back-end scripts, you’ll be a well-
rounded coder indeed.

Many websites use back-end scripts to fetch data from databases, or to share
content between multiple web pages. PHP is the most popular coding language for
back-end development. In more recent times, Ruby on Rails has emerged as a bit of a
competitor to PHP.

Choose one of the two to learn and specialize in. Many coders find PHP is more
beginner-friendly, while Rails has more of a learning curve. But the choice is up
to you.

If you use Treehouse, you’ll be walked through how to make a dynamic, interactive
web application with either PHP or Rails. Then, create your own simple web
application – like you did with JavaScript, but this time using PHP or Rails.

Again, give yourself two months to learn and start using either PHP or Rails. If
you want to learn both, give yourself at least two months for each one.

Month 6: Build Credibility


By your sixth month, you will know enough material to become a coder.
Congratulations!

However, you don’t have a university degree or any official certification. So if


you want to land a job, you’ll need to prove that you know what you’re doing.

There are two ways you can do this. The first option is to set up a personal
portfolio website, and sell yourself by showcasing the websites and web
applications you’ve created in your 6 months learning coding. The second option is
to build a big-time web application – one that makes use of everything you’ve
learnt, which you will deploy online for the world to see and use. This will take
you more than a month, but it will be worth it.

The final step is to go off job-hunting. You can search for coding jobs in your
area, or alternatively, you can choose to be a self-employed coder, either as a
freelancer or by starting a tech business.

The possibilities are, as they say, endless. Good luck!

How to Start a Coding Project

You’ve invested in good coding training, and you have some basic code skills under
your belt. If you’re up for the challenge, let go of the training and start working
on your own, self-directed project. You could choose to make a website, an app, or
whatever is relevant to what you’re learning.

Building a project is the fun part of coding, and it gives you useful experience.
So you want to make sure you do it well. We’ve put together a series of articles to
help you accomplish this. First, you’ll gather ideas for your first programming
project. Next, you’ll plan your programming project and lastly, build it!

Steps to Starting Your First Programming Project


The following pages will walk you through the process of planning and building
your coding project.

Step 1: Ideas for Coding Projects


Struggling to decide what you should make for your coding project? Here are seven
ideas that you can either use as is, or use as inspiration to think of your own
ideas.

Step 2: How to Plan a Coding Project


Don’t rush into your project blindly. Planning your project is an important part of
the process, and it will give you a better end result. Here’s how to turn your idea
into a proper plan.

Step 3: How to Build a Coding Project


Time to turn your plan into a reality. Learn about useful coding tools, sources of
help for when you get stuck, and putting the finishing touches on your product.

Let’s get started with Ideas for Coding Projects.

You might also like