Programming Basics
A lot of programming languages share similar concepts, Knowing these basic concepts and common terms will help you relate to other programmers as you engage in different experiences. For this reason we will begin understanding what syntax is, some common terminology and some small but very important pieces of advice.
|
|
Before we begin....
Wire framing
The logical place to start the actual design process is with a rough wireframe. Think of wireframes as the skeleton that loosely shapes the final product, giving you a reliable idea of where everything will eventually go. They help provide clear communication between programmers, graphic designers, editors, developers, costumers and anyone else involved in the project. Next comes the mockup or the skin. Mockups are strictly visual and are where you solidify your visual decisions and experiment with variations.
With the prototype, you breathe life into your creation. Prototypes test your user interface (UI) which is everything that the user will interact with, including display screen, keyboard, mouse, light pen, the appearance of a desktop, illuminated characters, help messages, and how an application program or a Web site invites ideas and generates feedback necessary to keep the design headed in the right direction. Prototypes are functional wireframes or models of the eventual product. They can (and should) be used during every stage of the design process. Remember that wireframes are only a means to a prototype. In other words, prototypes are the most functional, useful documentation you can create. Wireframes just help you focus the placement of content for your prototype. |
|
"Five weeks of Programming can save you one week of planning"
Basic Programming Terms and Concepts
SyntaxIn computer science, the syntax of a programming language is the set of rules that define the combinations of symbols that are correctly structured programs in that language.Think of it like grammar. There are certain rules to any language that allow you to create correct combinations of words and punctuation that allow you to communicate. This is the language's syntax. Even things like email addresses and Twitter handles have a certain syntax. If I were to ask you which of these is an email address and which is a Twitter handle, you would know from the structure:
@MrEricksClass [email protected] *If you can figure it out, feel free to follow me on Twitter ;-) |
Hello World!
A “Hello, world!” program is a computer program that outputs “Hello, World!” on a display device. Often it is the first things a programmer will learn how to do when learning a new language, as it is typically a simple program in almost all computer languages. As such it can be used to quickly compare syntax differences between various programming languages. It is also used to verify that a language or system is operating correctly.
Algorithms
Algorithms are a set of clearly defined steps rules, often with branching because some rules generate yes or no answers while others take multiple inputs. that make the Computer and machine algorithms are very rigid or strict. You might decide not to hate apples for today and change your mind tomorrow, but computer programs rarely have flexibility when they run their rule set. Predicting then accounting for possible dead ends and errors is a key programming skill for software engineers. Algorithms are independent of programming languages. That means it can be converted into any programming language. When we write algorithms, we need not consider elements unique to the language of our choice.
|
|
Variables and Constants
A variable is a way to store some sort of information for later use, and we can retrieve this information by referring to a “word” that will describe this information. This concept is extremely powerful in programming and is used constantly. For example, let’s say you come to my website www.mehcomputerscience.weebly.com and the first thing I want to do, is ask you what your name is (so that I can greet you in a nice way the next time you visit my website). I would put a little text box on the screen that asks you what your name is. That text box would represent a variable! Let’s say, in my code, I called that text box ‘yourName’, that would be the symbolic name (or “word”) for your variable. So now, when you type your name into that text box, that information would be stored in a variable called ‘yourName’. I would then be able to come back and say “What value does the variable ‘yourName’ contain?”, and the program would tell me whatever it was you typed into that text box. I could then translate that "variable" into other sections of my website to greet you on every page without typing everyone's names on every page. Constants are the same as variables, except their initial value does not change during the execution of the program.
Data Types
Unlike a person, a computer does not know the difference between "1234" and "abcd." A Data Type is a classification of the type of data you are using. When programmers create computer applications, data types must be referenced and used correctly to ensure an error-free program. Understanding the different data types allows programmers to design computer applications more efficiently and accurately.
Common examples of data types Boolean (ex. True or False) Character (ex. a) Date (ex. 03/01/2016) Floating-point number (ex. 1.234) Integer (ex. 1234) String (ex. abcd) Void (ex. no data) |
Data Structures
A data structure is a particular way of storing and organizing data in a computer so that it can be used efficiently. Let’s say we have a list of contacts, and that list of contacts could grow (or shrink) at any given moment. If you were to try and represent all those contacts as variables in a computer program, how would you do it? Well, there’s a right way, and a wrong way. For the purposes of our example, let’s say we need to keep track of 10 contacts. If we need to store 10 contacts, we would probably define 10 variables, right? This presents two problems 1) The amount of text you'll need to write in your program. Sure, right now we only have 10 contacts, so it’s not too bad, but what if we had 1,000 contacts! Imagine typing that out a thousand times! Forget about it! 2) The Flexibility of the code. If we need to add another contact, we wouldn’t be able to do it without manually editing our code. We would have to go into our code, physically write out contact #11, and then try to store whatever information is needed into the new variable. Data Structures give us a way to store a bunch of data in certain ways (such as list) in this manner we can add and remove things from the "list" with ease. So if you started with 10 contacts, it’s a piece of cake to add another contact to the list. In essence, a data structure is just a way to get around having to create tons of variables.
Control Structures
A control structure is a block of programming that analyzes variables and chooses a direction in which to go based on given parameters. The term flow control details the direction the program takes (which way program control "flows"). Therefore it is the basic decision-making process in creating an effective program. Data Structure and flow control determines how a computer program will respond when given certain conditions or parameters.
|
Operators
Operators are symbols that tell the compiler to perform specific mathematical or logical manipulations. Some Mathematical operators are add, subtract, multiply, divide, compare (greater than, less than). Logical Operators can change the course of a computer program with the concepts and, or and not.
Debugging and Commenting
Debugging is the process of finding and resolving of defects that prevent correct operation of computer software or a system. You can make this process easier for yourself and anyone reading your code by inserting comments into your code. Comment can be written into all computer languages and can be written in added to your written in pseudocode or normal (human) language. These comments are meant for the human programmers to read and your program will know to skip them because you will identify them by following the syntax rules of whichever language you may be using. Comments can be coded into every programming language.
Integrated Development Environment
An Integrated Development Environment (IDE), is software that acts as text editor, debugger and compiler for the chosen language you want to work in. It's the environment, world or software that you are typing your code into and running it as a program. An IDE normally consists of a source code editor, build automation tools and a debugger. Many IDEs will check the syntax of your code to ensure you don’t have any errors, they will organize your files and give you a nice way to view them (ex. applies color schemes to your code so it’s easier to interpret), IDE's tend to have code completion, which will actually fill in some code for you in common scenarios as well as allow you to navigate through your code easily. If you're aiming for a multi-language career later on, you might consider learning the ropes of a multi-language IDE to practice coding in a variety of languages.