Simple Lessons
May 12, 2011 at 10:33 am | Posted in Patterns | Leave a commentTags: algorithms, data structu, Programming
I am working in C from last 3 years and these two very simple lessons are based on my experience, these are not taken from any book but by my own understanding of programming. They may look very simple and short and don’t underestimate them. You may already know them (I did) and you may not be aware of them. Its like everyone knew that apple falls on the ground but only Newton became aware of it
-
Solving Problems: Programming is all about solving problems. I knew that (and I am sure you knew that too), every programmer know this but how many programmers translate business problems into code? May be you are working on the problem which is just your interpretation of the problem? What is the real business problem you are trying to solve on your job as a programmer? You are actually a translator between a business man and computer.
-
Diagrams: Before you even think about coding you must draw a digram on how you are going to split this business problem into some or lots of small ones and what will be the general idea behind solving this problem. That you can accomplish very effectively by drawing a diagram on paper using a pen (or pencil). Also known as DFDs (Data Flow Diagrams). You will see how much of your life has become easier with DFDs. DFDs follow some rules and you can make your own diagrams and your own rules but make sure you stick to some standard (whether your own or someone else). DFDs are designed to make your life easier, it will make you happy because once you start coding you will see how important they are.
-
Tools: What tools you are using to translate problems into code ? Whether you are solving business problems or you do it for joy of solving problems (in the world of Hackers), Algorithms and Data Structures are the first of the tools you need, programming language is 2nd tool. Majority of programmers do not focus on first tool. Why you need qsort() over other sorting techniques. Why AVL tree will be better than Red-Black tree or Binary-Search tree. Why you will use a circular linked list instead of a doubly-linked list implemented as a Stack ? Why there exist so many different kind of trees and linked lists. Even I, myself, know only few of them. Its hard work but surely simple and very rewarding. I think half of the bugs exist in software because programmers lack this tool or the intended use of it
-
Tools-2: Like I said, programming language you are using is 2nd tool. Don’t go to high level talk here or dig yourself into advanced programming before you understand the basics. I use C language, so before I go into advanced C book, I will make sure I have spent two years on comprehending C FAQs and comp.lang.c archives
-
Breaking a big problem into small problems: I am using C, which is a procedural programming language. Hence I break down a business problem into small procedures (also known as functions). I will make sure that when one procedure calls other then both of them are doing some specific work and that in a proper and structured way. Writing too many procedures or the ones which do not have a proper siginificance can (and will) cause semantic bugs which in turn cause headaches over time.
Copyright © 2011 Arnuld Uttre, Village – Patti, P.O – Manakpur, Tehsil – Nangal, Distt. – Ropar, Punjab (INDIA)
Verbatim copying and distribution of this entire article are permitted worldwide, without royalty, in any medium, provided this notice, and the copyright notice, are preserved.
The Craft of Programming
August 31, 2009 at 11:16 am | Posted in Patterns, Programming | Leave a commentTags: C++, esr, Lisp, Programming, quotes, RMS, software quotes
Here are some quotes I have gathered over the years. They are written by some of the best known Programmers and Hackers with occasionally some very good programmers thrown in, if not great. They inspired me, changed the way I look at programming and especially at some programming languages and methods to solve problems:
“Any sufficiently complicated C or Fortran program contains an ad hoc informally-specified bug-ridden slow implementation of half of Common Lisp.” — Philip Greenspun
“Something we didn’t want was an object-oriented language. OO languages remain a popular fad, but our experience using C++ in the EROS system was that it actively got in the way of understanding what was going on.”
– The Origins of the BitC Programming Language
When you want to use a language that gets compiled and runs at high speed, the best language to use is C. Using another language is like using a non-standard feature. — GNU Coding Standards
“First off, I’d suggest printing out a copy of the GNU coding standards,
and NOT read it. Burn them, it’s a great symbolic gesture.” — Linux kernel coding guidelines
“C++ will rot your brain” — someone from #lisp at irc.freenode.net
“pointer arithmetic and array indexing [that] are equivalent in C, pointers and arrays are different.” – Wayne Throop
“An array is not a pointer, nor vice versa” — Steve Summit in C FAQs
“Attitude is no substitute for competence” — Eric S. Raymond in How to become a Hacker
Q: I’m having problems with my Windows software. Will you help me?
A: Yes. Go to a DOS prompt and type “format c:”. Any problems you are experiencing will cease within a few minutes.
– Eric S. Raymond
“This answer cannot be decided by current law—the law should conform to ethics, not the other way around” — Richard M. Stallman
“Lisp is a programmable programming language.” – John Foderaro, CACM, September 1991
Q: “My company needs a proprietary operating system to get a competitive edge.”
A: GNU will remove operating system software from the realm of competition. You will not be able to get an edge in this area, but neither will your competitors be able to get an edge over you. You and they will compete in other areas, while benefiting mutually in this one.
“There is nothing wrong with wanting pay for work, or seeking to maximize one’s income, as long as one does not use means that are destructive. But the means customary in the field of software today are based on destruction.” — Richard M. Stallman
“Haskell saves lives”
“In general, functional languages offer powerful new ways to encapsulate abstractions” — Haskell Wiki
“I invented the term ‘Object-Oriented’, and I can tell you I did not have C++ in mind.” — Alan Kay.
“C++ is the only current language making COBOL look good” — Bertrand Meyer
“It’s 5.50 a.m…. Do you know where your stack pointer is ?” — Anonymous
“I understand the philosophy that developer cycles are more important than cpu cycles, but frankly that’s just a bumper-sticker slogan and not fair to the people who are complaining about performance.” – Joel Spolsky
“The standard — either one — is not the End of All C. Writing ‘strictly conforming’ C code, however, has an enormous benefit.” — Chris Torek
“Wait a minute, I want to modify that statement. I’m not claiming, in this particular article, that there’s anything wrong with Java as an implementation language. There are lots of things wrong with it but those will have to wait for a different article.” — Joel Spolsky
“Without understanding functional programming, you can’t invent MapReduce, the algorithm that makes Google so massively scalable” — Joel Spolsky
“It [Java] might be successful – after all, MS DOS was – and it might be a profitable thing for all your readers to learn Java, but it has no intellectual value whatsoever. Look at their implementation of hash tables. Look at the sorting routines that come with their “cool” sorting applet. ” – Alexander Stepanov
“Java isn’t platform independent; it is a platform. Like Windows, it is a proprietary commercial platform. ” — Bjarne Stroustrup
Copyright © 2006, 2007, 2008 Arnuld Uttre, #331/type-2/sector-1, Naya Nangal, Distt. – Ropar, Punjab (INDIA) – 140126
Verbatim copying and distribution of this entire article are permitted worldwide, without royalty, in any medium, provided this notice, and the copyright notice, are preserved.
My friends will kill me
February 24, 2009 at 7:15 pm | Posted in Hacking, History, Patterns | 11 CommentsTags: community, conscience of a hacker, free software, hackers, infoware, Loveware, OpenSource, programmer, programmers, Programming, UNIX
Its been more than a year (since 2007) that I am using a a Linux distro running on text-based system configuration. The idea was difficult to adopt in the beginning but it look intelligent to me. So friends here is my Linux box running on Arch . There is no way you can edit any network or printer configrations from the Administration menu of GNOME in Arch. If yuo want to configure then go edit the text file. My colleagues who are still using Ubuntu struggle with the unknown and unrasonable problems everyday but they stick to Ubuntu, its Administration menu, the GUI based system to configure the system settings and they are stil there. Even after several years of usage they get mentally handicapped when some problem arises. They ask stupid questions to each other. Here is some conversation:
Ubuntu User 1: My system is not booting properly in Ubuntu. What should I do ?
me : whats the problem ?
Ubuntu User 1: I don’t know, Ubuntu is showing some error.
me : What kind of error. Is root file system geting mounted.
Ubuntu User 1: I don’t know.
me : Let me check
Ubuntu User 1: Don’t worry, I will reinstall Ubuntu.
Later I found out, fsck was showing some error on mounting /home partition and was throwing the user into maintenance shell to do fsck but he kep on pressing the Reset button instead.
Ubuntu User 1: I have Ubuntu but I need to play 3D games. Ubuntu does not play them as good as Windows XP.
Ubuntu User 2: Install Sabayon, you can play good games on it.
me : What playing games has to do with either Ubuntu or Sabayon (or even Debian) ?
Ubuntu User 2: Debian does not have any games.
me : Debian has largest collection of packages among all the distros. You only need to install a game using apt-get. Even if the package is not there, then you can download and install it.
Ubuntu User 2: With Debian I have to configure GNOME manually to run, eve after install it. I don’t want to configure GUIs.
me : Debian comes auto-configured. You just install something, e.g. X, and it configures it automatically.
Ubuntu User 2: No, Debian does not play games.
I really don’t understand this, if there is Open Source game, and the package is not available for Debian then you can compile it form source. But my friend does not say that he can’t compile, he says “Debian does not run games”. See the difference ?
Ubuntu User 1: I will not use Fedora, my sound system does not work in Fedora. It works in Ubuntu. So I will use Ubuntu.
me : your statement does not make any sense. Both Ubuntu and Fedora are Linux distros, you can check the sound module of your card and load it in Fedora.
Ubuntu User 1: you don’t want listen to me. I said, there is no sound coming in Fedora.
me : you need to run the lspci to check for what hardware you have and the see lsmod on Ubuntu to know the name of the kernel module being used for sound. Also check for Linux kernel version.
Ubuntu User 1: I will ask some one else who can solve my problem, you just don’t understand it.
Ubuntu User 2: Why go so deep into Linux. He can just reinstall Ubuntu if he gets problems.
… and they got angry. No.. I am serious, they are angry now.
I can show you thousands and millions of Linux users like this, who don’t want to know how to solve problems . First I thought, they don’t like the black screen of command line (I too don’t like it) or even the white background of X-terminal (which I do like), then I thought no one likes to type some words, you just need a mouse click and even these days companies are creating mouses with which we can type characters using clicks. Then I came to know the problem is more fundamental than Linux issues. The problem is of pain, finding the cause of some problem is a painful process (whether Linux or real life), even when you want to build a new house or put the wash-basin at some place in yoru house , it takes some amount of understanding and familiarity with how the houses are constructed and used by people. Putting time into understanding the house when your retired Father is finally building his sweet home , takes energy and the ability to take pain (mental exhaustation ?). All of colleagues are not running away from Linux, they are running away from pain the Linux gives. No one wants pain, everyone wants joy. Yeah.. me too. I want happiness and peace of mind.. the joy of life. The why do I believe in struggling with problems in Linux for days and nights when a 45 minutes Ubuntu reinstall will solve the problem. Why do I get into pain ?
To answer that question I have to go back to my earlier days, the day before I even installed Linux, the day my friend Dinesh mentioned the word Linux to me. Its all about happiness. So let me answer the question I have aksed: Why did I install Linux, because I trusted my friend, I knew he is intelligent than me, Its matter of friendship, the trust and respect you give to your friend based on his ability to creeate angels and daemons on hardware. Moreover I accepted my incompetence in front of him. Dinesh knew it wil be painful for me (a typical Windows User) to install Linux but he never helped me, he never said that he will want to help me. It was like the Cat’s kid, the Cat does not pick up her kitten when he falls while walking on some fence. She does not help her children because she wants them to learn to face the reality of life (quite in contrast to Human Mothers). I think thats why Cats grow out to be so intellgent. It is natural process of how cats grow their kittens. Kitten feels pain but that is required to successfully walk the fence, he needs training and his Mother gives him proper. Same way Dinesh behaved like. In the World of Linux, he was Cat and I Was his kitten and he handled me well. I am proud of having a friend like him who belives in letting people learn themselves rather than spoonfeeding them, a typical Hacker behavior.
Now when I struggle with the problems for days, then I am learning, I am looking for the final happiness, the long-term hapinnes, rather the short-term happiness caused by reinstallation. My friends have based their Linux learning on short-term happiness, thats the whole point. Their definition of hapinnes and my definition of happiness are different. They want quick-fix (cocaine ?) and I Want to drink Milk for 2-4 years continuouly everyday becayse only after years of this daily routine I will be in a good health. Their source of happiness is 2 hours ( Bade Miyan Chote Miyan ?) , my source of happiness is solving problems ( The Money Masters ?). and thats the source of everyone’s way of living this life. If you are still reading, good and if you are still reading and understand it too, well, congratulations, you can be the one you want to become. As a final note, I have edited the subtitle that comes with Ubuntu:
Linux for Idiot Beings
or need I say: Linux for Windows Beings, for Windows and Ubuntu users don’t have any identity of their own, they have let Microsoft shaped their way of thinking about software. They are no longer original but just copies of the way the Windows is designed.
Copyright © 2006, 2007, 2008 Arnuld Uttre, #331/type-2/sector-1, Naya Nangal, Distt. – Ropar, Punjab (INDIA) – 140126
Verbatim copying and distribution of this entire article are permitted worldwide, without royalty, in any medium, provided this notice, and the copyright notice, are preserved.
The Old-Fashioned Business
September 16, 2008 at 4:47 pm | Posted in History, Patterns | Leave a commentTags: business, MNC, open source, proprietary software, software company
A long time ago I heard that viacom was going to sue Google (YouTube) for copyright violations. Recently I read about it on web. I also read recently that Symantec has sued Microsoft over Vista. See here, here and here. Then a little googling told me its actually an international business idea. IBM sues PSI, Alcatel sues Microsoft, Google sues Microsoft, Microsoft sues Google. Then I thought of Halloween Documents where Microsoft said that to completely obliterate Open Source Software, they need to target Open Source Phenomenon rather than one or two companies. At least they have the talent to understand that.
Now that really does not make any sense. All companies like Microsoft, IBM, D-Link, Apple, HP and many other biggest Software players in the market all make money using Proprietary formats, they all are in the same business, they all use same weapon to make money, code-secrecy a.k.a software-patents and then they also sue each other over patent infringements. It really does not make much sense but If you look closely over the incidents you will see a pattern emerging out of your browser, telling you something. In World War 2, in the totalitarian government of Hitler, the power means secrecy. How the Enigma cipher worked. How Allies cracked this highly cryptographic machine. Hitler’s war tactics were completely sabotaged when Enigma code was cracked. A totalitarian government has one weapon and it uses it in parliament, in intelligence, in police, in administration, in business, in itself.. this weapon is called secrecy and when it gets broken, its very easy to take them down. This is what happened in Germany in World War 2 and this is what is happening in US right now. Unfortunately the software is working the way, the companies who have monopoly over some products (monopoly on software patent exactly works in totalitarian way) like Apple over iPod, Microsoft over Desktop, Google over web are using code-secrecy as their primary weapon. They all share one common thing, software-patent, dictatorship over the people who use their products on they gonna use them, exactly like how you gonna live if you are a Jew and its 1933 and you are currently in Germany. All of these proprietary software companies have only one weapon, that makes them stand under one umbrella, under one common cause: Code-Secrecy. Even after this they all fight with each other, spend billions of dollars in courts and in settlements out of courts every year. What does that mean ?
That means the owners and runners (and the managers who help those runners) of multi-billion corporate companies have vulnerabilities in their character which can be exploited very well by companies running business without secrecy, making money on Open Source software. I also very firmly believe that those weaknesses of characters can be written down in the form of a Reference Manual which every Open Source business company should read before they start to create their business strategy. Again, the question is not of the cry of a single giant like Microsoft, it is of a process called proprietary software which has gotten hit with Open Source[1]. If these companies want to not only stand but grow in the this highly competitive market then they need to come to one with each other. They need to aid and nurture and help each other otherwise Open Source will keep on hitting all of them every hour, every day, every month every year. Better, they adapt to new ways of doing software business, after all , to grow a business means to change and adapt and take the dollar in return of it
.
Open Source has put light on the fact that code-secrecy is the old-fashioned way, that market has changed now. The ones who will stand on the new and changed concepts of business are the ones who will be the forerunners of the future. No company, with enough self-respect, wants to be in the business for short-term. Every company desires to have the monopoly over the market. Those who understand the business and foresee the future become the ones nearly impossible to defeat. Take Google, their founders tried to sell their search engine and no one liked the idea. After 10 years, see where the Google is, Google has made so much money in 10 years that took Microsoft 25 years to collect. Business paradigms are getting shifted, ways of doing software business change as fast as a software decade passes. You decide where you want to stand, wither you are the one or not. There is no place for medium-profit lurkers in todays Software world. Either you are in or you are out. You decide. Before you refute my article make sure you read how Red Hat has started into Open Source business. How their founders learned that making money on proprietary software and making money on Open Source software are not very much different when it comes to business. The thing, which they never said, I think is, in Open Source, there is No Fear of losing the code, you have already learn how to manufacture dollars by sharing of code. Sharing of Code is the biggest nightmare of every proprietary software company and this is the tool that their competitors can exploit to maximum extent. This fear is open and free and code-secrecy is the Enigma that can be cracked by some penniless but an individual with a sense for business. you only need courage and logic of business in doing so. Good Luck
[1] Its not like that companies whose business is based on code-secrecy will go out of business. They will remain here for a much longer time. My point is over a decade from now, they will no longer be the kings, though they will be cutting millions every year.
Copyright © 2008, Arnuld Uttre, #331/type-2/sector-1, Naya Nangal, Distt. – Ropar, Punjab (INDIA) – 140126
Verbatim copying and distribution of this entire article are permitted worldwide, without royalty, in any medium, provided this notice, and the copyright notice, are preserved.
Open Source, Salary & Society
September 12, 2008 at 5:53 pm | Posted in Patterns, Programming | 2 CommentsTags: corporate, free software, jobs, open source, OpenSource, programmers, salary, software
Very Recently I read an article titled Franchise by Russ Nelson. I was quite impressed by the man’s talents. He says that even if we have Free Software running on all across the world, the salaries of programmers will still be on a higher scale and he concludes by disagreeing with the Richard Stallman. I was very happy th at he disagrees on such a point on technical basis rather than biased opinions. On the basis of my very small amount of experience in software and my experience in analyzing the general life, business aspects and experience by the habit penetrating deep into the economics I can very strongly state an opinion which is very different both from Russ Nelson and Richard Stallman. When Russ Nelson said In a free market, over time, competition in the production of a commodity product will eliminate all profits, he was right and he was talking about the business owners, the lords of the companies. He is not talking about programmers. At such point, after such threshold, the salaries of programmers will become independent no matter whether the programmer will be working in company creating proprietary softwares or in a company creating free softwares.
One more thing I am sure of that will happen is the reduction in the number of poor programmers getting high-paying jobs and that will relieve Joel Spolsky of his worries a bit about poor quality software
. Since at that point humanity will be liberated from poor thoughts, businessmen will come to one in contact with quality programmers and in conflict with poor ones. Either you make quality bread or you shut down your bread house, which a business man will not. He will simply fire the poor bread maker and hire a good one who can practically make good breads, not theoretically. Myself, personally, I really hate it when I see good, quality programmers earning 20% of the salaries than poor ones who with years of experience still use void main() and solve problems using arrays all the time in C++.
Now the only question remains is salary will be on a higher side or on lower plane. I am sure both salaries of programmers and software coming out of the hands of programmers in such an open market, will get better. I don’t think programmers will get way much higher. I repeat both softwares coming out of the hands of the programmers and salaries of those programmers will be better than what we are getting in today’s proprietary, closed and non-cooperative corporate culture. I think good programmers in such an era will not be poor like what we have the situation now.
That trend has to go, good programmers need to be paid good and poor programmers need to be fired. In fact poor programmers must be capsuled in a spaceship and need to be sent away to the Saturn at minimum, so that they will no loner be able to pollute and handicap our society’s intellectual humans and our kids. This time is still years ahead, it may take a decade before it happens but who knows, after all software is field which is totally different and unusual of all the professions exist today. I am glad to be a Computer Programmer.
Copyright © 2008, Arnuld Uttre, #331/type-2/sector-1, Naya Nangal, Distt. – Ropar, Punjab (INDIA) – 140126
Verbatim copying and distribution of this entire article are permitted worldwide, without royalty, in any medium, provided this notice, and the copyright notice, are preserved.
Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.