Tuesday, December 06, 2005

Topic of the Day: Why functions

Functions are the basic building blocks of programming either be procedural or object oriented.
We all know to write functions possibly in every language we learn (
How?) C,C++,Java,C#,PL/SQL,JavaScript,VBScript,Python etc., There are several different opinions/reasons/views on why use functions. A common notion among most developers are that functions improves reusability (technically speaking it is ability to use in multiple programs) but it is not just that.My introspective view reveals the following (for Why?)

  1. Readability: Simplifies my program by substituting a complex set of commands (instructions or statements) with English words (call instruction - name of function). Eg: Sum(100,200)
  2. Reusability: Eliminates repetitive code (redundancy) within the program. Program becomes smaller.
  3. Testability: Simplifies unit testing.
  4. Stability: Well unit tested functions leads to a stable program.
  5. Extensibility: Easier to add new features as the program is now smaller,readable,testable & stable. This apart from the fact whether the new extension uses the existing functions or not.
  6. Maintainability: Stable & extensible programs are easier to maintain.
  7. Productivity: Easier maintainable programs increases our (Developer's) productivity.
  8. Technicality: Information hiding or better execution (say recursive). This is more of When? to write functions.
So next time you write a bunch of statements (code) think whether writing them as a function solves even any one of the above top 3 reasons & if so then write them as functions.

May be I'll write samples to substantiate this introspection of mine over this week end.

5 comments:

Anonymous said...

Web hosting is a server in regard to serving and maintaining files for one or more network sites.
A web hosting service is a personification of Internet hosting service that will help an person, house, kind, superintendence plan and more hamlet their website on the World Large Web.
[url=http://www.jkahosting.com]Web hosting [/url] companies present order on a server on the side of take via their clients as well-head as the internet accessibility required to bag on the web.
Sober-sided more vital than the computer lacuna is a innocuous territory in return the files and a loose linking to the Internet.
There are many divergent types of web hosts, control panels, operating systems, and options.
In addition there are included services such as website builders, search motor marketing, database deployment, and online stores.
So how do you grasp what to exploit and who to rent it from?
Since they are so numerous options this can be confusing.
The first responsibility you extremity to decide is if you want a Windows web host or a linux snare host.
Much of the old hat it does not matter however if you be undergoing specific software to play such as a shopping cart or database bearing this will be important.
It is best to find out cold from your software provider the requirements of the program.
Then you longing call to umpire fix on if you demand a province name and the amount of latitude and bandwidth needed.
Various web hosting companies literally give away domain names to unique customers so this may help sweep your business.
In beyond uncountable network hosts also issue a leviathan amount of leeway and bandwidth in their hosting plans hoping you desire not in fact need it.
So at once that you keep adamant on the operating methodology and how much you scarcity now contract out us look at the options.
A most habitual option is the from of a unshackled website builder. This can be grave if you should prefer to no or little event with html programming. If you from some participation and resort to a database you will then difficulty to conclude how assorted databases you require. Some hosts purposefulness give you boundless databases and some price per database. There are also varied other freebies convenient such as automatic hand (software) ordination, shopping carts, templates, search apparatus optimization reinforcement, unlimited discipline hosting and much more. Spam interdicting is also an powerful be involved you should assume from your host.
At once that you maintain start the options you are looking seeking it is mores to look against a host.
Wow! There are so many. A sincere search against the sitting web entertainer last wishes as make thousands of results. So who do you choose?
A web innkeeper should at all times be within reach in for fear that b if you have occasion for assistance. At the least they should have in the offing a facilitate desk and faq quarter in example in any event you have questions. If feasible a phone several is also helpful. They should also provide a rapid server so your website is instantly prominent and not slow to view. In uniting they should provide no or extremely young downtime. This is when your website is not visible at all. When all is said your files should be in a secure environment. After all you do not stand in want someone accessing your files or infecting your website with malware.
To conclude they are various snare hosting options and hosts. It is important to do your homework to put one's finger on the tucker lone pro your website.

Anonymous said...

Web hosting is a server over the extent of serving and maintaining files looking for one or more net sites.
A web hosting service is a genus of Internet hosting overhaul that longing assist an special, house, school, government syndicate and more consider their website on the To the max Wide Web.
[url=http://www.jkahosting.com]Web hosting [/url] companies purvey play on a server someone is concerned take advantage of via their clients as well-head as the internet accessibility required to get on the web.
Sober-sided more important than the computer period is a unpolluted environment in the course of the files and a bound bearing to the Internet.
There are many unique types of trap hosts, put down panels, operating systems, and options.
In totalling there are included services such as website builders, search motor marketing, database deployment, and online stores.
So how do you know what to use and who to hit it off with b manage it from?
Since they are so numerous options this can be confusing.
The prime responsibility you want to settle on is if you hope for a Windows cobweb tummler or a linux web host.
Much of the time it does not affair come what may if you have determined software to play such as a shopping cart or database relevance this force be important.
It is best to discover outlying from your software provider the requirements of the program.
Then you longing call to come to a decision on if you necessary a sphere prestige and the amount of leeway and bandwidth needed.
Profuse net hosting companies in truth occasion away territory names to up to date customers so this may staff sweep your business.
In addition scads web hosts also swap a huge amount of duration and bandwidth in their hosting plans hoping you disposition not truly call it.
So instanter that you keep decided on the operating technique and how much you lack at once fail us look at the options.
A very trendy election is the abhor of a unfettered website builder. This can be eminent if you should prefer to no or midget wisdom with html programming. If you have some event and scorn a database you will then distress to decide how many databases you require. Some hosts will-power cede you immense databases and some direct blame per database. There are also varied other freebies available such as spontaneous hand (software) installation, shopping carts, templates, search machine optimization assistance, unlimited province hosting and much more. Spam interdicting is also an outstanding spot you should assume from your host.
Things being what they are that you have set the options you are looking representing it is point to look for a host.
Wow! There are so many. A sincere search in search the sitting trap innkeeper drive cast thousands of results. So who do you choose?
A trap innkeeper should usually be within reach in for fear that b if you need assistance. At the least they should have in the offing a support desk and faq square in cause you secure questions. If possible a phone figure up is also helpful. They should also take precautions a rapid server so your website is instantly detectable and not cloddish to view. In putting together they should afford no or entirely bantam downtime. This is when your website is not observable at all. Finally your files should be in a established environment. After all you do not call for someone accessing your files or infecting your website with malware.
To conclude they are varied entanglement hosting options and hosts. It is prominent to do your homework to bump into uncover the tucker one for your website.

Anonymous said...

Famous American Drug Trafficking Mechanic
clomid medication
Clomid is a drug that is commonly used by professional athletes to improve their performance.
[url=http://buynaturalbathproducts.com/]generic clomiphene[/url]
Extremely rare side effects include ovarian hyperstimulation syndrome and reversible alopecia.
http://buynaturalbathproducts.com/ - buy clomiphene online

Anonymous said...

amaron car battery price mini fumer bad ford i lyric wanna willa bickel race car chevrolet dealers portland oregon

Anonymous said...

9137.....17620