Android OS Forum banner
1 - 1 of 1 Posts

Premium Member
4,348 Posts
This is not meant to be a full scale guide for everything you need to know to start out programming. If you want that, get one of the head first books and then read the stuff below as you read that book ( Also not offering to be anyone's unpaid tutor (but I will answer small questions). This is mostly meant to be a plain English way to relate abstract programming terms that are common to nearly any programming language. Many books/teachers/developers have a poor understanding of how to relate such things, so hopefully this will assist in learning.

Few small things that will help you though starting out (some of this will only make sense though when you encounter it in your reading so you may have to come back and reread this):

algorithm = a set of directions. In generic terms, it does not have to apply to programming. It could be map directions, a food recipe, blueprints, or some lines of code that tell the pc to do something. In more specific terms, there are known accepted algorithms widely used throughout the development community as a whole, because they are generally accepted to be as optimal as possible. Such algos would be various methods of sorting (quick sort, insert sort, shell sort) or searching.

an application = composed of many packages/namespaces

packages/namespaces = they're a collection of related classes. They're composed of a bunch of related classes (papers/essays) that make up the functionality of something bigger than just the class itself.

classes = think of them as a paper/essay/report (or blueprints). each holds stuff that's related to the class in an organized manner. LIke a paper, a class should have a specific topic and the only stuff that should go in the class is stuff related to that topic. If you add something to the class that isn't related to topic, it should go elsewhere. Example, if you are writing a class related to how to turn on a car fm/am radio, you wouldn't want to start including stuff related to cd player since that's a separate (though related functionality). However, each is different enough, they should be separated. It's a little more detailed than that, but not important when starting out. You can think of a class as having a bunch of related algorithms as well.

functions/methods/subroutines (all the same thing essentially, but methods are generally referred to as functions inside of a class versus ones separate from a class, I'm just going to call them functions though) = functions are like paragraphs. they make up the body of the class and each function is geared towards a specific subject. If a function starts doing stuff not related to the specific subject, it should go in its own function (like a paragraph).

braces (that is {}) = denote the "border/boundary/scope" of an area in many programming languages (at least in java/c/c++/php/c# they do). Think of them as like miniature islands where what is within the {} cannot be accessed from outside of the {} because its on its own little island. Sometimes a developer is lazy and does not add {}. In that case, only the line immediately after where the braces would have gone is part of that island.

variables = think of them as single buckets that hold some sort of data (numbers, characters, multiple characters, etc). variables can either be local and only within a function. The boundary for most variables (see below) is usually the island of the function they are used in, but sometimes you need to use the same variable throughout a class and those type of variables are generally called properties/members.

members/properties = variables that can be used throughout the entire class. Why aren't all variables able to be used throughout a class? Because it would waste memory. If a variable is only needed within a certain island/scope, then that's all it should be limited to. Generally members/properties should be well thought out to decide if each is really needed for the entire existence of a class).

--These are all various kinds of variables (in java at least, but all programming languages have similar ones)--

character (char) = a single letter

string = technically it's an array of characters (see below), but for understanding it, think of it as a sentence or as many characters you want to put together and store in a variable.

integer = just a whole number (-10, 0, 4, 1000, whatever).

long = really really large integers

short = really small integers (generally you can just use "int")

float/double = floats and doubles are 2 different types of data, but floats are just for smaller decimal values and doubles are for larger ones (really large ones).

arrays = think of them as a bunch of buckets tied together holding similar data, you can look into each one and and find what info is in each bucket at whatever position (from 0 to whatever length).

collections = these are just specialized types of arrays that perform better than arrays under certain conditions depending on what you are doing. They also have more functionality than a basic array, but using the wrong one for the wrong type of work can make the code harder to write or slow down your application. There's rules about which one to use you'll get to eventually (called "big oh" notation [also written as "Big O notation" sometimes]).

objects = if a class is the blueprints that tell how to do something, an object is the finished product of the blueprints/instructions. Objects are just individual creations of using a class. In other words, its like you inserted the blueprint instructions into a machine (the class) and then pressed a button and out comes an object. The object then lets you use the functionality of the class you wrote elsewhere in a neat tidy little variable that holds all the functionality of that class within the scope of whatever island it is currently resides in.

There's obviously way more details to it than this, but hopefully that will help as a supplemental reference when you are reading stuff elsewhere.
1 - 1 of 1 Posts