Computer Programming: From Beginner to Badass—JavaScript, HTML, CSS, & SQL
By Zack Fleming and Steven Webber
3/5
()
About this ebook
Description
Inside, you will find an introduction to JavaScript, HTML, CSS, and SQL. These are computer programming languages. Some of them are more precisely referred to as scripting languages.
Starting with JavaScript, I will introduce you to the above-mentioned programming languages. Hopefully, by the end of this book, you will have the answers to the questions of what it is and what you can do with it.
JavaScript is a programming language that allows for the implementation of complex items on static web pages. Every time you look at a web page that does something besides display static information, it is a pretty safe assumption to make that JavaScript is involved. It is often referred to as the third layer of the cake.
HTML is a relatively simple programming language that, at its core, consists of elements. These elements allow you to distinguish different sections of text as different aspects on your page. Whether it be a paragraph, a heading, a column, or whatever you need it to be—this is accomplished with the use of these elements.
This language is also where you get the ability to create hyperlinks. The use of hyperlinks is very important, especially when you want to be able to direct someone to a specific part of your text or page.
CSS is a programming language that is used to style and structure the layout of a web page. If you want to change your font, color, and background, you may do so by adding an animation or design a specific outline. This is the language you're going to make use of to accomplish those things.
CSS makes use of the box model—most elements are represented as a box with the content, padding, and borders built-up like layers on an onion. You need to understand the box model before you can begin to understand how to create CSS layouts.
Meanwhile, SQL is a programming language that is designed to work with sets of facts and how they relate to each other. As you might expect, relational database programs make use of SQL. Like many other computer languages, SQL is, in fact, an international standard. However, SQL is easily read and understood even by beginners.
Data sets are described in SQL using SELECT statements. An SQL statement is like a sentence and consists of clauses. Some clauses are required in a SELECT statement.
Related to Computer Programming
Related ebooks
HTML5 and CSS3 All-in-One For Dummies Rating: 0 out of 5 stars0 ratingsLearning jQuery 3 - Fifth Edition Rating: 0 out of 5 stars0 ratingsHTML in 30 Pages Rating: 5 out of 5 stars5/5Learn HTML Programming in 7 Days: Ultimate Beginners Guide to Build and Design Your Own Website Rating: 4 out of 5 stars4/5Javascript For Beginners: Your Guide For Learning Javascript Programming in 24 Hours Rating: 3 out of 5 stars3/5HTML & CSS: Learn the Fundaments in 7 Days Rating: 4 out of 5 stars4/5Responsive Web Design with HTML5 and CSS3 Rating: 4 out of 5 stars4/5Coding For Dummies Rating: 5 out of 5 stars5/5HTML5, JavaScript, and jQuery 24-Hour Trainer Rating: 2 out of 5 stars2/5HTML Beginner's Crash Course: HTML for Beginner's Guide to Learning HTML, HTML & CSS, & Web Design Rating: 4 out of 5 stars4/5HTML5 For Dummies Quick Reference Rating: 4 out of 5 stars4/5Beginner CSS: Like Putting Lipstick on a Zombie: Undead Institute, #2 Rating: 0 out of 5 stars0 ratingsPython: Programming For Intermediates: Learn The Basics Of Python In 7 Days! Rating: 0 out of 5 stars0 ratingsLearn to Code. Get a Job. The Ultimate Guide to Learning and Getting Hired as a Developer. Rating: 5 out of 5 stars5/5JavaScript: Tips and Tricks to Programming Code with Javascript Rating: 0 out of 5 stars0 ratingsJavaScript: Beginner's Guide to Programming Code with JavaScript Rating: 5 out of 5 stars5/5Python Programming Rating: 0 out of 5 stars0 ratingsPython Programming : How to Code Python Fast In Just 24 Hours With 7 Simple Steps Rating: 4 out of 5 stars4/5Python: Programming for Intermediates: Learn the Fundamentals of Python in 7 Days Rating: 4 out of 5 stars4/5Python Programming: Your Advanced Guide To Learn Python in 7 Days Rating: 0 out of 5 stars0 ratingsProblem Solving in C and Python: Programming Exercises and Solutions, Part 1 Rating: 5 out of 5 stars5/5Python 3 Object Oriented Programming Rating: 4 out of 5 stars4/5Python Essentials Rating: 5 out of 5 stars5/5Wb Development full course : from zero to web hero Rating: 0 out of 5 stars0 ratingsMastering Python Rating: 0 out of 5 stars0 ratings
Programming For You
Coding All-in-One For Dummies Rating: 4 out of 5 stars4/5Learn to Code. Get a Job. The Ultimate Guide to Learning and Getting Hired as a Developer. Rating: 5 out of 5 stars5/5Python Programming : How to Code Python Fast In Just 24 Hours With 7 Simple Steps Rating: 4 out of 5 stars4/5Python: Learn Python in 24 Hours Rating: 4 out of 5 stars4/5SQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5Excel 101: A Beginner's & Intermediate's Guide for Mastering the Quintessence of Microsoft Excel (2010-2019 & 365) in no time! Rating: 0 out of 5 stars0 ratingsSQL All-in-One For Dummies Rating: 3 out of 5 stars3/5Excel : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Excel Programming: 1 Rating: 5 out of 5 stars5/5Coding All-in-One For Dummies Rating: 0 out of 5 stars0 ratingsLinux: Learn in 24 Hours Rating: 5 out of 5 stars5/5Python Machine Learning By Example Rating: 4 out of 5 stars4/5Python: For Beginners A Crash Course Guide To Learn Python in 1 Week Rating: 4 out of 5 stars4/5Learn SQL in 24 Hours Rating: 5 out of 5 stars5/5Python Data Structures and Algorithms Rating: 5 out of 5 stars5/5Coding with JavaScript For Dummies Rating: 0 out of 5 stars0 ratingsLearn PowerShell in a Month of Lunches, Fourth Edition: Covers Windows, Linux, and macOS Rating: 5 out of 5 stars5/5A Slackers Guide to Coding with Python: Ultimate Beginners Guide to Learning Python Quick Rating: 0 out of 5 stars0 ratingsJavaScript All-in-One For Dummies Rating: 5 out of 5 stars5/5Spies, Lies, and Algorithms: The History and Future of American Intelligence Rating: 4 out of 5 stars4/5
Reviews for Computer Programming
1 rating0 reviews
Book preview
Computer Programming - Zack Fleming
Introduction
Congratulations on downloading Computer Programming: From Beginner to Badass—JavaScript, HTML, CSS, & SQL, and thank you for doing so! The world is growing increasingly digital, and downloading this book is the first step you can take towards actually doing something about keeping pace with it. The first step is also never the easiest, however, which is why the information you can find in the following chapters is so important to take to heart, as they are a roadmap for your journey.
Starting with no knowledge in computer programming, you will be taught by this book about how to understand the different programming languages you will encounter and show you how to construct a web page. Learning the principles and practicing with them will give you the keys to unlock a whole new level of understanding of computers and how they work.
A key part of computer programming is the ability to fix the programs, also known as debugging—finding the errors and being able to correct them. I will include some instruction in this area, in the hopes of you being able to be well-rounded in your knowledge when you are finished reading this book.
I have tried to start with the basics to ensure that you have a solid foundation. Then, I have layered key elements in that are essential to possess in order for it to work for you. I have not included every possible nuance, as there just isn’t enough room in the book. I do believe that you will have a solid understanding of the components necessary for you to be able to begin practicing. After all, that is where all the experience and the best understanding come from.
I have tried to make this book not only informative but also interesting as well as efficient. I have tried not to ramble on too much—sometimes you get on to a point that you find so moving and you go on and on about it and everybody else is like, Okay, got it already. Let’s move on.
I tried to avoid those types of scenarios while keeping it from becoming too dry at the same time.
I will spend some time focusing on testing web projects on different browser platforms. I will touch on how to mitigate different types of code and how to go about doing testing. I will delve into using automation in your testing and show you how it can speed the process up for you. I will also mention which tools will be the most useful in fixing problems as well as in testing for them. In spoken language, we tend to emphasize certain words or syllables to manipulate the meaning of what we’re saying. It is no different with a programming language, except that the method we tend to stress the words with is italics. In HTML, you would use the element to perform this task. This will make the document more interesting to read—screen readers recognize these, and they will be spoken in a different tone.
Chapter 1—The Basics in Programming with JavaScript
C:\Users\Work\Downloads\pankaj-patel-516695-unsplash.jpgWhat is JavaScript?
you may be asking. It is a computer programming language. It is used to add interaction to your website. This can take many forms—whether it be a game, a reaction when a button is pushed, or perhaps someone entering data in a form.
These may be some of the questions you’re thinking to yourself, among a myriad of others that you have no answers to. While it may not be entirely necessary when it comes to learning the language, I thought in the interest of being thorough, that perhaps I should start you off with a little bit of history.
In the early 1990s, there was a flourish of activity and businesses being formed. The main area of activity was in the browsers that were competing to be number one. In 1994, Mosaic Communications was founded in California. Its authors were tasked with creating Mosaic Netscape and ensuring that it contained no code that had been previously used in NCSA Mosaic, which was the first popular graphical web browser that had been released. An interesting note that shows the mindset of the times is that the company internally codenamed their browser Mozilla,
which meant Mosaic killer.
In 1995, Brendan Eich was recruited by Netscape Communications. In May of that year, it became apparent that in order to defend the language they wanted to create, they would need a prototype. The writing of this prototype was accomplished by Eich in ten days. Although developed under the name Mocha, by the time it was deployed in December, it had been renamed JavaScript.
JavaScript was adopted by Microsoft in 1996 and was part of Internet Explorer 3. However, it was still rapidly gaining a reputation for being a roadblock to a cross-platform standards-driven Web. In the attempt to obtain standardization, Netscape turned to ECMA International—and in December 1999, ECMAScript3 was released. This is the modern-day baseline for JavaScript.
JavaScript is almost entirely object-based—and whereas many of the competitive languages use classes for inheritance, JavaScript uses prototypes.
JavaScript is extremely versatile, making it an excellent place for the beginning programmer to start. Start small with perhaps an image gallery or programming a response to a button click—and then as your experience expands, you’ll be able to create more complex, detailed projects as well as perhaps some database-driven apps, if you so desire. The sky is the limit—well, that and your desire to learn.
JavaScript is extremely flexible while remaining fairly compact. There have been a large number of tools developed that operate on the basic JavaScript language. This allows for unlocking incredible amounts of functionality with a minimal amount of effort. Some examples would be Application Programming Interfaces commonly referred to as API’s as well as third-party Application Programming Interfaces. There are also third-party frameworks as well as libraries, which add more functionality to the language.
Some of these functions can be used in conjunction with HTML, CSS, and SQL, but we’ll delve into that a little further in later chapters. I will cover Application Programming Interfaces more thoroughly at a later date. For now, suffice it to say that APIs will expand your knowledge and thus your abilities once you’re ready to get to them. At this point, they would likely just confuse you and slow you down.
At this point, you are most likely really excited, and you should be! JavaScript and the learning of it will unlock the unlimited potential for you as far as programming is concerned. JavaScript can take a little more time in acclimating to than some of the other languages, however, if you start small and consistently move forward, you will get there.
Let’s start with something simple—a commonly used first example in many programming languages is the Hello World
example. Hence, let’s do that one—here it is in a few simple steps.
A common place to begin is to create a folder, and typically, I would give it the name scripts
without the quotations. Then, open that folder and create another new file. Give this one the name of main.js
and again leaving out the quotations. Now, once you are ready and have already saved this, you should notice that unless you specify otherwise, it will save in your scripts folder. Don’t specify anywhere else.
Next, you will need to open your index.html file. Once it is open, you will need to scroll to the bottom of the body content and enter the following element:
This is how you activate the JavaScript you have just written to make it do something on the page. Without this, it would have no effect on anything on the page.
Ensure that your work is all saved, then click on your browser’s navigation bar and enter index.htm. Once you press enter, this should produce your Hello world!
greeting.
Congratulations, you’ve just done your first programming in JavaScript. This is probably the best time to point out