Powered By Blogger

Tuesday, June 8, 2010

Joke: Harry's Exam

(src: 27690 Humor and Joke)

A first-grade teacher, Ms Brooks was having trouble with one of her students.

The teacher asked, "Harry what is your problem?"

Harry answered, "I'm too smart for the first-grade. My sister is in the third-grade and I'm smarter than she is! I think I should be in the third-grade too!"

Ms Brooks had enough. She took Harry to the principal's office. While Harry waited in the outer office, the teacher explained to the principal what the situation was.
The principal told Ms Brooks he would give the boy a test and if he failedto answer any of his questions he was to go back to the first-grade andbehave. She agreed.
Harry was brought in and the conditions were explained to him and he agreed to take the test.

Principal: "What is 3 x 3?"
Harry: "9".

Principal: "What is 6 x 6?"
Harry: "36".

And so it went with every question the principal thought a third-gradeshould know.

The principal looks at Ms Brooks and tells her, "I think Harry can go to the third-grade."
Ms Brooks says to the principal, "Let me ask him some questions?"

The principal and Harry both agree.

Ms Brooks asks: "What does a cow have four of that I have only two of?"
Harry, after a moment "Legs."

Ms Brooks: "What is in your pants that you have but I do not have?"
Harry: "Pockets."

Ms Brooks: "What's a start with a C and ends with a T is hairy, oval, anddelicious and contains thin whitish liquid?"
Harry: "Coconut."

Ms Brooks: "What goes in hard and pink then comes out soft and sticky?"

The principal's eyes open really wide and before he could stop the answer, Harry was taking charge.
Harry: "Bubblegum."

Ms Brooks: "What does a man do standing up, a woman do sitting down and a dog do on three legs?"
The principal's eyes open really wide and before he could stop the answer.
Harry: "Shake hands."

Ms Brooks: "Now I will ask some "Who am I" sort of questions, okay?"
Harry: "Yep."

Ms Brooks: "You stick your poles inside me. You tie me down to get me up. I get wet before you do."
Harry: "Tent."

Ms Brooks: "A finger goes in me. You fiddle with me when you're bored. The best man always has me first."
The principal was looking restless and a bit tense.
Harry: "Wedding Ring"

Ms Brooks: "I come in many sizes. When I'm not well, I drip. When you blow me, you feel good."
Harry: "Nose"

Ms Brooks: "I have a stiff shaft. My tip penetrates. I come with a quiver."
Harry: "Arrow."

Ms Brooks: "What word starts with an 'F' and ends in 'K' that means a lot of heat and excitement?"
Harry: "Fire truck."

The principal breathed a sigh of relief and told the teacher, "Put Harry in the fifth-grade, I got the last ten questions wrong myself."

Joke: Diet Tips

(src: 27690 Humor and Joke)

Q: I've heard that cardiovascular exercise can prolong life. Is this true?

A: Your heart is only good for so many beats, and that's it... don't waste them on exercise. Everything wears out eventually. Speeding up your heart will not make you live longer; that's like saying you can extend the life of your car by driving it faster. Want to live longer? Take a nap.

Q: Should I cut down on meat and eat more fruits and vegetables?

A: You must grasp logistical efficiencies. What does a cow eat? Hay and corn. And what are these?vegetables. So a steak is nothing more than an efficient mechanism of delivering vegetables to your system. Need grain? Eat chicken. Beef is also a good source of field grass (green leafy vegetable). And a pork chop can give you 100% of your recommended daily allowance of vegetable slop.

Q: Is beer or wine bad for me?

A: Look, it goes to the earlier point about fruits and vegetables. As we all know, scientists divide everything in the world into three categories: animal, mineral, and vegetable. We all know that beer and wine are not animal, and they are not on the periodic table of elements, so that only leaves one thing, right? My advice: Have a burger and a beer and enjoy your liquid vegetables.

Q: Aren't fried foods bad for you?

A: You're not listening. Foods are fried these days in vegetable oil. In fact, they're permeated in it. How could getting more vegetables be bad for you?

Q: Will sit-ups help prevent me from getting a little soft around the middle?

A: Definitely not! When you exercise a muscle, it gets bigger. You should only be doing sit-ups if you want a bigger stomach.

Q: Is chocolate bad for me?

A: Are you crazy? Cocoa beans... Another vegetable. It's the best feel good food around! I hope this has cleared up any misconceptions you may have had about food and diets. Have a cookie... flour is a veggie!

Monday, May 10, 2010

10 ways to suck at programming

source: http://www.finalint.com/2010/05/04/10-ways-to-suck-at-programming

#10 – Don’t store settings in a configuration file

When you’re writing a sizable application, things like database connections and SMTP server information will be used throughout the app. The best way to make sure your app is entirely immune to maintenance is to redefine those little bits of information every time you need them. So instead of putting them in the configuration file (Web.config or whatever) just leave them in your compiled code. Whoever inherits the app will thank you for sending them on a hunt through thousands of lines of code to change which SMTP server is being used. What’s even more fun is when the next programmer only finds 14 of the 15 places where you’ve used this code and a single instance somewhere deep in the app silently breaks hundreds of times without anyone knowing. Sometimes it’s helpful to build the variables in inconsistently concatenated strings. The repeated and more frequent interaction between the new developer and the disgruntled client will help strengthen their relationship. And if you don’t hook up that love connection, who will?

#9 – Don’t store variables in [any] memory scope

One of the great things about databases is they store your bits of information and allow you to access them whenever you need them. To make sure your app is as terrible as possible, you’ll want to be sure and access the database every time you need a bit of that information. The more common the information is that’s needed, the bigger win you’ll have by making a new database connection to get that information. Non-sensitive user information is a great use of this prinicple. Don’t worry about defining a user’s information, such as “isAdmin” to a variable and using it throughout the current request. Just query the database each time you need to know anything about the user. After all, the client paid for that database, we’d better get as much spin out of it as possible!

#8 – Use arcane plugins

If the client has a non-standard request, such as formatting a table in a way that is outside the abilities of your WYSIWYG editor (colspan are hard). You should definitely hit up the interwebs and search for random unsupported closed source plugins to do the work for you. If you would spend almost an entire hour writing it yourself, you should spend at least 3 hours searching for and getting a plugin that does roughly but not exactly the same thing. Bonus points if you can get a plugin that doesn’t do what you need, but offers 15MB+ of functionality you have no use for and include it without getting caught. Bonus bonus points if the documentation for that plugin is in a language not native to your market (for example, if you’re working in an English speaking shop look for plugins that are documented only in Spanish or German).

#7 – Never, ever remove functionality

Over the course of developing a large application there are bound to be times when functionality you were working on proves itself to not be needed. Now, to be sure to leave plenty of dead ends for those who come behind you to get lost in, never delete that functionality. Maybe even comment out random parts of it, or even hundreds of lines of it at a time, but don’t delete it. Imagine the hours of fun the future-crew for this app will have while they trace through this functionality only to find that it isn’t needed! If you can make it seem needed, without actually needing it, it will even keep them from deleting it themselves… This way the fun is exponential! Oh, a bonus on this one… if your project uses source control and multiple server environments, be sure to have a different version of your files (both code and compiled) on each server and source control. This way no one will know which one is live in production and who doesn’t love a good round of Code Russian Roulette?

#6 – Screw performance

Large applications, you know, the ones that pay the bills, are generally needed because they deal with large amounts of data. Sure, during your development process you’ll create 20 or so test records. Take my word for it, there’s no need to even worry about what happens once you get to 25 records, or even 1,000! Obviously, all pagination will work just fine and performance will never take a hit. So if it compiles, ship it!

#5 – Nest major logic/functionality in loops

Now obviously, we’ve already covered #6 so we know that we’re working with large amounts of data. And inevitably, there will be plenty of looping through that data to do work with it. If you want to make sure your application is really difficult to maintain and completely unusable to the client, you should embed major functionality and/or logic inside of these loops. For example, instead of running a query against the database to get ALL the data you need, storing the data in memory and working with the variables in memory during your loop, just get all the data except one field up front and loop through it… then on each loop you should get all the data again, and now include your extra field. This will guarantee that your app will never survive more than 5 concurrent users (re: #6). So for review: Get data > create loop > get data > work with data. I’m sure you see some room for added idiocy in that process, so feel free to nest this idea as many times as you want.

#4 – Document NOTHING

Look, documentation is for morons. I mean either you can read the code or you can’t, right (this was actually said to me at one point)? Of COURSE the next programmer will be able to read the code. What’s really fun though, is when you document absolutely nothing, especially not your intent. It pays to keep them guessing. You’re mysterious, like a ninja. No need to let someone get all up in your grill, knowing everything about what you were trying to do. Because if you document what you’re trying to do and then don’t end up doing it… well… that’s just embarrassing.

#3 – Use and reuse illogical variable names

There’s going to be a LOT of variables needed to work on this app, so you’d better choose a movie or television show with enough characters to use all the names. Lord of The Rings, Star Wars and Family Guy are all good choices for this. Maybe you can even form relationships with the variables. That way, you never have to kill them! You can have variables that are chameleons, changing their usage and values throughout processing and you can recycle them for something new each time you need a variable for new functionality. It’s like they’re growing up, evolving, right before your eyes! After all, you’re trying to be green and reduce your carbon footprint so recycling variables just seems like the responsible thing to do!

#2 – Catch all errors — and do nothing with them

Most languages / platforms nowadays have really good error handling built in. They’ll die somewhat gracefully and give enough details through the default error output to be helpful. You must not allow this to happen! Start off by wrapping nearly every tiny piece of functionality in a try / catch phrase. Then… inside the catch… put a comment, like “// It borked lawl.” This will ensure that if anyone wants to work on this app, they’d better spend the time getting to know the app and it’s adorable character variables before they start wrecking the app altogether.

#1 – Duplicate functionality

If the client tells you that they need two pages: One for an administrator that has all of the details on an item along with a button to delete it; and one for a regular user which has all of the details on an item without a button, you should create multiple pages to accomplish this. In fact, if you can make pages for each user group that would even be better. Making a separate page for each user is the ultimate success. So ninja up and get serious on this one, because it’s your last line of defense against the teeming hordes of qualified individuals who will inevitably be bewildered while trying to update your carefully constructed Pandora’s box of an app.

This is by no means a comprehensive list. On this project alone I could name 10 more things that could make you suck. But I’ll leave it at 10 for now. Anyone have more to add?

Friday, February 26, 2010

[Spolers] Things I learned from watching Legion

1. Give your boss what he needs, not what he wants, and you will get rewarded.
2. Angels and Demons look the same.
3. Some archangels have bullet-proof and sharp wings
4. Archangels are trained using guns, swords and maces, also grapping and kick-boxing.
5. Low-level angels have magical powers like possess human, stretch limbs, grow shark teeth, walk on ceiling, turn human into acid bomb but don't know how to fight at all.
6. God does not know what he wants, so be careful.
7. Single mothers or waitresses have an ability to give birth in 2 minutes and then go climbing. Their children are ridiculous big and touch as diamond.
8. Be friend to a fallen angel, when he dies, you'll get some cool tatoos.

And this guy's review is just crazy funny:
(http://www.imdb.com/title/tt1038686/board/flat/156026894)

I saw it so you didn't have to. This is a review.

Also, heavy spoilers.

God is sick of humanity sucking, so he sends another apocalypse, like the great flood, only this time, it's angels possessing the weak willed to, for some reason, kill an unborn child in a diner. Okay. Whatever. I'll go with that.

THEN, the Archkyle Reese - I mean, Michael comes down and cuts his wings off, for some reason. I don't know. And he has a collar on, that falls off. I guess all Archangels wear collars. Maybe. Who knows, it's never explained, but whatever.

So, he steals a bunch of weapons from a toy factory (never explained, but there are a TON of weapons in there) and we meet the first of the possessed - a cop, who, for some reason when he gets possessed, gets baby teeth. Oh, joy.

Then we're introduced to the diner. 30 minutes pass where nothing happens. A few more minutes pass with *beep* still not happening. Then an old lady comes to the diner, eats a dudes neck, calls everyone *beep* and jumps onto the ceiling and tries to kill one of the main characters - named JEEP WHAT THE *beep*? - who cannot pull the trigger on a shotgun to kill her. This is important, as he will work up the resolve later to pull the trigger. Which is pretty hilarious.

Anyways, a thug ends up shooting the old woman, who also has baby teeth. Baby teeth. Oh, okay, we're now dealing with the same thing we ran into in the city. Anyways, the characters mostly spend the next few minutes standing around and we get to know them a little more. We have Dennis Quaid playing himself, his son, Jeep, the pregnant waitress, who is a huge BITCH throughout the movie, the one handed cook, the thug, the preppy wife, her husband (the one the old lady munched on), and their hot daughter.

Anyways, they all pull the body outside, and dump it behind a dumpster, when Archkyle Reese shows up in a cop car. After a fake tense standoff where they demand to see his teeth (somehow knowing that they're dealing with a plague and that all the victims have their teeth turn into baby teeth. Or shark teeth. They're referred to as both for this one scene and then never mentioned again) - and decide that he's cool. Then he brings in enough weapons to wipe out Las Vegas, and they get settled in.

So, a bunch of people drive off to try and get help for Rich Dad, and get FLOODED BY LOCUSTS. I mean, literally. Not only is their car completely covered in dead bugs, but they return minutes later, unscathed. Even after the locusts flood the car by way of the AC system. They’re not even covered in bug goop.

Reese tells them that it's his mission to save the child. Everyone is incredulous. Even Bitch. I mean, really. Reese then tells them that Angels are possessing the weak willed (the elderly and children are the easiest to turn - foreshadowing, maybe? But I don't want to credit the screenwriters with enough ingenuity to even use that device) - and that this is part of God's plan.

Everyone is pretty weirded out, especially One Armed Cook. He's kind of pissed that Angels are possessing people for the purpose of infanticide and murder. Then again, so am I, and I'm not even a Christian. And excuse me, what kind of old lady Angel uses the word *beep* Are the Angels just using these vessels to vent all their frustrations? You know, the ones pent up living in *beep* PARADISE?!

So then Cook, Jeep, DQ, and Thug go up to the roof to fight off Wave 1, which is an ice-cream man. But then Wave 2 comes and it's literally hundreds of people, who, after dragging Rich Husband off, relent. Michael explains that this was a test of the survivor's strength. The next will be a test of their weakness.

Excuse me. There were HUNDREDS of possessed out there. Obviously they don't have Starcraft in heaven. You can win tons of maps by simply Zerg-Rushing. They could have ended everything right there, but no. No. This entire movie is about how God is wrong. It's actually a theme.

Archkyle Reese – 1. God – 0.

So, some more *beep* happens now - not interesting *beep* mind you. Everyone gets paired up, and then they speak in Monologues. Bitch is kind of a bitch, and Jeep is a high functioning retard. ... Okay. That might be a low blow, but he's seriously a huge idiot. A huge. *beep* Idiot. One Armed Cook talks about how his Dad used to read him the bible, and that the life you lead better be worth living. Or something. I don't know, everyone is speaking in platitudes.

Anyways, DQ goes up to the roof and promptly endangers the entire cast by falling asleep. If only this had been better worked into the story, or maybe DQ could get turned. He shows weak will throughout the entire movie - starting smoking again, drinking beer, falling asleep - but sadly, this is never touched on. I'm not even kidding. DQ doesn't even do anything in this movie. Everything he does contributes nothing to the survival of anyone, ever.

Anyways, Rich Husband's back, somewhere outside, and calling to Preppy Wife. She tears down the barricade at the back of the building to find her husband TIED TO AN INVERTED, BURNING CROSS. Did the Angels do this? Yes. They're pretty pissed, I guess. But at who? I mean, really, the inverted, burning cross is more of a stab at Jesus than it is at the Diner Patrons. So I guess that's pretty *beep* up. Anyways, she runs out to get him, and he's boiling or something. I don't know. Anyways, just as he explodes, One Armed Cook comes outside and shields her from the blast. Despite the fact that we see they're both okay, once One Armed Cook makes it back inside, he falls over. Rich Husband, upon exploding, shot acid everywhere and burned through One Armed Cook's back, killing him. So we lose morality, the best actor in the movie, and the most interesting character in one fell swoop.

Joy.

People get paired up again. Hot Daughter ties Preppy Mom up so she doesn't pull any shenanigans like that again, and Preppy Mom yells at her daughter, telling her the reason they're moving is all her fault. Which kind of sucks. Very harsh. But I mean, she did just see her Rich Husband explode. Then again, Rich Husband WAS Hot Daughter's father. Hot Daughter seems to be taking it pretty well.

More monologue occurs. We find out more about Thug, and Hot Daughter. Michael talks to Jeep and Bitch, and tells Jeep the reason Kyle Reese - I mean, Michael is rebelling against God is that there are people like Jeep out there. So, Archkyle Reese loves humanity because of high functioning retards. I guess Reese sees a kindred spirit in them. The *beep* is rebelling against GOD, the space wizard who holds ALL THE *beep* CARDS, because of people like Jeep. God hates stupid people, Reese loves them. And there we are.

Anyways, the lights come back on at the diner, luring a pair of glorified extras, a father and son to get gas at the diner. The trap is set! Tons of possessed swarm them. I guess the Angels are banking on... uh... the inner strength of the Diner Dashers to want to save the people in the van. Despite the fact that God is trying to wipe everything out, they're relying on the goodness of people... Okay. Right.

It works! Thug jumps off the roof right as Dad gets splattered! Thug starts unloading tons of shots at everyone, scooping up the kid and taking up the best defensive stance in the history of man - in the middle of a circle, surrounded by possessed. Instead of, you know, running back to the diner.

In the twist that everyone saw coming, the kid is possessed, bites Thug - and this is a magic bite, because the same type of bite from a much larger mouth earlier did not kill Rich Husband, but let him be tortured for hours - and this kills him. And Hot Daughter jumps off the roof to save him for some reason. Bitch is inside, saying they need to take the barricade down to save Rich Daughter. Archkyle Reese tells her no. Bitch says that if he doesn't go out and help Rich Daughter, then she'll go out there. Reese relents, and goes out there. I guess it's okay if Thug gets killed. No one really threw a fit over that. I mean, after all, he did save everyone's life earlier by plugging Evil Granny. But Hot Daughter, who has done all of NOTHING but wear a thong and dance at a jukebox in an homage a much better film (any film that uses that shot. One Night at McCool's, even.). So Arch Kyle Reese runs outside and guns all of them down, then blows up some gas pumps, bringing Hot Daughter back inside.

Well, at least of the two that were in danger, we've saved the one who has done *beep*-all and has never handled a firearm before. She's even given a gun prior to this scene and instead of engaging targets in her suicide run, just flails about like a spaz. Maybe being a spaz is the best weapon, as so many characters in this movie spaz out.

Anyways, Evil Kid is in the diner and he manages to slice Bitch across the gut before somehow - and I *beep* you not - SOMEHOW MANAGES TO CUT HIS OWN THUMBS OFF, dropping the knife. Bitch, instead of doing something useful like stabbing Evil Kid, is instead dumbstruck that something would attack her. Even though Archkyle Reese told her SEVERAL TIMES that her baby is the target of attacks. I guess maybe Bitch thought that the baby could be killed without her being harmed. I doubt she even knows how she got pregnant in the first place. Anyway, Evil Kid goes all over the ceiling, and is about to kill someone, when he's shot off-screen. By Jeep.

Jeep had trouble shooting people earlier - even throws up after seeing Evil Granny get gunned down - but he has NO QUALMS WHATSOEVER about gunning down a small child.

...

Whatever. His name is Jeep. I realize that I've been making up names throughout this thing, but that's his real *beep* name in the movie. I thought it was "Jay" at first, but no. It's "Jeep."

So, Bitch gives birth to Suspiciously Large, Rubber Baby Savior of Humanity, and that's when the *beep* hits the fan. God's plan was to have Bitch be killed, for some reason, before her child is born or something, and the possessed CANNOT stand the sound of the baby's cries. Which is great - I mean, I wouldn't think God would have to plan this far ahead. He is God, after all. So the possessed are now useless when around the baby.

Archkyle Reese - 2. God - 0.

We get a flashback of heaven that makes it look like the spaceship from Predator, where we meet the Terminator, Gabriel. Archkyle Reese talks about giving God what he needs, not what he wants. Wonder if that'll come back.

Anyways, there's a moment between Preppy Mom and Hot Daughter where they reconcile, immediately before Preppy Mom goes basthit crazy, escapes from her chair, and steals the baby, wanting to turn it over to the Archterminator Gabriel. Gabriel pops through the door, Archkyle Reese blows Preppy Mom away - who drops the baby, and in a slow motion dive, Jeep catches a fake looking babydoll with scrunched face - and then Gabriel, complete with bullet proof, razor edged wings, starts tearing *beep* up.

I paused at this point, pondering - those wings are *beep* useful. And pretty well hidden. After all, I didn't even see them when Archkyle Reese beamed down, as they were easily concealed beneath a common trenchcoat. They're bullet proof and can cut people, so why the hell did he get rid of one of the best offensive defenses ever? Because *beep* this movie.

Gabriel wrecks *beep* and Hot Daughter, Jeep, Bitch, and Rubber Baby Savior of Humanity make it out the back while he and Reese duke it out. Also, DQ gets cut across the gut at this point and we're lead to believe he's dead.

So, Archterminator Gabriel and Archkyle Reese exchange dialogue, and then fight. Gabe gets the upper hand, and using a sneaky, underhanded tactic, impales himself to impale Reese. "You wanted to liiiive like one of them," he pauses, inhaling his own musk, "Now you will die like one of them."

Then Reese dissolves into a bundle of white light. Gabe seems pretty unperturbed by this. I guess he's never seen how 'One of them' really dies before and assumes that dissolving into light is par for the course.

OH BUT DQ is alive! And before Gabe can do anything, he's terminated. DQ blows up his rest stop. Baller.

So, then we have Jeep, Hot Daughter, Bitch, and Rubber Baby Savior of Humanity are driving, when Gabe, unhurt, crashes through their back windshield.

Thanks for nothing, DQ. Your wound was TOTALLY treatable. Now, not only have you killed yourself, condemning your remaining existence to hell, but you didn't do a goddamn thing to help anyone. Good going.

Jeep speeds the car up, and slams on the brakes, sending the Terminator through the windshield. I should also point out that all the tattoos on Archkyle Reese have now transferred over to Jeep, and Reese told him before leaving the diner that they're a prophecy, he should find some prophets, and uh... Get that *beep* read. Or something. It doesn't really make sense and is never explained.

Anyways, because Jeep is a *beep* failure at everything, by speeding up and slowing down - a technique they teach you at driving school, mind you, as basic car operation - he crashes the car. And I would have thought doing that to send a guy with giant razorblades on his back out the front of your car, from the back, would be a bad idea, as he might kill everyone in the car, but then again, THIS MOVIE. So.

After Bitch wakes up, she tells Jeep that Rubber Baby Savior of Humanity survived the car crash, but Hot Daughter did not. She does not vocalize this - instead, Jeep asks if she's okay, and Bitch just shakes her head.

Okay, excuse me, you're going to *beep* kill off everyone that wasn't Bitch, Jeep, or Rubber Baby Savior of Humanity? You're going to kill off someone who has survived watching both her parents brutally murdered, off-screen? *beep* you.

But the baby, which has a much stronger constitution, is fine. I guess being made of rubber really helps things.

Archterminator Gabriel is not done, however! He chases Bitch and Jeep up a cliff, where Jeep promptly tackles Gabriel off said cliff, and does not die, as he breaks his fall with Gabriel.

Right as Gabriel is about to kill Jeep, Archkyle Reese comes back, wings and everything, and slices Gabe across the gut. "WHY DID YOU GET TO COME BACK?!"

"Because I gave Him what He needed, not what He wanted." Yup, that line came back. Reese allows Gabe to leave, and then instead of interpreting the tattoos he gave Jeep, leaves. I guess he thinks the journey is important or something, who knows, it's never explained. He leaves Jeep and Bitch and Rubber Baby Savior of Humanity stranded in the middle of the desert. But that's okay - Jeep just climbs up the cliff he fell off, and in about 20 seconds, he's back with Bitch and Rubber Baby Savior of Humanity. And then they drive off in a car full of weapons, complete with Bitch wearing a bandana, like Sarah Conner.

... Now, I don't know why they're carrying all those weapons. From what Archkyle Reese said, it sounds like they're calling off the Apocalypse due to God being wrong. I guess they think that God could just as easily change his mind again. After all, he's God. He's wishy washy.

Not only did the movie suck, but man, did they *beep* up the God character.

"Oh, you're rebelling, Michael? How long have you been God? Because I've been God since forever, you *beep* And you think you know what I need? I know what I need. I'm *beep* God, you son of a bitch. You think I might be going senile? Yeah? I invented senility, you prick. No, no, I get it. You think you can do a better job as God, but guess what. You're not God. You will never be God. This isn't a position I was elected to. *beep* yourself."

No, instead, in this movie not only is God totally fallible, he's proven wrong at the end.

*beep*.

This.

Movie.

(The end score is Archkyle Reese – 3. God – 0.)

Wednesday, November 4, 2009

The Benefit of Web 2.0 from Social Perspectives

I. What are they?
Internet has become so familiar. With chatting and email, people can contact others from far away immediately. Moreover, many people use internet for looking for specified information or reading news. There are also millions of web pages that contain many kinds of information. It’s normal for someone to have their own webpages. And web is still in its endless development to become better, more useful and friendlier. This essay will talk about an upgraded version of web - Web 2.0, what it is and what benefit it brings to the social networking.


1. What is Web 2.0:
Web 2.0 is second generation of web that allows users interact and share information with other users more widely and easily. In addition, new technologies like Asynchronous JavaScript and XML (AJAX) or Flash can also be used to make the web be faster and more user-friendly. Moreover, Web 2.0 also contains online applications which users can work with directly on the internet and there’s no need for installing anything but internet and web browser.


These websites could represent Web 2.0:
a. The biggest multilingual free-content online dictionary: Wikipedia (wikipedia.org).
b. The most popular social networking site: MySpace (myspace.com).
c. The service with interact maps: Google Maps (maps.google.com)


Some of Web 2.0’s particular points:
a. Web 2.0 is always a beta version. That means it’s always changing. There’ll never be a full version or complete version of Web.
b. Web 2.0 allows users to customize and operate the web’s content as their will.
c. Web 2.0 is based on community intellect and the wisdom of crowds. Everyone can share their own information and knowledge with others.
(O'Reilly, 2005)

In conclusion, with Web 2.0, people are not just able to read information but they can also add their own information.


2. Blogs and wikis:
Blogs and wikis are two familiar contents of Web 2.0. They allow people to express themselves more easily and freely. People now can reach many people from many places they’ve never known before.

Blog is shortening of “web log”. It is like an online personal diary or journal. People normally use blogs to share their personal or professional opinions with others with the same interest. The readers are informed about new entry through RSS and can comment to show their own ideas. Blogs are connected to each other and can be found using search engines.

Why are people using blogs? First, most of them are free. Moreover, blog users can easily create and maintain blogs without knowing anything about something like HyperText Markup Language (HTML). Finally, it’s easy to connect to other people through blogs. That’s why the number of blogs has doubled every 5 months. (Vossen and Hagemann, 2007)

What’s about Wikis? Wikis are web pages using wiki software which enable anyone to create and edit the wikis’s content just using web browser. They are places where everyone can come to read, search for information and share their own. In other words, normal users now can be both reader and author. The word “wiki” is from the Hawaiian word “wikiwiki” which means “fast”. Wikipedia (wikipedia.org) is one of the best-known wikis, and there’s also WikiHow (wikihow.com), WikiMapia (wikimapia.org)…

Since everyone can add, edit, delete wikis’s contents maybe without registration, wikis’s accuracy is based on community intellect. It has been proven that wikis are not flawless. For example, Wikipedia has 3.86 mistakes per article on average. (Vossen and Hagemann, 2007)

Like blogs, most wikis are free to use; sometime people are not even required to register. It’s also simple to create or edit wiki’s articles. And wikis content links that connect to other pages or wikis.


II. What am I going to talk about?
Web 2.0’s got a very important role in building online social network. According to Zimmer (2008), data strongly flow from site to site, from people to people through Web 2.0. He also said “Everyone can and should use new Internet technologies to organize and share information, to interact within communities, and to express themselves”. As a matter of fact, people now can connect to others with the same interest simply and easily.

For example, 43 things (43things.com) is a social networking site that allows everyone to create accounts and then talk about their hopes and what they want to do. Other members can discuss and share their own opinions about how to achieve the goal.

Another popular social networking site is MySpace with more than 100.000.000 registered user (2006). MySpace provides an interactive network for people internationally where they can share profile, photos, music and videos.

Web 2.0 enables people to express themselves, connects them to others, and provides them online applications that they can use directly. But is it totally good? It is; even there are many opposing ideas about it.

According to Gorman (2007), “a world in which everyone is an expert is a world devoid of expertise”. Gorman also said that it’s not like a book; a web article can come to the community directly without any checking and editing, and even if it’s a bad one, many people will be able to read it before it goes off. And many people also prefer reading Wikipedia than a published book (Gorman, 2007). However, the readers have their own knowledge and experiments too. And the real editors are also using the internet. What are the differences between editing a book and correcting a web article? Why do e-books become so popular? Because people get used to reading from their computer or pocket devices which have internet connection, and it’s really a quick way to get the newest information. Finally, wikis are not perfect, their contents do have mistakes, but there’re professors from around the world who are able to correct those mistakes.

Gorman (2007) said “Do we entrust the education of children to self-selected ‘experts’ without any known authority or credentials”. For example, creators and editors of a Wikipedia’s entries are usually unknown; they can actually be anyone without any advance degrees. It’s even worse that they can claim about being professionals and who’ll know (Gorman, 2007). Actually, most of Wikipedia’s entries are summarized from multi sources by different creators and editors; they usually have citations and references so they can be verified if necessary. Moreover, Wikipedia doesn’t mean to be a replacement of the existing resource system, it’s an addition. One of Wikipedia’s important notes is:
“Most educators and professionals do not consider it appropriate to use tertiary sources such as encyclopedias as a sole source for any information — citing an encyclopedia as an important reference in footnotes or bibliographies may result in censure or a failing grade. Wikipedia articles should be used for background information, as a reference for correct terminology and search terms, and as a starting point for further research”.
(http://en.wikipedia.org/wiki/Special:Cite?page=none)
Wikipedia itself asks people not to cite from it but check the references. Its entries shouldn’t be use as references for academic purpose but they provide general and background knowledge.

Zimmer (2007) said that the increased flow of information across networks is a fear. People who want to search for information will be overwhelmed by the huge data on the internet (Mann, 2007). However, those huge online resources lead to a new way of learning. They get the newest and then let everyone see it. In reality, people are always thirsty for information; they want to know not just about their own major but also about how to have a better life, how to make their wives happy, how to fix the broken washing machine… If they plan to travel to Australia, they will want to know how that country is like, how the weather is, when the earliest plane will depart and which hotel is the cheapest… With Web 2.0, they can not only get the information they need, but also find other ideas along with it. It’s like learning the same thing but from many teachers with many different views. They can choose the most suitable one or even create their new way and share it with others. Moreover, the information can be updated endlessly by people from the whole world.

Another opposing idea is if everyone can be author, then who will be the audience? Who is going to read and listen and watch? (The Good, the Bad and the Web 2.0) It can be seen that with Web 2.0, people now can be both author and reader. If someone is a real author; it doesn’t mean he or she will never read another author’s books. In addition, Web 2.0 give people space to express themselves, to get along with other people with the same interest, not to become a big star. People do not only want to view art from famous artists, they also want to view common thing like how others live, how the world looks from other views.


III. So?
The importance of Web 2.0 in social networks is clear. It allows people to explore the world from many views just with their computers. It is people, the way people look at it is also the way they look at themselves. Web 2.0 is improving endlessly; it’s always changing to be better but there will never be a perfect Web 2.0. And like a coin, Web 2.0 has 2 faces: a bad one and a good one. It’s not good or bad entirely but it depends which face is being looked at.


References:

• ‘The Good, the Bad and the Web 2.0’, 2007, The Wall Street Journal

• Gorman, Michael, 12 June 2007, ‘Web 2.0: The Sleep of Reason’, viewed 4 July 2008, .

• Mann, Thomas, 27 June 2007, ‘Brave New (Digital) World, Part II: Foolishness 2.0?’, viewed 4 July 2008, .

• O'Reilly, Tim 2005 ‘What Is Web 2.0? Design Patterns and Business Models for the Next Generation of Software’, viewed 1 July 2008,
<>

• Vossen, Gottfried & Hagemann, Stephan 2007, Unleashing Web 2.0 from Concepts to Creativity, Morgan Kaufmann

• Zimmer, Michael 2008, ‘Preface: Critical Perspectives on Web 2.0’, First Monday, vol. 13, no. 3


Wednesday, October 21, 2009

Re: To refactor or not to refactor

From Programmer to Programmer

Re: To refactor or not to refactor by KAMIL MANOJKUMAR DHULESHIA and To refactor or not to refactor by YU HONG TAN

Refactoring is changing an application’s or a bunch of code’s internal implementation while keeping its external functionalities.

Refactoring is to improve code’s quality, readability, understandability etc.

Refactoring is an important part in TDD when all the tests are written first, and then code is altered/refactored to pass all the tests.

So to refactor or not to refactor? My answer is YES

Why programmers refactor their code? Well, I believe no programmers like their code to be smelly.

Kamil said refactoring is not an ideal thing to do 5 minutes before deadline. I agree. Refactoring is time consuming, and it is too risky to alter to code at the last moment. It is better to leave it for the next release.

But Kamil also said when to refactor is when you need to fix a bug. It’s not right my friend, a bug is what causes your code to work incorrectly. Fixing a bug is not refactoring. The only exception is when you are doing TDD, while you write your unit tests first.

Another thing I don't agree with Kamil is when to refactor is when adding function. Kamil himself just said in his blog “Refactoring does not add any functionality to the code but it does make the code more efficient”. Did he confused himself? Modifying the code to add a function is not called refactor. Functionalities are to be kept unchanged while refactoring.

Refactoring is simply a process to eliminate repetitive code in a software system without changing the behavior of the actual system – Yu Hong said. It’s not completely wrong, but refactor is not that simple. How's about making your code more readable and understandale?

I strongly disagree with Yu Hong saying “There are times that the code for that system that is being refactored is too complex; it is not worth the time and money to process any further refactoring the code”. More complex the code is, more likely it needs refactor. After all, a complex code is made up from many simple one. Refactor helps simplifying the code, give it a better shape, which is ready for being reused and maintained.

There’s one important thing that both Kamil and Yu Hong missed, automated tests are essential and perquisites while refactoring. Tests guarantee refactoring won’t break the code, or make sure the code’s functionalities unchanged.

Bibliography

1. What is Refactoring http://c2.com/cgi/wiki?WhatIsRefactoring
2. Software Refactoring http://www.refactoring.be/talks/tom-mens/refactoring.pdf

Thursday, October 1, 2009

TDD When to and When not to

TDD When to and When not to
From Programmer to Programmer

1. What is TDD?
TDD is Test Driven Development, a software development technique that relies on the repetition of a very short development cycle: First the developer writes a failing automated test case that defines a desired improvement or new function, then produces code to pass that test and finally refactors the new code to acceptable standards. (http://en.wikipedia.org/wiki/Test-driven_development)

2. When to use TDD
2.1 Productivity and Quality are must-have
TDD is a way to design software for testability. TDD ensures all code is covered by tests. Moreover, testing and debugging each small part is easier than testing and debugging the whole system.

With TDD, developers spend more time for testing, and less time for coding. As developers write unit tests for their own code, and only the necessary codes are written to pass the test, TDD means quicker, goal-oriented, cleaner and simpler coding. In addition, developers are kept on track.

Well-written unit tests can be used as an important part of documentation ? reduces document.

So, TDD makes software more stable, reliable and testable.

2.2 Goals and Requirements are clear and fixed at the beginning, or rarely and slightly change
In TDD, developers refactor their code to improve it while keeping the functionalities. If there is no clear goal or requirement, it is not only troublesome to decide with test should be used, but refactoring may also be a nightmare when functionalities are totally changed.

With TDD, when there’s a new implementation, the first thing to be considered is how it will be used, not how to build it nor how to implement it ? more user-oriented. However, a clear goal with detailed requirements is preferred. If how user interacts with the new implementation is unknown, we can not use TDD.

2.3 Developers are experienced in testing
One good thing about TDD is that developers must fully understand requirements to write tests.

Another good thing about TDD is that there are many testing tools that help developers save time and effort.

3. When not to use TDD

3.1 Experimentation and thrown-away products, they are for understanding, learning new things or getting feedbacks
Application Development is driven by Test, not by Usability or Scalability… while they may be things that we want to get feedbacks.

TDD slows down the process as many refactoring have to be done during developing. In case of experimental products, time and effort are essential.

3.2 Agile Development, when there are a lot of unknown
Changes of UI and API often cause tests to fail.

TDD requires a clear goal, but in Agile Development, requirements are unclear and often change. Therefore, every time requirements are changed, tests need to be rewritten.

3.3 Developers have no or few experiences in testing
If developers have no skill in testing, it may happen that unnecessary tests are written, or the whole system is not test-covered. And both cases promise no good things.

It is nearly impossible to measure how many tests are enough or how to 100% tests the system. Poor design will lead unnecessary tests. It is a waste of time, money and effort.

Integrated (and complicated) test must be also considered. Other while, all parts may pass the test but the whole system does not.

It is hard to write test for Interface, Database, and Concurrent Programming.

Good unit tests require testing skills and experiences. Testing a whole system need various testing techniques and testing tools.




Bibliography


1. Functional Test Driven Development, http://bizdriven.blogspot.com/2005/11/functional-test-driven-development.html
2. If you do Test Driven Development all the time, you’re doing something wrong, http://www.thekua.com/atwork/2008/02/if-you-do-test-driven-development-all-the-time-youre-doing-something-wrong
3. Introduction to Test Driven Design, http://www.agiledata.org/essays/tdd.html
4. Kiessig, R. (2007). Companywide cumulative Test­Driven Development.
5. Sinaalto, M. (2006). The impact of test-driven development on design quality.
6. Test Driven Development - Is it good or bad?, http://msmvps.com/blogs/paulomorgado/archive/2007/03/29/test-driven-development-is-it-good-or-bad.aspx
7. Test Driven Development, http://pooya.khamooshi.com/Pages/MyArticles/TDD.aspx
8. What’s the best argument to convince developers to learn TDD?, http://stackoverflow.com/questions/913458/whats-the-best-argument-to-convince-developers-to-learn-tdd
9. When TDD Goes Bad #1, http://weblogs.asp.net/jsgreenwood/archive/2004/11/26/270503.aspx
10. When TDD Goes Bad #2, http://weblogs.asp.net/jsgreenwood/archive/2004/12/29/343963.aspx
11. Y. Dubinsky and O. Hazzan. (2007). Measured Test-Driven Development: Using Measures to Monitor and Control the Unit Development. Journal of Computer Science