Saturday, 6 July 2013

How C Programming Works




the c programming language is incredibly fashionable, and its straightforward to discover why. programming in c is efficient and provides the programmer nice deal'>loads of management. several different programming languages like c++, java and python were developed using c.
chances are increasing every day if youre a programmer, you wont use c completely specifically for your own personal work. though, there will be many learning c is highly beneficial, even if you do in fact dont utilize it often. heres why :
youll be ready to scan and write code for software that may be applied on several totally different kinds of laptop platforms, together with everything from small microcontrollers to desktop, laptop and mobile operating systems.
youll higher perceive what high-level languages are going to firmly do behind the scenes, an example would be memory management and garbage collection. this understanding will support you write programs that work additional efficiently.
if youre an data technology ( it ) specialist, you may conjointly enjoy learning c. it professionals usually write, maintain and run scripts as half of the job. a script may be a list of directions obtain a computers operating system to follow. to try bound scripts, the laptop sets up a controlled execution environment referred to as a shell. since most operating systems run shells based mostly on c, c shell may be a fashionable scripting adaptation of c used because of it pros.
this article covers the history behind c, appearance at why c is thus vital, shows examples of a basic c code and explores a few vital features of c, together with data types, operations, functions, pointers and memory management. though this article isnt an instruction manual for programming in c, it's role is cover what makes c programming unique within the manner that goes beyond those first few chapters on your average c programming guide.
lets begin by watching in which the c programming language came from, how it's developed and of course the role it's in software development nowadays.

How HTML5 Works




hypertext markup language ( html ) have been a core technology for the net since the first nineties. tim berners-lee created html in 1989 as an easy however effective procedure to encode electronic documents. the fact is, the original purpose the most web browser was to serve currently being a reader for such documents. twenty years later, the browser itself turned out to firmly be a portal to some realm of on-line media. thats why html5 isnt simply another html revision, however a comprehensive customary for how web pages work.
to higher perceive what makes html5 unique, lets flip the clock back alittle. in 1994, html was still in its first revision, mosaic and netscape dominated the browser market, and the vast majority folks had however to experience this new factor referred to firmly as world wide web. that year, html creator berners-lee headed a newly established web standards group referred to firmly as world wide web consortium ( w3c ).
though w3c may be a respected standards authority nowadays, the industrial players within the nineties browser market largely ignored those standards and blazed their own personal paths. by 1995, w3c had printed the second revision of one's html customary, and web newcomer microsoft was gaining ground with its internet explorer ( ie ) browser. microsoft largely ignored standards, and netscape struggled to take care of a respectable market share whereas ie began to dominate supply : harris.
throughout these early browser wars, web developers were challenged to run sites compatible with every new unleash of one's major browsers additionally as in the lesser-used opera and apple safari browsers. even if w3c had printed html 3. 2 in 1997, followed by html 4 in 1998, following the standards appeared less necessary than keeping up with browser-specific features. this went on till 2003 as soon as the community-driven mozilla foundation broke the trend. after its original mozilla browser unleash, followed by its firefox browser in 2004, the mozilla quickly hacked away at ies dominance. additionally, these new browsers truly followed existing w3c standards whereas accomplishing the objective.
whereas mozillas firefox continued growing by using the aging html 4 customary, mozilla joined apple and opera in 2004 to type a gaggle referred to firmly as web hypertext application technology operating group ( whatwg ). the intention of whatwg usually is to keep html development alive. though it originally hesitated, w3c joined the html revival in 2006. along, whatwg and w3c combined existing specifications for html and xhtml and additional developed them to firmly be able to produce the new html5 specification. that specification is currently maintained and printed by w3c supply : w3c, whatwg.
this article explores this new html5 technology. well inspect xhtml and different technologies who have gone into html5 and canopy the basic points of learn how to use html5 to make engaging, standards-compliant web content. well additionally check out a few exciting ways a person using html5 inside the web. lets begin by viewing the goals of html5 and why its equally than simply html.

Object Oriented Programming


Object Oriented Programming


Thinking Object-Oriented

Real Power

One of the more difficult jumps of the several leaps and bounds from procedural to object-oriented programming is conceptualizing the system you are programming. Thinking object-oriented is the real power of object-oriented programming, and even if we always program procedurally we may already be thinking object-oriented. We need to be able to see a system, a problem, or a program in terms of objects and their relationships to one another. When we do this any program will be much more simple and easy for us to grasp. It will be easy to picture how it works in our minds.

There are three ways to think object-oriented. One way it not better then another. They are all just different and each of them is used as we start use objects appropriately. I call these three ways the Top Down approach, the Bottom Up approach, and Real World Modeling.

Top Down

The Top Down approach in object-oriented programming give us a way to see the system as a whole. We break the entire system down into related parts. The Model-View-Controller design pattern (we’ll talk about design patterns in a later article) is an example of this. It breaks the system into three parts: objects related to the business model, display objects, and objects to handle user input.

When we use the Top Down approach we need to think of how the system can be broken up into logical pieces. We can slice up the entire system like I do a pie. First I slice the pie in half, then in half again, making four pieces, then in half again. I end up with nice evenly sized pieces, something I’ve never been able to do by slicing a piece at a time. Similarly with a program or system (which might be a small part of a larger system) we break it up into larger pieces, then smaller ones, then even smaller ones, until we have pieces of a manageable size.

We can see the Top Down approach thinking with a short example. Let’s use the oh-so-common ecommerce store. If we think of the system as a whole we know there will be data to keep, store functionality, and a good looking design that we want to change once in awhile. We can break our data section down into session management and a database object. We might break our store functionality into sections like the catalog, product reviews, the shopping cart, and the checkout. We can have our display section broken down into a general template and a caching template that will cache pages for reuse (so the database doesn’t have to work so hard). We can then go over each of the functionality sections and further break them down into small pieces and objects.

Bottom Up

The Bottom Up approach does not look at the system as a whole. Instead, it concentrates on grouping related functionality together. We see functions and variables as related and so put them together into an object. Then we see objects which interact or are related and put them together into a group (called a package, usually put into the same folder etc.) We can then group those object groups into larger and larger groups until we have the whole system accounted for.

Using this approach to think object-oriented we use two different steps. The first step is grouping functionality into objects. The second step is grouping objects into groups. For step one, we figure out what goes together. This can be easy if we already group our related procedural code into files. We may have a file that contains all of our database functions in it. Instead of having all the functions there sitting in the global scope and the variables they use (perhaps a connection variable, or a record-set variable), we can group it all into a database object, with properties such as the connection reference and functions such as query or closeConnection.

The second step is similar to the Top Down approach, just backwards. Instead of breaking a system down into parts, we are building it up from the pieces we know we will have. Grouping objects into larger and larger groups until we have the whole system makes it much easier to picture the internals of a system in our mind, and how things are actually working. It also allows us and others to easily find pieces of functionality to extend or fix because they are organized into folders and files (packages and objects) in a logical manner.

Model the Real World

Finally, Real World Modeling is one of the most powerful aspects of object-oriented programming. This is making objects that you know in the real world into objects in your system. Because we all live in the real world, it is easy for others to immediately understand what an object is and does if it is based off of something real world.

A customer, shopping cart, and product in an ecommerce store are immediately recognized and their interactions between each other are understood easily, because we can see the same interaction in our daily lives. We know that there can be many products in our shopping cart. We know that each customer may have a shopping cart to put their products in. We know that customers have names and addresses, and that products have names and prices. The programmatic shopping cart however may have related functionality that a real shopping cart may not have. It may be able to tell us the total price of all the products in it, where a real cart can’t do anything but roll around (something not needed in an ecommerce store).

The first thing you might do when developing a system is to discover all the real world objects in that system. Whether it is employees, supplies, offices, text characters, documents, buttons, or trash cans, they all help us think of the system easier and model it better. We already know many of the objects’ interactions and who “owns” what (the customer owns the shopping cart and the cart owns the products). These real world objects may even be the groupings of objects instead of the objects themselves. Or they may be objects that help group others. You might have a department object with its employees and manager.

Once you have the real world objects you can then group them. The shopping cart, order, and checkout might go into the same section. You may put products and categories into the catalog group. Customers and store admin may be their own group.

Object-Oriented Thinking

Object-oriented thinking has been around even before object-oriented programming. People do it without knowing it might be called object-oriented. It helps us conceptualize a system and better grasp it. It helps us wrap our mind around a system without blowing a fuse. It makes programming easier for us and easier for others coming to our code. Object-oriented programming was created to make it easy to transfer our object-oriented thinking into code, although we can still program procedurally our object-oriented design. This is the real power of object-oriented programming.