Skip to main content

KISS

Keep It Simple Stupid (No Really)

From time to time I find it amusing what kind of code can be written and what code actually gets passed through to a production setting. Most of the time it’s something I’ve written myself. Ever look back to a project you worked on a long time ago? That’s a scary thought now isn’t it? You take a look back and go… how did that ever work? You also might think, what in the world was I thinking when I coded that?

Awful Markup

Back when I first started learning HTML it was the standard to have all of your tags in uppercase. Uppercase! I suppose someone wanted to establish content from presentation or structure. Yeah structure. HTML isn’t a presentation layer, that would be CSS. Looking back at that code I cringe. Why would anyone ever even want to code in all uppercase? It didn’t make any sense. Not only does it hurt the eyes to look at it, but it’s also hard to read.

Method Lengths

How long should a method be exactly? I’ve read that methods should be a few lines long. Don’t write hundreds of lines in a single method. You’d go crazy nuts trying to find a bug in there! No really. Be like searching for a needle in a haystack. Don’t try it. You’ll go blind.

Just keep your methods/functions short and simple. I’d rather look at several methods with a few lines of code than a few methods with lots of lines of code in them. What’s going on where? Make it easy and simple to understand.

Comments

Make your code self documenting. Don’t flood it with unneccessary comments. If you want a method to return a string in HTML format, name it like that. Instead of getContent() call it getContentAsHtml(). Makes sense right? Whoever is looking at the source code later on down the line won’t wonder what format the content will be returned as.

Documentation

Provide adequate documenation. Don’t write novels with your documentation. But write what is needed to get someone started. You know how projects have a two minute get started guide? Yep do that. If it’s a Java project, have Javadocs available for it. You don’t want to have your users in the dark about what your project does.

Write Tutorials Smart

If you’re going to write a website that contains tutorials. Um, keep them simple and easy to follow. Also keep with the actual current standards. I should say that again. Keep with the current standards.

An example of this. Years ago, it was typical to have your HTML markup in uppercase. That isn’t the case anymore (no pun intended… or was there?). No realy though. Do not put your HTML in upper case. Don’t! It’s bad. You will be looked down upon so bad. So very very bad. Keep current with whatever language you’re running with and be good at it. Seriously do it. You can deprecate things, that’s just fine. Most languages have a way to do that. Use it!

Comments

Popular posts from this blog

Didn't Sleep

 What's the point of sleep anymore if I can't sleep? I don't think I slept any good last night. I was awake at 3 am wondering to myself, what on earth am I doing awake? Yeah, that happened. It doesn't make any sense. Fortunately, it's the weekend. So, I can catch up on sleep tonight. I don't have to be anywhere tomorrow, so it's a good opportunity to actually sleep for once. Whatever the case, I hope I'll be able to fall asleep and stay asleep. We will see what happens.

What's The Point?

 So, tell me, what is the point of believing in a spiritual supreme being? I often wonder what that is all about. I know religions say that God, as some call him, is our father. We pray by starting with our father who art in heaven, hallowed be thy name. Yet sometimes it feels like he is absent from our lives. Is it due to how we are living our lives? What exactly is the cause of that feeling? Some people believe that God, Jesus, and the Holy Ghost are one person. Others do not. It is interesting to me to see what all churches believe in. I myself do not go to church. I don't believe in organized religion. I have my bible on my phone, so it's me and my bible. That is my link to God. It makes me wonder if that's enough though. I have faith in Christ, I believe in him. Is my faith sufficient to be forgiven of my sins? I do not know. I do know that wherever I end up in the afterlife, I will have done my best to follow Christ. I believe the scriptures which lay out Christ's...

Temptation Bible vs Book of Mormon

In the Bible in 1 Corinthians 10:13 we find: There hath no temptation taken you but such as is common to man: but God is faithful, who will not suffer you to be tempted above that ye are able ; but will with the temptation also make a way to escape, that ye may be able to bear it. But what might seem as a contradiction is found in Alma 13:28 But that ye would humble yourselves before the Lord, and call on his holy name, and watch and pray continually, that ye may not be tempted above that which ye can bear , and thus be led by the Holy Spirit, becoming humble, meek, submissive, patient, full of love and all long-suffering; So, which is it? Either God tempts you to a point and stops, or you have to actively pray not to be tempted beyond that no return point. Which is it?