Programming Nightmares: Get a laugh outta this!

Leave a comment Standard

I’m not sure why some programmers think it’s appropriate to run all of their code together on one line instead of making it more readable. IfIwrotelikethatinregulartextitwouldmakeyougoalittlebitcrazytryingtofigureoutwhatiwassaying! So please, if you value sanity tell me why?? Why make reading code any harder than it has to be?

Here are some funny things I’ve run into lately… you can put these on your programming “DO NOT” list. And yes, sadly enough, these are real examples of things I’ve run across although I wish I could tell you differently.

<td colspan=1>

Um, um, a column in a table inherently has a colspan of one….

'this is a -1, Y, or N
if request.Form("txtPayment") <> "" AND request.Form("txtPayment") <> "-1"

Talk about a good way to hack a script, let’s just change our variable’s data type from a character to a integer and back again! Hooray!

<script type="text/javascript">alert("<%= strSQL %>")</script>

Let’s alert the SQL to the user right before we execute it. You know…you show me yours and I’ll show you mine. Somehow I have a feeling I’ll get the short end of the stick here.

if not not not blnOk then

Double and triple negatives are pretty pointless when just one (or none) will do the trick.

var test, cur, i, ythingy,xthingy,lzr,q1,q2,q3,meany,yam

Descriptive variable names are not meant to make your fingers sore because they take longer to type out.

</form> <!--form goes to here so it doesn't gets the below button -->
 <tr>
 <td colspan="2" align="left"><a href="chapter.asp?action=file&chapter=<%= strChapterCode %>">Create Reports/Export File</a></td>
 <td colspan="1">&nbsp;</td> <!-- spaceholder -->
 <td colspan="5" align="right"><!--<input type="submit" value="Remove Checked Members" />--><button name="OpenNewWindowButton" id="OpenNewWindowButton" onClick="JavaTransmitData()" style="display:none">Remove Checked Members</button></td>
 </tr>

Let’s have fun commenting out submit buttons with HTML comments yet leave the functionality of that submit button on the page. Oh,oh, but it’ll all be okay if you move the </form> tag up! WRONG! It’s really easy to re-create your own version of the form and submit it to the same URL thus using the functionality you so cleverly commented out with HTML comments. Kiddos to you for taking the initiative to REMOVE the code that would allow someone to REMOVE DATA from your database.

...hundres of lines of code above here %>
 <!-- auto-redirect -->
 <script type="text/javascript">
 location.href="chapter.asp?action=<%= ACTION_MEMBERS %>&CHAPTER=<%= strChapterCode %>&msg=<%= strMessage %>"
 </script>
 <% ..hundreds of lines of code under here

Lets write a whole page of code in a server side programming language and then plop a javascript redirect in the middle  instead of using the language’s built in redirect functionality…

'the TRIM and quote replace is not neccessary on all these really but oh well

This comment was then followed by 38 fields being passed to a stored proceedure with trim() and replace() around them like this: trim(replace(field_name_here)). I think this one get big points for “Let’s write comments which admit we were to lazy to remove unnecessary functionality.” And we wonder why users complain about the software’s slow performance.

"select * from personal_info where id like '" & form.request("memberid") & "'

Talk about a serious security problem. Let’s see… do I want all the information from the member with an ID higher or lower then mine? Oh wait… I’m smart enough not to have an account on this software so sorry, you’re not going to be able to find my address, name or telephone number however you can sure find someone Else’s.

Game Critique: Asteriod Knock Off 2006

Leave a comment Standard

I was talking to my friend about a Flash alternative and mentioned SWiSH to her. If you don’t know about SWiSH it’s like a point and click Flash creator for someone who really doesn’t want to take the time to learn Flash (or can’t afford it).

While clicking around on their site I noticed they have a Games section where people have submitted games they’ve made in SWiSH. So knowing me I started playing a few.

Little surprise I found myself mumbling under my breath, “movement is too hard, there’s no reason to keep playing, graphics suck” as I went from game to game. With all those mental synapses firing my lightbulb became fully charged and I decided, “Why not write a game critique for this undiscovered and under-appreciated indie game?”

Which brings me back to the first game I clicked on:  http://www.swishzone.com/index.php?area=resources&tab=movies&do=page&action=detailed&link_id=3051

First Impression 4/5

For me a first impression means a lot. If a game takes a long time to load I’m not interested. If it has weird flash/jerky/fall down and have a seizure intros, I’m probably drooling on the floor.

I give this a 4 outta 5. It loaded quickly, the screen has some movement but it doesn’t impede with reading the text or interaction with the menu.

Why isn’t this a 5? There are no instructions. Granted most people are familiar with asteriods, not everyone immediately understands what buttons you push to move your spaceship or that pressing the spacebar makes your ship fire.

Graphics 5/5

The graphics are well done. There is even an animation of flames when the ship moves or when an asteroid explodes.

Instructions 0/5

Sadly, there are no instructions.

Mouse &  Keyboard Interaction 4/5

The movement of the ship seems a little sensitive to me but there is some drag and wind resistance factored into the mix so overall I’d give this a fairly high rating.

Re-Playability & Entertainment 1/5

Although this is classic asteroids the playing field is so small and there are so many asteroids that it’s hard to avoid them. On the object of the game is only to shoot the rocks…. totally boring–this isn’t the two button arcade game days people. If I was given the ability to pick up items, go through wormholes, or evade space aliens I might be more interested to keep playing.

Shooting the asteroids is a challenge in itself because your fire power isn’t fast enough to keep up with the rocks hurtling your way, no matter how fast you hit the space bar. That means you have to try evading them with movement controls that are already a bit on the sensitive side. That coupled with an over-abundance of rocks on the screen makes things even harder.

Finally, the BIGGEST no-no in my book, once you get a game over there’s no way to start playing again unless you either refresh the page or right click and reset the flash movie. Your average user would have no clue and would go along on their merry way instead of playing again.

Learning Curve 3/5

Once you get past the missing instructions and how to fire the ship there’s really nothing else involved.

Achievement or Goals 2/5

Although this game keeps a point tally there’s no hall of fame or high score to try and overcome. There’s no incentive to win other than beating your personal score. On top of that there’s no clean cut goal or achievement to set.

Overall Score 2/5

While this game has nice graphics it’s lacking in playability and has a low entertainment factor. The movement is a bit finicky and there’s no instructions or a way to replay the game after you die. I played this game for all of 5 minutes and was done with it.

Sooo… think you can do better? Want me to critique your game? Post a comment or send me a note and see how your game makes the cut!