• Home
  • Apps
  • Gadgets
    • Gadgets for Kids
    • Store gadgets
    • Tablet Computers
    • Cheaper Gadgets
    • Apple
      • iPhone
      • iPhone 5
      • iPad2
  • Games
    • Game Consoles
    • Online Games
    • Angry Birds
    • Instagram
    • Pinterest
    • Twitter

Techie Kids

(and a not so techie mom)

  • About
  • Disclosure
  • Privacy Policy

Programming Best Practices

December 21, 2011 by Marie Gizelle 5 Comments

Programming Best Practices

“In programming, the only standard is its syntax.”

 

There’s no standard on how a programmer write his program. It’s always a matter of how a programmer should know how he will solve the problem in his own style. The only thing that matters is that the program should behave the way it must be. Eventhough, there are things that a good programmer should practice. Let me show you this list.

Best Practices in Programming

1. Naming Conventions
This practice was always taught in College. If you are going a variable, name it in a way that it could be recognized easily.

Example:
intAge >> an integer that returns age
douSalary >> a double that returns salary
strAddress >> a string that returns an address

In this way, a programmer can easily recognize the use of variables and the data type they should return. Another thing is naming a method/ functions/ subroutines.

Most of the times, we used comments to define what our method/ function/ subroutine will do. Instead of doing this, why not give it a name where it’s purpose could be easily recognize?

Example:

addTwoIntegers()
convertDecimalToHex()
deleteAnyFile()
connectToDatabase()
startExe()

I believe that you already understood what these functions will do even I do not put a definition as comment beside them.

Honestly, I am often guilty for not using it. But, I am only guilty on short programs. But for working on a large project, I use that style. On my previous post How Important Is A Program’s Documentation, I explained how important the program’s documentation is. And by following this practice, the code will serve as the documentation itself.

2. Case Sensitivity
This practice is applicable if you plan to run your program on different platforms. By the way, some programming languages are case sensitive itself. I think, the best example I could give here is the Java language which has the capability of being executed on different platform as long as there is JVM.

When working with Java in Windows OS, intAge is the same as IntAge and intAGE. But your program will encounter errors if you run it on Linux.

So, the best practice is, always think it’s case sensitive.

3. Symbols
I mean, the brackets, curly braces, semicolons, etc. Though there are good IDE which already gave solutions with this problem, it’s better to practice it.

I will just use an example for languages that use semicolons because using brackets, curly braces, and parentheses are common sense.

printf (“Hello World!”);

How do you used to write that code? Of course, you will type printf first. Isn’t it? Most of the times, semicolon in the end was forgotten. So, my tip is, put the semicolon first everytime.

4. That’s all!

Again, those are not standard. They are the best practices. You may use them or not for your own purpose. Again, the important thing is that your program should run the way it must be.

I hope you’ve learned something.

Class Dismiss.

Tweet
Share
Share
Pin
0 Shares

You might also enjoy...

The Pessimist Inside Every Good ProgrammerThe Pessimist Inside Every Good Programmer
How Important Is Program DocumentationHow Important Is A Program's Documentation
Kinds Of ProgrammersKinds Of Programmer

Filed Under: Programming

Previous Post 4 Geeky Wedding Gadgets
Next Post PayPal: Get Verified With Cashsense VISA Card

Comments

  1. Nonoy Avellanosa says

    December 28, 2011 at 2:31 pm

    This reminds me of Turbo Pascal and C Lang. The variables and integers. Medyo iba lang talaga sa Web Programming at Web development.

    Reply
  2. Karl Paragua says

    January 2, 2012 at 11:19 pm

    Good post bro.

    In my opinion “Naming Convention” is one of the most underrated practices for new programmers. They simply don’t care about naming conventions, that’s why when they land a job, they have a hard time collaborating with fellow programmers.

    I remember one moment in my college days. When I saw my classmate’s code, I was like “What the hell is this?!”. He uses around 10 or more variables, and he uses only single letter variable names. So I was like, “What is letter S suppose to hold? How about letter E and letter R?!” and so on. I can’t imagine someone coding like that on a REAL project. So there, I hope new programmers will give more importance to naming convention. Just my 2 cents.

    Anyway, Good Post! 🙂

    Reply
    • Kris Edison says

      January 3, 2012 at 8:25 am

      Thanks for good input Karl. Students can never realize the use of good naming convention until the code messed up in their mind.

      Reply
  3. Patricia Tan says

    March 25, 2012 at 11:30 pm

    Cool Post! Thanks for sharing! 🙂

    Reply
    • Kris Edison says

      March 26, 2012 at 8:39 am

      Thanks for dropping by and reading Pat. 🙂

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

WELCOME

WELCOME

We are techie kids.

FOLLOW ME

  • Instagram
  • Pinterest
  • Twitter

CATEGORIES

  • Activities
  • Angry Birds
  • Apple
  • Apps
  • Art
  • Bicycles
  • Blog
  • Blogging
  • Boating
  • Branding
  • Business Ventures
  • Camera accesories
  • Cameras
  • Canon
  • Careers
  • Cars
  • Certifications
  • Cheaper Gadgets
  • ChildCare
  • Computers
  • Crafting
  • DIYs
  • Domain Names
  • F1
  • Facebook
  • Family Fun
  • Family Time
  • Featured
  • Final Fantasy
  • Fishing
  • Football
  • Gadgets
  • Gadgets for Kids
  • Game Consoles
  • Game Rooms
  • Games
  • Geeky Weddings
  • Gift List
  • Giveaways
  • Gizmo
  • Google
  • Google Doodle
  • Green Conscious
  • Indoor Playground
  • Innovations
  • Innovators
  • Internet Giants
  • Introduction
  • iPad2
  • iPhone
  • iPhone
  • iPhone 5
  • Kids and Video Games
  • Kids in Doodles
  • Little Big Planet 2
  • Macbook
  • Macbook accessories
  • Mind games
  • Movie Trinkets
  • Movies
  • Museum Visits
  • Online Games
  • Online Presence
  • Online Shopping
  • Outdoor
  • Park Play
  • Phones
  • Photoshoots
  • Pixar
  • Playmobil
  • Playstation Games
  • Programming
  • RC Helicopters
  • Role playing games
  • Science
  • SEO Related
  • Silicon Valley
  • Slider Puzzles
  • Smartphones
  • Software
  • Sports
  • Steve Jobs
  • Stickers
  • Stock Photography
  • Store gadgets
  • Tablet Computers
  • Tennis
  • The Web
  • Toy shops
  • Toy Stories
  • Toy story
  • Tuesday Couch Potato
  • Uncategorized
  • Video Games
  • Virtual pets
  • Weddings
  • Wii
  • Winter Fun

GET UPDATES

Leave me your email to receive new entries, tips, and specially offers only for you! . Don´t miss any update!

LATEST POSTS

Raising Business-Minded Kids, 4 Best Points

Raising Business-Minded Kids, 4 Best Tips

7 Best Remote Control Toys For Techie Kids

Fun Park Visits With The Kids All 4 Seasons

Fun Park Visits With The Kids All 4 Seasons

Top 5 Techie Gifts for your Loved Ones

Top 5 Awesome Techie Gifts for your Loved Ones and More

techiekidsinfo

Summer may be over, but Saturdays and Sundays and Summer may be over, but Saturdays and Sundays and free times on weekdays are not. Are you running out of ideas of things to do with the kids? 

Head over to https://techiekids.info/diy-projects-to-do-with-the-kids for some tips on things kids might enjoy doing with you. 💕

#TechieKids #Thingstodo #KidsProjects #Activitiesforkids #FunStuff #Kidstuff
Ice cream break. #NotSoSummer #TechieKids #IceCre Ice cream break. #NotSoSummer

#TechieKids #IceCream #Kids
Vienna is our playground. #Playground #Play #Tech Vienna is our playground.

#Playground #Play #Techiekids
Taking a break from so much walking. #TechieKids Taking a break from so much walking. 

#TechieKids #GadgetKids #ExploringVienna #ViennaNationalLibrary
Hi 👋🏻 #TechieKids #Kids Hi 👋🏻

#TechieKids #Kids
Walking on ropes is fairly easy! 😉 #RopeWalk#T Walking on ropes is fairly easy! 😉

#RopeWalk#TechieKids #summer #WalkingOnRope #Adventure #Kids
Umbrella mine!!! #Ellaellaella #TechieKids #Umbre Umbrella mine!!! #Ellaellaella

#TechieKids #Umbrella #Sundays #SemiFormal
Swing away! #TechieKids #Swing #Balance #Playgrou Swing away!

#TechieKids #Swing #Balance #Playground
Follow on Instagram
This error message is only visible to WordPress admins
There has been a problem with your Instagram Feed.

GET UPDATES

Leave me your email to receive new entries, tips, and specially offers only for you! . Don´t miss any update!

  • Instagram
  • Pinterest
  • Twitter

COPYRIGHT © 2019. Emma Theme by Lovely Confetti · DMCA.com Protection Status