Close
Login to Your Account
Faadooengineers
View RSS Feed

Software Engineers BLOG

Avoid these mistakes while writing code

Rate this Entry
Avoid these mistakes while writing code

  1. Donít write deeply nested code
    It is bad programming style to write deeply nested code Ė the code has a tendency to drift across the page to the right and soon becomes unreadable. Try to limit most of your code to a maximum of two levels of indentation. This can be achieved by dividing the code into shorter functions.
  2. Donít write very large modules
    A module should not contain more than 400 lines of source code. It is better to have several small modules than one large one.
  3. Donít write very long functions
    Donít write functions with more than 15 to 20 lines of code. Split large function into several smaller ones. Donít solve the problem by writing long lines.
  4. Donít write very long lines
    Donít write very long lines. A line should not have more than 80 characters.
    Example:
    if(objHideRevealPalette.tree["paletteButton.textHideIcon"].getSelected() || objHideRevealPalette.tree["paletteButton.textRevealIcon"].getSelected())
    Write above line like this:
    var bHide:Boolean = objHideRevealPalette.tree["paletteButton.textHideIcon"].getSelected();
    var bReveal:Boolean = objHideRevealPalette.tree["paletteButton.textRevealIcon"].getSelected();
    if(bHide || bReveal)
  5. Variable names
    Choose meaningful variable names Ė this is very difficult.
  6. Function names
    The function name must agree exactly with what the function does. It should return the kind of arguments implied by the function name. It should not surprise the reader. Use conventional names for conventional functions
  7. Format programs in a consistent manner
    A consistent programming style will help you, and other people, to understand your code. Different people have different styles concerning indentation, usage of spaces etc.
    For example you might like to write tuples with a single comma between the elements:
    {12,23,45}
    Other people might use a comma followed by a blank:
    {12, 23, 45}
    Once you have adopted style Ė stick to it.
    Within a larger project, the same style should be used in all parts.

:ghz_01::tatice_06:
Categories
Career , Technology

Comments

  1. [FE].Zatak's Avatar
    thnx... useful
  2. shailendra's Avatar
    :tatice_06:nice
  3. raghu's Avatar
    i think i must practice it,,,might b useful
  4. swathi2621's Avatar
    very very nice pls post some more tips
  5. karya's Avatar
    :mr47_01:
  6. rohitjindal_2008's Avatar
    very good
  7. Rahul Dahake's Avatar
    Thanks 4 such a good tip
  8. apurvadhoot's Avatar
    thanx 4 guiding!!!!!!!!! very useful tips........

Trackbacks


Send Birthday Wish
Send Birthday Wish
  • ritu.26
    Branch : Computer Science Engineering

    ritu.26

  • ramesh_ak
    Branch : Instrumentation Engineering

    ramesh_ak

  • garhwal
    Branch : THIS DOES NOT APPLY ON ME!

    garhwal

  • 007ankitsharma007
    Branch : Computer Science Engineering

    007ankitsharma007

  • coder46
    Branch : Information Technology Engineering

    coder46

  • vivekvpvs
    Branch : Civil Engineering

    vivekvpvs

  • asshu
    Branch : Civil Engineering

    asshu

  • 42166
    Branch : Information Technology Engineering

    42166

  • apudxtr

    apudxtr

  • ajendra
    Branch : Instrumentation Engineering

    ajendra

  • yogender1990
    Branch : Information Technology Engineering

    yogender1990

  • maverick.kt

    maverick.kt

  • nagendra maura

    nagendra maura

  • vishal sahaay
    Branch : Mechanical Engineering

    vishal sahaay

  • shweta2420

    shweta2420

  • sohailsohail
    Branch : Information Technology Engineering

    sohailsohail

  • emulation007
    Branch : Electronics Engineering

    emulation007

  • poornagundu

    poornagundu

  • sj kamala
    Branch : Electronics Engineering

    sj kamala

  • 20PIYUSHJAIN
    Branch : Electronics Engineering

    20PIYUSHJAIN

  • gurdeepmaurya
    Branch : Electronics Engineering

    gurdeepmaurya

  • kailas dhatrak

    kailas dhatrak

  • satya146

    satya146

  • sumansaurabh001
    Branch : Civil Engineering

    sumansaurabh001

  • Adarsh Pejawar
    Branch : Civil Engineering

    Adarsh Pejawar

  • sahadabpk
    Branch : Electronics Engineering

    sahadabpk

  • pkpraveen198
    Branch : Computer Science Engineering

    pkpraveen198

  • adityabehera
    Branch : Mechanical Engineering

    adityabehera

  • Anand kr. singh
    Branch : Computer Science Engineering

    Anand kr. singh

  • Sadhana.S
    Branch : Electronics Engineering

    Sadhana.S

  • adnanjawed
    Branch : Mechanical Engineering

    adnanjawed

  • dixonkc91
    Branch : Computer Science Engineering

    dixonkc91

  • rakakundu
    Branch : Computer Science Engineering

    rakakundu

  • lakshaydhawan.2091
    Branch : Computer Science Engineering

    lakshaydhawan.2091

  • rohan2005p

    rohan2005p

  • anurag bhatt12345
    Branch : Computer Science Engineering

    anurag bhatt12345

  • Kundan286
    Branch : Electronics Engineering

    Kundan286

  • daniswa
    Branch : Computer Science Engineering

    daniswa

  • revanth1234
    Branch : Some other branch

    revanth1234

  • sanju828401
    Branch : Electronics Engineering

    sanju828401

  • praveen2010p
    Branch : Mechanical Engineering

    praveen2010p

  • puneetsingh

    puneetsingh

  • shrey

    shrey

  • rohan2005p

    rohan2005p

  • Murugan_Natpu
    Branch : Computer Science Engineering

    Murugan_Natpu

  • zechariah
    Branch : Mechanical Engineering

    zechariah

  • avgsh
    Branch : Aeronautical Engineering

    avgsh

  • jennath
    Branch : Electronics Engineering

    jennath

  • alphadragon
    Branch : Computer Science Engineering

    alphadragon

  • swativ80
    Branch : Computer Science Engineering

    swativ80

  • nehakriti
    Branch : Electronics Engineering

    nehakriti

  • varshini

    varshini

  • irah2008
    Branch : Electrical Engineering

    irah2008

  • rishabhagarwal

    rishabhagarwal

  • harimithuna
    Branch : Civil Engineering

    harimithuna

  • chinmay rajguru
    Branch : Mechanical Engineering

    chinmay rajguru

  • mmehta
    Branch : Mechanical Engineering

    mmehta

  • arif305
    Branch : Electrical Engineering

    arif305

  • premsai.kotha
    Branch : THIS DOES NOT APPLY ON ME!

    premsai.kotha

  • kuks073
    Branch : Electronics Engineering

    kuks073

  • rishwinkumarrk
    Branch : Some other branch

    rishwinkumarrk

  • sachinguptaitmu45

    sachinguptaitmu45

  • kamal61435
    Branch : Mechanical Engineering

    kamal61435

  • bindas
    Branch : Mechanical Engineering

    bindas

  • ammulu.priyanka9

    ammulu.priyanka9

  • champak bhargav
    Branch : Mechanical Engineering

    champak bhargav

  • Prasanna Venkatesh r
    Branch : Mechanical Engineering

    Prasanna Venkatesh r

  • Mahesh Nutalapati
    Branch : Aeronautical Engineering

    Mahesh Nutalapati

  • suhaschavan20
    Branch : Information Technology Engineering

    suhaschavan20

  • karjagikiransuresh
    Branch : Mechanical Engineering

    karjagikiransuresh

  • beingsantosham
    Branch : Instrumentation Engineering

    beingsantosham

  • avinash58
    Branch : Electronics Engineering

    avinash58

  • mfebe
    Branch : Electronics Engineering

    mfebe

  • akshay_wonderful
    Branch : THIS DOES NOT APPLY ON ME!

    akshay_wonderful

  • muralianantajit
    Branch : Electronics Engineering

    muralianantajit

  • suhaschavan20
    Branch : Information Technology Engineering

    suhaschavan20

  • muneshsharma123
    Branch : Petroleum Engineering

    muneshsharma123

  • divya1990
    Branch : Some other branch

    divya1990

  • sumit50
    Branch : Computer Science Engineering

    sumit50

  • shivu038
    Branch : Electronics Engineering

    shivu038

  • bharathharikrishna
    Branch : Mechanical Engineering

    bharathharikrishna

  • sandeepbhore
    Branch : Computer Science Engineering

    sandeepbhore

  • lav202
    Branch : Information Technology Engineering

    lav202

  • shaileshtone
    Branch : Mechanical Engineering

    shaileshtone

  • 04amit
    Branch : Mechanical Engineering

    04amit

  • Priyanka202

    Priyanka202

  • muralianantajit
    Branch : Electronics Engineering

    muralianantajit

  • YveszLebrun

    YveszLebrun

  • jitupatel
    Branch : Aeronautical Engineering

    jitupatel

  • igargibiswas
    Branch : Electrical Engineering

    igargibiswas

  • shavya
    Branch : Information Technology Engineering

    shavya

  • ankit10
    Branch : Information Technology Engineering

    ankit10

  • Shibayan07
    Branch : Mechanical Engineering

    Shibayan07

  • shilpa mishra
    Branch : Electrical Engineering

    shilpa mishra

  • Amback
    Branch : Petroleum Engineering

    Amback

  • searchingsv
    Branch : Electronics Engineering

    searchingsv

  • srvk4u

    srvk4u

  • heer123
    Branch : Information Technology Engineering

    heer123

  • smsmadhan
    Branch : Computer Science Engineering

    smsmadhan

  • ashish020
    Branch : Civil Engineering

    ashish020

×

Send Birthday wish

Send Wish