Andrei Rinea

.NET Framework & SQL Server

The great thief

clock November 28, 2009 00:32 by author Andrei Rinea

From the Tao programming

 

There once was a man who went to a computer trade show. Each day as
he entered, the man told the guard at the door:

"I am a great thief, renowned for my feats of shoplifting. Be
forewarned, for this trade show shall not escape unplundered."

This speech disturbed the guard greatly, because there were millions
of dollars of computer equipment inside, so he watched the man
carefully. But the man merely wandered from booth to booth, humming
quietly to himself.

When the man left, the guard took him aside and searched his clothes,
but nothing was to be found.

On the next day of the trade show, the man returned and chided the
guard saying: "I escaped with a vast booty yesterday, but today will
be even better." So the guard watched him ever more closely, but to
no avail.

On the final day of the trade show, the guard could restrain his
curiosity no longer. "Sir Thief," he said, "I am so perplexed, I
cannot live in peace. Please enlighten me. What is it that you are
stealing?"

The man smiled. "I am stealing ideas," he said. 

 

Currently rated 4.0 by 1 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Debating on the internet

clock November 23, 2009 07:07 by author Andrei Rinea

Just like "Fighting in the internet is like competing in the special olympics : even if you win you're still retarded" there is another "saying" about these issues : 

 

Currently rated 4.0 by 1 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Funny 404 Page

clock March 15, 2009 23:09 by author Andrei Rinea
Just oversaw on TradingGoddess's twitter a link to a (very) funny 404 page. Enjoy!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


How to write unmaintanable code - anti patterns

clock September 6, 2008 11:56 by author Andrei Rinea

I was reading on Stackoverflow.com (the beta version) about useful articles in a programmer's career. I stumbled upon the following pearl :

How To Write Unmaintainable Code by Roedy Green.

A very well written counter-example, well structured. An excellent combination of humor and discipline. I strongly recommend readin the original article, using the link above. However if none of these don't convince you I will show a few samples here :

 

In the interests of creating employment opportunities in the Java programming field, I am passing on these tips from the masters on how to write code that is so difficult to maintain, that the people who come after you will take years to make even the simplest changes. Further, if you follow all these rules religiously, you will even guarantee yourself a lifetime of employment, since no one but you has a hope in hell of maintaining the code. Then again, if you followed all these rules religiously, even you wouldn’t be able to maintain the code!

Let's get started :

Be Abstract
In naming functions and variables, make heavy use of abstract words like it, everything, data, handle, stuff, do, routine, perform and the digits e.g. routineX48, PerformDataFunction, DoIt, HandleStuff and do_args_method.

Abstract notions :

Programmers are lulled into complacency by conventions. By every once in a while, by subtly violating convention, you force him to read every line of your code with a magnifying glass.
You might get the idea that every language feature makes code unmaintainable — not so, only if properly misused.

Naming conventions seem to be a mantra :

Bedazzling Names
Choose variable names with irrelevant emotional connotation. e.g.:
marypoppins = (superman + starship) / god;
This confuses the reader because they have difficulty disassociating the emotional connotations of the words from the logic they’re trying to think about.

Reuse of Global Names as Private
Declare a global array in module A, and a private one of the same name in the header file for module B, so that it appears that it’s the global array you are using in module B, but it isn’t. Make no reference in the comments to this duplication.

Something that I thought people should go to jail for :

Overload new
Overload the “new” operator - much more dangerous than overloading the +-/*. This can cause total havoc if overloaded to do something different from it’s original function (but vital to the object’s function so it’s very difficult to change). This should ensure users trying to create a dynamic instance get really stumped. You can combine this with the case sensitivity trickalso have a member function, and variable called “New”.

A timeless pearl :

Clone & Modify
In the name of efficiency, use cut/paste/clone/modify. This works much faster than using many small reusable modules. This is especially useful in shops that measure your progress by the number of lines of code you’ve written.

Unheard horrors :

Use Three Dimensional Arrays
Lots of them. Move data between the arrays in convoluted ways, say, filling the columns in arrayB with the rows from arrayA. Doing it with an offset of 1, for no apparent reason, is a nice touch. Makes the maintenance programmer nervous.

If by now you are not convinced that this is an article worth reading I assure you the samples shown by me here don't cover more than 10% of the material there.

 

Go read it !!! 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Smart mom

clock December 4, 2007 11:52 by author Andrei Rinea

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Programming humor

clock August 1, 2007 11:45 by author Andrei Rinea

“Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.” — John F. Woods

 
I love deadlines. I like the whooshing sound they make as they fly by.
Douglas Adams

 

Debugging is twice as hard as writing the program, so if you write the program as cleverly as you can, by definition, you won’t be clever enough to debug it.

 

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

 
[Sonium] someone speak python here?
[lucky] HHHHHSSSSSHSSS
[lucky] SSSSS
[Sonium] the programming language

 

“I don’t care if it works on your machine! We are not shipping your machine!”

It’s the blog tagline of one Ovidiu Platon, Romanian Microsoft Student Partner. Unfortunately it disagrees with the “Works on my machine” Certification. Damn shame!
 

“If the user can’t find it, the function’s not there”

 
“In theory, theory and practice are the same. In practice, they aren’t even close”
It can be applied to many fields, but goes great with programming.

 

Premature optimization is the root of all evil in programming.
—C.A.R. Hoare

 
Programs must be written for people to read, and only incidentally for machines to execute.
—Abelson and Sussman

“Web Services are like teenage sex. Everyone’s talking about doing it, but most people aren’t; and the one’s who are doing it aren’t doing it very well.” - Not sure who said that

 

” What is the object oriented way of getting rich?”
- Inheritance

 

Your mom is so fat she sat on a binary tree and turned it into a linked list in constant time!



Saying Java is good because it works on all OSes is like saying anal sex is good because it works on all genders.



“If builders built buildings the way programmers wrote programs, then the next woodpecker that came along would destroy civilization.” - Unknown.

 

“Computer science is no more about computers than astronomy is about telescopes.” - Dijkstra



Programmers, by nature, want to write good programs. When the completion of a program becomes more important than having a good program, then said program is neither good nor complete.

-James D. Shea


 C++ Class’s, Friend and Private Keywords:

“Only a Friend is allowed to touch my privates.”
 

“Mostly, when you see programmers, they aren’t doing anything. One of the attractive things about programmers is that you cannot tell whether or not they are working simply by looking at them. Very often they’re sitting there seemingly drinking coffee and gossiping, or just staring into space. What the programmer is trying to do is get a handle on all the individual and unrelated ideas that are scampering around in his head.”
Charles M Strauss

 

There are 10 kinds of people in the world - those who understand binary and those who don’t.

 

Pasting code from the internet into production code is like chewing gum found in the street.



GOTO is a four letter word.
Edsger W. Dijkstra

 
 

“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.”
Rich Cook
 

Currently rated 4.5 by 2 people

  • Currently 4.5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


About me

A passionated .NET Developer working closely with Microsoft technologies. View my public site.

Page List

Sign in