Showing posts with label Computer programming. Show all posts
Showing posts with label Computer programming. Show all posts

NS2 installation problems in ubuntu

Posted by Shashank Krishna Sunday, October 11, 2009

The ns2 version taken here is 2.31, if you downloaded any other version, please modify your version during installation

1)Uncompress the ns2

tar zxvf ns-allinone-2.31.tar.gz
or
gzip -d ns-allinone-2.31.tar.gz
tar xvf ns-allinone-2.31.tar

2) cd /opt/ns-allinone-2.31 (since /opt is the folder which is unused, so i have selected that folder to install, however you can install that in any folder)

3) ./install (execute the command)

4) If the installation fails in the middle, then try to install the linux packages that are

necessary to run NS2. (In any linux (ubuntu or fedora or redhat or suse), install the TCL/TK, Perl packages during the installation of linux...)

Common errors

While installing ns2, sometimes we get errors some of them are mentioned below (as keywords used to search). Apart from these errors there are many other types of errors also which occurs.

  • tcl8.4.18 make failed! exiting…
  • tk8.4.18 make failed!
  • make: *** [tk3d.o] error 1 tk8.4.18 make
  • tk8.4.18 make fail

Here are some steps and precautions to install ns2 in one shot.

  1. Always install your linux distro with full programming support, this will help you to install ns2 more easily, here programming support means support for perl, tcl, gcc etc.
  2. Also install this packages

    install autoconf

    install automake

    install gcc-c++

    install libX11-devel

    install xorg-x11-proto-devel

    install libXt-devel

    install libXmu-devel

Now try installing ns2, hope it should get install properly

5) Once the installation succeeded, then the path information will be provided by the NS2

6) Set the path in the /root/.bash_profile
(vi /root/.bash_profile)

or
If you are a user home//.bash_profile (for example, if your the username is tsp, then execute this command vi /home/tsp/.bash_profile)
7) set the PATH and the LD_LIBRARY_PATH according to the point number 11.

8) logout and login.

9) go to the terminal and try ns or nam





Why Pair Programming Works...

Posted by Shashank Krishna Saturday, August 1, 2009


Pair programming is like magic in more ways than one. It dramatically improves programmer productivity and reduces bug count, and yet it does so through a technique that’s completely counter-intuitive. You can’t help but think that there’s some trick yet to be exposed; that pair programming is just slight of hand. In this article, I will endeavor to pull back the curtain and reveal the secrets of the pair programming magicians.

Specifically, I identify six reasons pair programming succeeds:

  • Continuous Code Review
  • Fewer blockages
  • Masking distractions
  • Guaranteed focus
  • Multiple points of view
  • Reduced training cost and time

Continuous Code Review

One of the maxims of extreme programming (XP) is to turn all the dials to 11. Code review is good, so continuous, instantaneous code review is great; and that’s exactly what pair programming delivers. No more back and forth over a week. No more waiting for feedback on a code review. Instead, feedback comes immediately. This means less time waiting for reviews and less time going down the wrong path. The time savings compared to classic code reviews is dramatic. In fact, this savings alone is likely to pay the cost of pair programming.

Furthermore the feedback is more likely to be useful that that from classic code reviews. When presented with a 60 file change list, the tendency for most reviewers is either to give it a perfunctory once over, or to merely focus on the little details like indentation without really seeing the bigger picture. However, when pair programming, both developers are actively involved with the code and can see what’s happening as it happens. Code reviews start and continue one line at a time and grow gradually with the code. It’s much easier to understand code this way than by having 60 classes and 3000 new lines of code dumped on you in one huge batch.

Finally, feedback can be incorporated more quickly and easily when it’s given earlier in the process. It’s bad enough having to review 60 classes and 3000 new lines of code. It’s much worse having to throw all that code away after a month’s work and start over because the reviewer has uncovered a serious design flaw. The sooner the flaws are noticed, the cheaper they are to fix. Pair programming is much less likely to produce misguided code.

And if you’re not already doing code reviews? Then introducing them through pair programming is going to improve your code quality and programming velocity that much more.

Fewer blockages

We’ve all experienced the annoying bug that just won’t die, no matter what we try. Sometimes we work on it for a day and then immediately see the answer when we wake up the next morning. Sometimes we work on it for two days or more until we finally break down and ask for help, at which point our cube mate says, “Oh, you’re implementing getProjectId() when you should be overriding getProjectID().”

Why wait?

Stupid bugs like these waste a lot of time; but blind spots are rarely shared. What one programmer doesn’t see, the other one likely does. Find one of these per day by pair programming, and you’ve paid for the extra pair of eyes. You may not even realize how much time you’re saving here because the mistake will be found so fast, and once you see it it will be so obvious, that no one will even consider they might have wasted a day on the problem had their partner not spotted it. Nonetheless the effect is very, very real.

On a related note, two minds are better than one. What one programmer doesn’t know the other one likely does. You may not know the details of cuckoo hashing (or even that it exists); but if your partner does, you’ll be able to use it when appropriate. On the other hand, you may be the world expert in the idiosyncrasies of cross-browser JavaScript DOM and save your partner hours of web surfing reading up on how to work around IE6.

As a special bonus, when pairs match programmers with different experiences and knowledge domains, each partner learns from the other. Knowledge effortlessly percolates across the team and the company. This doesn’t speed you up on the immediate project, but it does increase everyone’s skills and improve your velocity on future projects. This is especially important for growing companies.

Try to pair programmers with different skill sets and experience levels rather than similar ones. A pair
is as strong as the strongest pair member, not as weak as the weakest. In fact, it’s probably stronger. The harder and more urgent the problem, the more critical it is to use pairing. If you have some really thorny problem, for instance involving multithreading, don’t pair your top experts in multithreaded optimization. Pair one expert with the lowest intern on the totem pole, so you grow more experts.

If it’s a critical issue and you aren’t sure how or whether you can fix it, pair each expert with a lesser star, and have the pairs both try to solve the problem. Then the pick the best solution, or merge the best features of each. (Caveat: I only recommend this for really important work items that are critical, not for mere grunt coding. For most problems the quality of the solution doesn’t matter so much as just having some solution.)


Mask out distractions

Microsoft and Fog Creek give their programmers private, quiet, distraction-free offices. The rest of us work in cubicles where we have to listen to the web designer two cubicles over yell at Verizon for two days trying to get out of a cell phone contract. Noise is a real problem for many, many programmers. You just can’t think when your brain is in a blender. Your brain does not filter out conversations happening around you. In fact, when no one else is talking directly to you, it deliberately focuses in on these external conversations, whether they’re relevant to you or not, the exact opposite of what it needs to do. It’s like sitting at a table alone in a restaurant, and not listening to the conversation at the next table. You simply can’t do it. White noise would be better.

This is where pair programming really does seem like magic. Your brain has evolved to focus preferentially on a nearby conversation instead of a distant one. When you are focusing on the person next to you, your brain masks out all other conversations at any volume below a shout. The interaction between the pair is so high-intensity that low intensity noise from a cubicle environment is much less problematic for a pair than for a programmer working alone. You can still be distracted from the task at hand by your own name or a few other special cues, but it’s surprising how much noise you can ignore that would completely break your concentration when you’re working alone. That egregious cell phone contract the HTML jockey keeps shouting about? Not your problem any more.

Guaranteed Focus

The eight hour day is a myth. Between meetings, lunch, e-mail, water cooler chatter, personal errands, paperwork, birthday celebrations, collections for going away presents, and more, you’re lucky to get two hours a day of solid coding time. Four hours is great. And even if you have four actual hours to sit in front of the keyboard, how much of that is going to be wasted on e-mail and the Web? Even if the e-mails sent and pages googled are related to the immediate task at hand, it’s likely there’s another e-mail or page just a click away that isn’t work related but is interesting enough to distract you from the real job.

When pairing, programmers actually program. They don’t check e-mail, read blogs, play Scrabulous, and generally goof off. If they have to check a web page to look up the exact behavior of a class (which they’re less likely to do in the first place because one of them may know the answer even if the other doesn’t) they come right back to the IDE after finding the answer. Four hours spent pairing is much closer to an actual four hours spent coding.

One common objection to pair programming is that it’s hard to find four hour blocks in which to pair, especially in larger, more bureaucratic organizations where meetings occupy a large part of the day. But here too pairing can help. Put the pairing time on the shared calendar as another meeting so no one can schedule the pair into meetings when they plan to be coding. Reserve your time for pairing before others take it away from you for less productive activities.

Multiple points of view

Programming has two modes: writing code and reading code. Pair programming has three: writing code, reading code, and explaining code. Explaining what code does makes you look at it differently than simply reading or writing it. When explaining code you are more likely to notice that what you think code does isn’t what it really does.

How often have you discovered bugs in your program when explaining a detailed algorithm to a colleague? Often you see the problem before the person you’re explaining it to does. Not too surprising given that usually the person doing the talking is the one who’s most interested in what they’re saying. There’s nothing like trying to explain something to force you to realize that you don’t really understand what you thought you knew, or that the code doesn’t work quite like you thought.

When pairing, a programmer is always explaining. You’re not just typing while your mind’s really on the World Cup finals or the morning antics of the Zoo Crew on KUPD. The pair members type as they explain what they’re doing and why they’re doing it. Thus, they’re less likely to do something stupid in the first place. If the words coming out of your mouth don’t match the characters emitting from the keyboard, then your partner will likely notice and call you on it.





Reduced training cost and time


Some organizations spend significant (> 5% of annual salary) amounts of money on conferences, onsite classes, online courses, books, and other training experiences for their developers. They may spend several thousand dollars per programmer just to send them to one out-of-town conference, and hope they learn something valuable enough to be worth the airfare, hotel, conference admission, and lost time. Or they bring in a trainer for 1 to 5 days to run a class on a new technology, which can be somewhat more cost effective if you have 5 or more developers and specific subject matter that they need to learn in depth. However you still lose multiple developer-weeks of work to training. Other organizations spend hardly any money on training, and just struggle along with whatever skills the programmers hired on with, as well as whatever they can pick up by reading blogs like this one (though again usually read on company time).

Pair programming doesn’t eliminate the cost of the training, but it can eliminate the lost time and productivity. Instead of purchasing classroom instruction, onsite or online or off, hire a contractor experienced with the technology to pair with your programmers. (The contractor should also be experienced and comfortable with pair programming.) Rather than learning in a classroom (which only works for about 5% of people anyway) help your team learn on the job. Informal lunchtime discussions led by the trainer can cover broader issues and general principles, but the real training takes place as your team builds the system they need training for. Shuffle the trainer between different developers every half day or so, while the ones who’ve already spent time with him or her pair with as yet untrained programmers.

On your balance sheet, it looks like you’ve hired an extra developer rather than a trainer. On your schedule, you’ve replaced training time with development time. Nonetheless, you’ll get a better trained team that can move faster when the contractor leaves.

Although I know a few consultants who specialize in this sort of pair training, I admit they can be a little hard to find. If your team has enough experience with pair programming, you may just want to hire a classic code jockey contractor with experience in the technology you need to learn, rather than an explicit trainer or coach. Pair the contractor up with one of your programmers, and let the knowledge flow naturally. This is a much more effective use of the contractor’s time than just putting them in a room by themselves, and getting an incomprehensible black box out after a few weeks. If the hired guns work directly with your permanent developers, then your team will be ready to take over, maintain, and grow the code after the mercenary leaves. You won’t be trapped in a situation where you have to keep calling the contractor back every two months to spend a few days at $300 an hour fixing the bugs they put into the code in the first place.

Just Do It

Pair programming isn’t magic, but it is effective. Very, very effective. Smart managers and anyone else who cares about code quality and programmer productivity should demand pair programming. In the best code shops, no one codes alone.

13 tips on how to comment your source code

Posted by Shashank Krishna Thursday, May 28, 2009

Following are 13 tips on how to comment your source code so that it is easier to understand and maintain over time.

1. Comment each level

Comment each code block, using a uniform approach for each level. For example:

  • For each class, include a brief description, author and date of last modification
  • For each method, include a description of its purpose, functions, parameters and results

Adopting comment standards is important when working with a team. Of course, it is acceptable and even advisable to use comment conventions and tools (such as XML in C# or Javadoc for Java) to facilitate this task.

2. Use paragraph comments

Break code blocks into multiple “paragraphs” that each perform a single task, then add a comment at the beginning of each block to instruct the reader on what is about to happen.

// Check that all data records
// are correct
foreach (Record record in records)
{
if (rec.checkStatus()==Status.OK)
{
. . .
}
}
// Now we begin to perform
// transactions
Context ctx = new ApplicationContext();
ctx.BeginTransaction();
. . .

3. Align comments in consecutive lines

For multiple lines of code with trailing comments, align the comments so they will be easy to read.

const MAX_ITEMS = 10; // maximum number of packets
const MASK = 0x1F; // mask bit TCP

Some developers use tabs to align comments, while others use spaces. Because tab stops can vary among editors and IDEs, the best approach is to use spaces.

4. Don’t insult the reader’s intelligence

Avoid obvious comments such as:

if (a == 5) // if a equals 5
counter = 0; // set the counter to zero

This wastes your time writing needless comments and distracts the reader with details that can be easily deduced from the code.

5. Be polite

Avoid rude comments like, “Notice the stupid user has entered a negative number,” or “This fixes the side effect produced by the pathetically inept implementation of the initial developer.” Such comments do not reflect well upon their author, and you never know who may read these comments in the future: your boss, a customer, or the pathetically inept developer you just insulted.

6. Get to the point

Don’t write more in comments than is needed to convey the idea. Avoid ASCII art, jokes, poetry and hyperverbosity. In short, keep the comments simple and direct.

7. Use a consistent style

Some people believe that comments should be written so that non-programmers can understand them. Others believe that comments should be directed at developers only. In any event, as stated in Successful Strategies for Commenting Code, what matters is that comments are consistent and always targeted to the same audience. Personally, I doubt many non-developers will be reading code, so comments should target other developers.

8. Use special tags for internal use

When working on code as a team, adopt a consistent set of tags to communicate among programmers. For example, many teams use a “TODO:” tag to indicate a section of code that requires additional work:




int Estimate(int x, int y)
{
// TODO: implement the calculations
return 0;
}

Tag comments don’t explain code; rather they seek attention or deliver a message. But if you use this technique, remember to follow up and actually do what the message is asking.

9. Comment code while writing it

Add comments while you write code and it’s fresh in your memory. If you leave comments until the end, it will take you twice as long, if you do it at all. “I have no time to comment,” “I’m in a hurry,” and “The project is delayed” are all simply excuses to avoid documenting your code. Some developers believe you should write comments before code as a way to plan out your ultimate solution. For example:

public void ProcessOrder()
{
// Make sure the products are available
// Check that the customer is valid
// Send the order to the store
// Generate bill
}

10. Write comments as if they were for you (in fact, they are)

When it comes to commenting code, think not only about the developers who will maintain your code in the future, but also think about yourself. In the words of the great Phil Haack:

“As soon as a line of code is laid on the screen, you’re in maintenance mode on that piece of code.”

As a result, we ourselves will be the first beneficiaries (or victims) of our good (or bad) comments.

11. Update comments when you update the code

There is no point in commenting correctly on code if the comments are not changed with the code. Both code and comments must move in parallel, otherwise the comments will actually make life more difficult for developers who maintain your code. Pay special attention to refactoring tools that automatically update code but leave comments unchanged and hence obsolete in the same instant.

12. The golden rule of comments: readable code

One of the basic principles for many developers: Let your code speak for itself. Although one suspects this movement is led by programmers who do not like to write comments, it is true that self-explanatory code can go a long way toward making code that’s easier to understand and can even render comments unnecessary. For example, the code in my Fluid Interfaces article shows how clear self-explanatory code can be:

Calculator calc = new Calculator();
calc.Set(0);
calc.Add(10);
calc.Multiply(2);
calc.Subtract(4);
Console.WriteLine( “Result: {0}”, calc.Get() );

In this example, comments are not needed and would likely violate tip #4. To facilitate readable code, you might consider using proper names (as described in the classic Ottinger’s Rules), ensure correct indentation, and adopt coding style guides. Failure to comply with this tip may result in comments that seem to apologize for bad code.

13. Share these tips with your colleagues

Although tip #10 shows how we ourselves benefit immediately from good comments, these tips will benefit all developers, especially in the context of team working together. Therefore, feel free to share these commenting tips with your colleagues to create code that is easier to understand and maintain.

21 Laws of Computer Programming:

Posted by Shashank Krishna

As any experienced computer programmer knows, there are unwritten laws that govern software development. However there are no penalties for breaking these laws; rather, there is often a reward. Following are 21 Laws of Computer Programming:

  1. Any given program, once deployed, is already obsolete.
  2. It is easier to change the specification to fit the program than vice versa.
  3. If a program is useful, it will have to be changed.
  4. If a program is useless, it will have to be documented.
  5. Only ten percent of the code in any given program will ever execute.
  6. Software expands to consume all available resources.
  7. Any non-trivial program contains at least one error.
  8. The probability of a flawless demo is inversely proportional to the number of people watching, raised to the power of the amount of money involved.
  9. Not until a program has been in production for at least six months will its most harmful error be discovered.
  10. Undetectable errors are infinite in variety, in contrast to detectable errors, which by definition are limited.
  11. The effort required to correct an error increases exponentially with time.
  12. Program complexity grows until it exceeds the capabilities of the programmer who must maintain it.
  13. Any code of your own that you haven’t looked at in months might as well have been written by someone else.
  14. Inside every small program is a large program struggling to get out.
  15. The sooner you start coding a program, the longer it will take.
  16. A carelessly planned project takes three times longer to complete than expected; a carefully planned project takes only twice as long.
  17. Adding programmers to a late project makes it later.
  18. A program is never less than 90% complete, and never more than 95% complete.
  19. If you automate a mess, you get an automated mess.
  20. Build a program that even a fool can use, and only a fool will want to use it.
  21. Users truly don’t know what they want in a program until they use it.

101 Great Computer Programming Quotes

Posted by Shashank Krishna

“People always fear change. People feared electricity when it was invented, didn’t they? People feared coal, they feared gas-powered engines. There will always be ignorance, and ignorance leads to fear. But with time, people will come to accept their silicon masters.”

As Bill Gates once warned, computers have indeed become our silicon masters, pervading nearly every aspect of our modern lives. As a result, some of the greatest minds of our time have pondered the significance of computers and software on the human condition. Following are 101 great quotes about computers, with an emphasis on programming, since after all this is a software development site.


Computers

  1. “Computers are useless. They can only give you answers.”
    (Pablo Picasso)
  2. Computers are like bikinis. They save people a lot of guesswork.”
    (Sam Ewing)
  3. “They have computers, and they may have other weapons of mass destruction.”
    (Janet Reno)
  4. “That’s what’s cool about working with computers. They don’t argue, they remember everything, and they don’t drink all your beer.”
    (Paul Leary)
  5. “If the automobile had followed the same development cycle as the computer, a Rolls-Royce would today cost $100, get a million miles per gallon, and explode once a year, killing everyone inside.”
    (Robert X. Cringely)

Computer Intelligence

  1. “Computers are getting smarter all the time. Scientists tell us that soon they will be able to talk to us. (And by ‘they’, I mean ‘computers’. I doubt scientists will ever be able to talk to us.)”
    (Dave Barry)
  2. “I’ve noticed lately that the paranoid fear of computers becoming intelligent and taking over the world has almost entirely disappeared from the common culture. Near as I can tell, this coincides with the release of MS-DOS.”
    (Larry DeLuca)
  3. “The question of whether computers can think is like the question of whether submarines can swim.”
    (Edsger W. Dijkstra)
  4. “It’s ridiculous to live 100 years and only be able to remember 30 million bytes. You know, less than a compact disc. The human condition is really becoming more obsolete every minute.”
    (Marvin Minsky)

Trust

  1. “The city’s central computer told you? R2D2, you know better than to trust a strange computer!”
    (C3PO)
  2. “Never trust a computer you can’t throw out a window.”
    (Steve Wozniak)

Hardware

  1. “Hardware: The parts of a computer system that can be kicked.”
    (Jeff Pesis)

Software

  1. “Most software today is very much like an Egyptian pyramid with millions of bricks piled on top of each other, with no structural integrity, but just done by brute force and thousands of slaves.”
    (Alan Kay)
  2. “I’ve finally learned what ‘upward compatible’ means. It means we get to keep all our old mistakes.”
    (Dennie van Tassel)

Operating Systems

  1. “There are two major products that come out of Berkeley: LSD and UNIX. We don’t believe this to be a coincidence.”
    (Jeremy S. Anderson)
  2. “19 Jan 2038 at 3:14:07 AM”
    (End of the word according to Unix–2^32 seconds after January 1, 1970)
  3. “Every operating system out there is about equal… We all suck.”
    (Microsoft senior vice president Brian Valentine describing the state of the art in OS security, 2003)
  4. “Microsoft has a new version out, Windows XP, which according to everybody is the ‘most reliable Windows ever.‘ To me, this is like saying that asparagus is ‘the most articulate vegetable ever.‘ “
    (Dave Barry)

Internet

  1. “The Internet? Is that thing still around?”
    (Homer Simpson)
  2. “The Web is like a dominatrix. Everywhere I turn, I see little buttons ordering me to Submit.”
    (Nytwind)
  3. “Come to think of it, there are already a million monkeys on a million typewriters, and Usenet is nothing like Shakespeare.”
    (Blair Houghton)

Software Industry

  1. “The most amazing achievement of the computer software industry is its continuing cancellation of the steady and staggering gains made by the computer hardware industry.”
    (Henry Petroski)
  2. “True innovation often comes from the small startup who is lean enough to launch a market but lacks the heft to own it.”
    (Timm Martin)
  3. “It has been said that the great scientific disciplines are examples of giants standing on the shoulders of other giants. It has also been said that the software industry is an example of midgets standing on the toes of other midgets.”
    (Alan Cooper)
  4. “It is not about bits, bytes and protocols, but profits, losses and margins.”
    (Lou Gerstner)
  5. “We are Microsoft. Resistance Is Futile. You Will Be Assimilated.”
    (Bumper sticker)

Software Demos

  1. “No matter how slick the demo is in rehearsal, when you do it in front of a live audience, the probability of a flawless presentation is inversely proportional to the number of people watching, raised to the power of the amount of money involved.”
    (Mark Gibbs)

Software Patents

  1. “The bulk of all patents are crap. Spending time reading them is stupid. It’s up to the patent owner to do so, and to enforce them.”
    (Linus Torvalds)

Complexity

  1. “Controlling complexity is the essence of computer programming.”
    (Brian Kernigan)
  2. “Complexity kills. It sucks the life out of developers, it makes products difficult to plan, build and test, it introduces security challenges, and it causes end-user and administrator frustration.”
    (Ray Ozzie)
  3. “There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies.”
    (C.A.R. Hoare)
  4. “The function of good software is to make the complex appear to be simple.”
    (Grady Booch)

Ease of Use

  1. “Just remember: you’re not a ‘dummy,’ no matter what those computer books claim. The real dummies are the people who–though technically expert–couldn’t design hardware and software that’s usable by normal consumers if their lives depended upon it.”
    (Walter Mossberg)
  2. “Software suppliers are trying to make their software packages more ‘user-friendly’… Their best approach so far has been to take all the old brochures and stamp the words ‘user-friendly’ on the cover.”
    (Bill Gates)
  3. “There’s an old story about the person who wished his computer were as easy to use as his telephone. That wish has come true, since I no longer know how to use my telephone.”
    (Bjarne Stroustrup)

Users

  1. “Any fool can use a computer. Many do.”
    (Ted Nelson)
  2. “There are only two industries that refer to their customers as ‘users’.”
    (Edward Tufte)

Programmers

  1. “Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning.”
    (Rich Cook)
  2. Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris.”
    (Larry Wall)
  3. “The trouble with programmers is that you can never tell what a programmer is doing until it’s too late.”
    (Seymour Cray)
  4. “That’s the thing about people who think they hate computers. What they really hate is lousy programmers.”
    (Larry Niven)
  5. “For a long time it puzzled me how something so expensive, so leading edge, could be so useless. And then it occurred to me that a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are, in short, a perfect match.”
    (Bill Bryson)
  6. “Computer science education cannot make anybody an expert programmer any more than studying brushes and pigment can make somebody an expert painter.”
    (Eric Raymond)
  7. “A programmer is a person who passes as an exacting expert on the basis of being able to turn out, after innumerable punching, an infinite series of incomprehensive answers calculated with micrometric precisions from vague assumptions based on debatable figures taken from inconclusive documents and carried out on instruments of problematical accuracy by persons of dubious reliability and questionable mentality for the avowed purpose of annoying and confounding a hopelessly defenseless department that was unfortunate enough to ask for the information in the first place.”
    (IEEE Grid newsmagazine)
  8. “A hacker on a roll may be able to produce–in a period of a few months–something that a small development group (say, 7-8 people) would have a hard time getting together over a year. IBM used to report that certain programmers might be as much as 100 times as productive as other workers, or more.”
    (Peter Seebach)
  9. “The best programmers are not marginally better than merely good ones. They are an order-of-magnitude better, measured by whatever standard: conceptual creativity, speed, ingenuity of design, or problem-solving ability.”
    (Randall E. Stross)
  10. “A great lathe operator commands several times the wage of an average lathe operator, but a great writer of software code is worth 10,000 times the price of an average software writer.”
    (Bill Gates)


Programming

  1. “Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.”
    (Mosher’s Law of Software Engineering)
  2. “Measuring programming progress by lines of code is like measuring aircraft building progress by weight.”
    (Bill Gates)
  3. “Writing code has a place in the human hierarchy worth somewhere above grave robbing and beneath managing.”
    (Gerald Weinberg)
  4. “First learn computer science and all the theory. Next develop a programming style. Then forget all that and just hack.”
    (George Carrette)
  5. “First, solve the problem. Then, write the code.”
    (John Johnson)
  6. “Optimism is an occupational hazard of programming; feedback is the treatment.”
    (Kent Beck)
  7. “To iterate is human, to recurse divine.”
    (L. Peter Deutsch)
  8. “The best thing about a boolean is even if you are wrong, you are only off by a bit.”
    (Anonymous)
  9. Should array indices start at 0 or 1? My compromise of 0.5 was rejected without, I thought, proper consideration.”
    (Stan Kelly-Bootle)

Programming Languages

  1. “There are only two kinds of programming languages: those people always bitch about and those nobody uses.”
    (Bjarne Stroustrup)
  2. “PHP is a minor evil perpetrated and created by incompetent amateurs, whereas Perl is a great and insidious evil perpetrated by skilled but perverted professionals.”
    (Jon Ribbens)
  3. “The use of COBOL cripples the mind; its teaching should therefore be regarded as a criminal offense.”
    (E.W. Dijkstra)
  4. “It is practically impossible to teach good programming style to students that have had prior exposure to BASIC. As potential programmers, they are mentally mutilated beyond hope of regeneration.”
    (E. W. Dijkstra)
  5. “I think Microsoft named .Net so it wouldn’t show up in a Unix directory listing.”
    (Oktal)
  6. “There is no programming language–no matter how structured–that will prevent programmers from making bad programs.”
    (Larry Flon)
  7. “Computer language design is just like a stroll in the park. Jurassic Park, that is.”
    (Larry Wall)

C/C++

  1. “Fifty years of programming language research, and we end up with C++?”
    (Richard A. O’Keefe)
  2. “Writing in C or C++ is like running a chain saw with all the safety guards removed.”
    (Bob Gray)
  3. “In C++ it’s harder to shoot yourself in the foot, but when you do, you blow off your whole leg.”
    (Bjarne Stroustrup)
  4. “C++ : Where friends have access to your private members.”
    (Gavin Russell Baker)
  5. “One of the main causes of the fall of the Roman Empire was that–lacking zero–they had no way to indicate successful termination of their C programs.”
    (Robert Firth)

Java

  1. “Java is, in many ways, C++–.”
    (Michael Feldman)
  2. “Saying that Java is nice because it works on all OSes is like saying that anal sex is nice because it works on all genders.”
    (Alanna)
  3. “Fine, Java MIGHT be a good example of what a programming language should be like. But Java applications are good examples of what applications SHOULDN’T be like.”
    (pixadel)
  4. If Java had true garbage collection, most programs would delete themselves upon execution.”
    (Robert Sewell)

Open Source

  1. “Software is like sex: It’s better when it’s free.”
    (Linus Torvalds)
  2. “The only people who have anything to fear from free software are those whose products are worth even less.”
    (David Emery)

Code

  1. “Good code is its own best documentation.”
    (Steve McConnell)
  2. Any code of your own that you haven’t looked at for six or more months might as well have been written by someone else.”
    (Eagleson’s Law)
  3. “The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.”
    (Tom Cargill)

Software Development

  1. “Good programmers use their brains, but good guidelines save us having to think out every case.”
    (Francis Glassborow)
  2. “In software, we rarely have meaningful requirements. Even if we do, the only measure of success that matters is whether our solution solves the customer’s shifting idea of what their problem is.”
    (Jeff Atwood)
  3. “Considering the current sad state of our computer programs, software development is clearly still a black art, and cannot yet be called an engineering discipline.”
    (Bill Clinton)
  4. “You can’t have great software without a great team, and most software teams behave like dysfunctional families.”
    (Jim McCarthy)

Debugging

  1. “As soon as we started programming, we found to our surprise that it wasn’t as easy to get programs right as we had thought. Debugging had to be discovered. I can remember the exact instant when I realized that a large part of my life from then on was going to be spent in finding mistakes in my own programs.”
    (Maurice Wilkes discovers debugging, 1949)
  2. “Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are–by definition–not smart enough to debug it.”
    (Brian Kernighan)
  3. “If debugging is the process of removing bugs, then programming must be the process of putting them in.”
    (Edsger W. Dijkstra)

Quality

  1. “I don’t care if it works on your machine! We are not shipping your machine!”
    (Vidiu Platon)
  2. “Programming is like sex: one mistake and you’re providing support for a lifetime.”
    (Michael Sinz)
  3. “There are two ways to write error-free programs; only the third one works.”
    (Alan J. Perlis)
  4. “You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time.”
    (Bertrand Meyer)
  5. “If McDonalds were run like a software company, one out of every hundred Big Macs would give you food poisoning, and the response would be, ‘We’re sorry, here’s a coupon for two more.’ “
    (Mark Minasi)
  6. “Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.”
    (Martin Golding)
  7. “To err is human, but to really foul things up you need a computer.”
    (Paul Ehrlich)
  8. “A computer lets you make more mistakes faster than any invention in human history–with the possible exceptions of handguns and tequila.”
    (Mitch Radcliffe)

Predictions

  1. “Everything that can be invented has been invented.”
    (Charles H. Duell, Commissioner, U.S. Office of Patents, 1899)
  2. “I think there’s a world market for about 5 computers.”
    (Thomas J. Watson, Chairman of the Board, IBM, circa 1948)
  3. “It would appear that we have reached the limits of what it is possible to achieve with computer technology, although one should be careful with such statements, as they tend to sound pretty silly in 5 years.”
    (John Von Neumann, circa 1949)
  4. “But what is it good for?”
    (Engineer at the Advanced Computing Systems Division of IBM, commenting on the microchip, 1968)
  5. “There is no reason for any individual to have a computer in his home.”
    (Ken Olson, President, Digital Equipment Corporation, 1977)
  6. “640K ought to be enough for anybody.”
    (Bill Gates, 1981)
  7. “Windows NT addresses 2 Gigabytes of RAM, which is more than any application will ever need.”
    (Microsoft, on the development of Windows NT, 1992)
  8. “We will never become a truly paper-less society until the Palm Pilot folks come out with WipeMe 1.0.”
    (Andy Pierson)
  9. “If it keeps up, man will atrophy all his limbs but the push-button finger.”
    (Frank Lloyd Wright)

Which is better JSP or PHP?

Posted by Shashank Krishna Sunday, April 19, 2009

Which is better, JSP or PHP? that's a religious questions, depends on whether you believe in god or not? but who is god anyway?

The question itself isn't a very good one. It should be which is better J2EE or PHP because it's not really possible to look at JSP in isolation. There is no doubt that PHP is the better langauge for building web apps. PHP is the shortest path between the problem and the solution. J2EE will take you through a more scenic path. It might possibly be argued that the road built with J2EE technology will be more durable and can carry vehicles with bigger loads, but that is another religious question.

If you are a java programmer you will say PHP code looks really messy when you embed it into HTML and PHP programmers will come back and say JSP looks a lot worse, which is true. The retort generally given is that you can make use of varius tag libs such as struts or jstl to make the code neater. Some people will also make vague references to the MVC pattern.

If these advocates of tag libraries look at the servlet source code generated from their JSP they will surely bring up their dinner. Hand coded JSP when made into a servlet might make you lose your appetite but your dinner will hopefully stay in.

Not so with PHP, once you have written a few hundred thousand lines of code with PHP you can make scripts that look distinctily sexy.

Courtesy:-http://www.raditha.com/

Programming in windows...message box

Posted by Shashank Krishna Tuesday, February 17, 2009

Recently i had started writing apps for windows.....n what a crap work.....
below is a code just for generating a small message box


#include windows.h

INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, PSTR, INT iCmdShow)
{
MessageBox
(
NULL,
TEXT("You've started programming Windows"),
TEXT("Message Output Box"),
1
);
return 0;
}




Before you leave, please promote this article with your favorite bookmarking site using the Share/save button! AND DO please give your valuable comment
Share/Save/Bookmark
Subscribe

Reblog this post [with Zemanta]

Are You Planning on Quitting Facebook? Why?

@Flickr

www.flickr.com

About Me

My Photo
Shashank Krishna
Bangalore, up, India
nothin much to say.........doin B.tech in IIIT allahabad loves bloggingn hacking.... :) and loooves blogging
View my complete profile

ads2

topads