Skip to content
  • About Us
  • Contact Us
  • Privacy Policy
  • Disclaimer
  • Corona Virus Stats (Covid-19)
  • Work with us
  • FB
  • LinkedIn
  • Twitter
  • Instagram.com
Tekraze

Tekraze

Dive Into Technology

  • Guides
    • Developer Guide
    • PC Guide
    • Web Guide
    • Android Guide
    • Music
    • Tutorials
  • Feed
    • Tech News
    • Shared Tech
    • Gaming Videos
    • Unboxing videos
  • Forums
    • Android Apps
    • Angular Npm Packages
    • Useful Site Links
    • Tech Queries
    • Windows OS Help
    • Web Guide and Help
    • Android Os And Rooting
    • Jhipster Discussion
    • Git & GitHub forum
    • Open Source Forum
  • Work with us
  • Toggle search form
The right Way to code and syntax tekraze

The right way to Code and Syntax you need to follow

Posted on August 8, 2018 By Balvinder Singh No Comments on The right way to Code and Syntax you need to follow

Hi everyone, coming back to Developer series after long, I will be writing today about, a very basic thing every coder, actually a new coder miss. This is the right way to code that follows some rules and acceptable and understandable to all. So let’s start.

| Also Read | Developer Terminology you need to Know

Table of Contents

  • The Right Way to Code and Syntax
  • Semantics
  • Syntactic
  • Bonus Tip

The Right Way to Code and Syntax

As we all know coding is to provide solutions to problems. But during the development process, there are more problems coming with the development phase, Actually saying, for solving a simple problem, we create more problems and do the fixing and reach to a solution. There can be many issues to the problems coming. So I will be telling these more in details.

You all must be thinking now what could be the right way I am going to write about. So let me break it into two parts. First, we will look over semantics and then Syntax. So let’s do divide the topic into two parts:

1. Semantic

2. Syntactic

Semantics

As we know we write code to do our task and optimize it. So let take the example of students. There are many things related to students like class, subject, teachers, course and much more. We create some application that manages all data similarly like as we may do without application in real life manually. So if we are not clear with what our fields be, we have a problem of understanding, more in team projects.

Let we have two developers who working on modules for the same project but coding separately, without talking to each other and explaining. Let say for roll number field. one set property as roll_no and other st_roll, they both appear different and not understandable. But if we simply write, student_roll_no. It explains itself and needs no explanation. So the meaning of a word, sentence or any letter is the semantics. If semantics are good, no need to explain, no code conflicts and productivity is more.

| Also Read | Text Editors for Code 2018

Similarly like during creating methods,  some may save name as stMarkSave() that creates some confusion of what the function does, but if we have written like saveStudentMarks(), it is self-explanatory and needs no one to explain. So if we use correct semantics, then there will be no confusion.

Some may think, that writing method names or declaring variables with shortened keywords like st in place of the student are good, but it leads to complexity when a project grows up and you need to go through each and every file of the project to check what and why it was for, This increases complexity, debugging becomes difficult and cost grows to maintain and develop. So better to use full words, as we today have no limits on storage or like as issue that was before a decade ago or more.

So some tips for good semantics are:

1. Don’t shorten the words.

2. Use self-explanatory names.

3. Use Cases for names with multiple words,

4. Use declarative names like saveStudent in place of sv_stud or anything short.

5. Use variables with the full name like student_roll_no or studentRollNo, it reduces confusion.

| Also Read | Make music with a Programming Language

Syntactic

Just like semantics, the syntax is also a source of confusion. The syntax is the way we write code and multiple words together like student_class or studentClass.There are different types of case for syntax:

1. CamelCase – In this the initial of the first word starts as small case, and capital for later like studentClass, studentRollNo etc.

2. Snake case – In this all letters are small joined by an underscore (_) like student_name, class_name, marks_of_maths.

3. Kebab case – In this we join letters by (-) sign like class-name, student-name

4. Pascal Case – Subset of camelcase but the initial letter is also capitalized like StudentClass.

| Also Read | Tips for a Pro Web Developer

Bonus Tip

Along semantics and syntax, there are many things that can help in writing good code. The cases like using a single method for multiple logics is bad, but writing method that does a single task is good like a method that calculates simple interest as well compound interest both is bad, but if we have two methods, one for simple interest and one for the compound interest. These are the basic principles for good programming. Below is the link you can visit to read more about this.

Solid Principles of Coding – Link 1 LInk2

 

I hope you like the post, if yes then do share with your friends and comment down what you think of this one, and let us know so we can improve our content. Keep sharing as sharing is caring. Stay connected and keep checking for more updates coming.

 

Content Protection by DMCA.com
Developer Guide Tags:camelcase, code, letter case, semantics, snakecase, syntax

Post navigation

Previous Post: ODOCO Co-working Spaces for your next Startup
Next Post: Learn Git like You are five

Related Posts

  • Create Sticker Application for Whatsapp
    How to Create Stickers Application for Whatsapp Developer Guide
  • javascript tekraze
    JavaScript Web Guide
  • A Guide For Newcomers to Artificial Intelligence 1
    A Guide For Newcomers to Artificial Intelligence Developer Guide
  • Best Back End Web Development Tools For Web Developers Tekraze
    Best Back End Web Development Tools For Web Developers Guest posts
  • Linux Terminology basics you need to know
    Git Terminologies Post 3 Developer Guide
  • Learn Git like You are five 2
    Learn Git like You are five Developer Guide

Leave a Reply Cancel reply

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

Advertisements

Subscribe to updates

Enter your email below to subscribe





Posts by Categories

Advertisements
  • Open Source - All you need to know Right now 3
    Open Source – All you need to know Right now Developer Guide
  • GitHub - A Wizard Hat 4
    GitHub – A Wizard Hat Developer Guide
  • Top Programming Languages That Largest Companies Are Hiring Developers For In 2018 5
    Top Programming Languages That Largest Companies Are Hiring Developers For In 2018 Tech News
  • Workflow of Git 6
    Workflow of Git Uncategorized
  • What does it really owes to be a better Python Developer 7
    What does it really owes to be a better Python Developer Developer Guide
  • Speed up Windows using USB Drive as virtual memory with Readyboost
    Speed up Windows using a USB drive as virtual memory like a magic PC Guide
  • Merging Multiple PDF files online
    7 Online PDF Tools That Help You Merge Files Web Guide
  • Improving Your Small Business Online Visibility Tekraze
    Improving Your Small Business Online Visibility – 5 Time-Saving Tactics Guest posts

Affliate Links

Sell with Payhip

Earn with Magenet

Sell and Buy with Adsy

GainRock affiliate Program

Automatic Backlinks

Advertise with Anonymous Ads

accessily tekraze verificationIndian Blog Directory

Copyright © 2023 Tekraze.

Powered by PressBook News WordPress theme