Where do you stand on variable naming in your application code?

Just out of curisoity really, I've worked in a number of places over the years and encountered multiple coding styles.
Just thought I'd throw it out there and see what your personal preferences are for variable naming??
I've seen a lot just use v_ for any variable..
v_name
v_dateofbirth
v_ageSome prefix with the scope instead of just v..
l_localname
g_globaldateThen some add the datatype..
lv_localvarchar
ln_localnumber
gb_globalbooelanAnd some even use c/java stylee..
vMyName
dDateOfBirthp for parameters..
p_param1or i/o
i_in_param
o_out_paramAnd so on...
Me, I generally just fit in with the 'house style', unless I think it's that bad that it's unusable, but that's been pretty rare.
You?
Edited by: smon on Mar 17, 2011 2:21 AM

smon wrote:
Just out of curisoity really, I've worked in a number of places over the years and encountered multiple coding styles.
Just thought I'd throw it out there and see what your personal preferences are for variable naming??
I've seen a lot just use v_ for any variable..
v_name
v_dateofbirth
v_ageSome prefix with the scope instead of just v..
l_localname
g_globaldateThen some add the datatype..
lv_localvarchar
ln_localnumber
gb_globalbooelan
Yes, I just tend to use "v_" for variables, "p_" for parameters, "c_" for constants, "cur_" for cursors, "pkg_" for packages etc.
The problem with using e.g. "lv_" for varchars and "ln_" for numbers etc. is that at some point you'll get a requirement change such that something that was stored as a number now needs to be a varchar because the business has changed the "codes" being used and you would end up having to change the variable name throughout the code, or worse still leave the variable name but just change it's datatype and have something that looks inconsistent.
And some even use c/java stylee..
vMyName
dDateOfBirth
Yuk!
p for parameters..
p_param1or i/o
i_in_param
o_out_param
just "p_". Keep it simple.

Similar Messages

  • Where do you find the ringtone tab on your personal itunes so that you can sync new ringtones to your iphone?

    Where do you find the ringtone tab on your personal itunes so that you can sync new ringtones to your iphone? I am trying to get ringtones from my ringtone app onto my phone and the directions said to click Ringtones on the top of iTunes. I am having trouble finding the Ringtones on the top of iTunes.

    Go to edit then preferences in itunes on your computer and then check the box TONES and then click OK.  with your phone attached to your computer with USB cable select the name of your phone on the left and then in window on right select TONES from the menu items across the top of the window

  • Where do you discuss just being happy with your Mac?

    Where do you go in the community for some positive thoughts and when you are just plain happy with your Mac?
    Let me paraphrase a song from South Pacific,
    "There is nothing like a Mac,
    Nothing in the world.
    You can take your PC back.
    There ain't anything like my Mac!!”
    I am converted and I love it. First my iPad, then my iPhone and now a proud owner of a Mac. "Who could ask for anything more..."

    Ulsterboy wrote:
    Where do you go in the community for some positive thoughts and when you are just plain happy with your Mac?
    MacRumors
    http://www.macrumors.com/
    AppleInsider
    http://appleinsider.com/
    Are two of the more popular "open discussion" forums for Mac users.
    ASC is a dedicated support forum, so posts here have to stick to being a technical support issue, are often filled with grief stricken users and sometimes volunteers.

  • How the heck and where do you log in to get to your itunes library?

    Updated, reset password, created username, downloads, more downloads, more verification, bvrowsers - you name it. I know it's been a while, but I simply want to get to my library and add some songs? Keeps taking me to the store and new products and more downlaods and faqs. I used to just go right to my library - what has changed? Thank you

    I did get to the library by connecting my ipod to desktop. I want to buy a song, it asks me to log in (I know I'm already logged in) I log in again and an error 'no connection' comes up? I have updated my browser (Chrome) and the latest itunes version? This is crazy to me that I can't buy tunes after over an hour of doing everything asked? The help topics don't help. Thanks

  • Where do you find the phone number for your iphone 4

    i am trying to register my phone on itunes, it asks for the phones number, what is it and where do i find it

    Settings > Phone

  • Can you use Easynews to download movies etc to IMac and how and where do you save the files?

    Can you useEasynews to download movies etc to IMac and how and where do you save the files?

    From your Apple menu at the left end of the menubar, select "About this Mac." You get a window similar to this:
    1) The Mac OS version is just under the big "MAC OS X" line. Post what that says.
    2) We can start to figure out what iMac you have if you post what that the "Processor" line says.
    We need to find out because Apple's poor labling choices for this forum, intended for iMacs made before 2006, causes people with newer and much more capable Macs to post here by mistake.
    Without some info from you, it's much like your calling an auto mechanic and asking if you can use a certain part without telling him the make, model, or year of your car. Quess what his first question will be? Works the same here.

  • Clean Install...where do you start?

    I need to erase the drive and perform a clean install due to the disk utility not being able to repair a volume on the hard drive. I am using OS X.3.9 now but have purchased OS X 10.5 and want to install it. After erasing the disk, do I need to begin with the original software that came with the computer, moving through all upgrades since purchase....or will I only need to use the new OS X 10.5 install disk?

    Hi-
    First, backup your data, please!
    Unless you have software that won't run on Leopard, there is no reason that you must install Panther. Leopard will install without a previous OS. Simply erase the drive, format in Mac OS Extended (Journaled), and install Leopard.
    However, if you have software that you must use, and you aren't sure of, or, there isn't compatibility with Leopard, you would do better to install Panther. You can have both OS's on a single drive, and this would be the safest way (with regard to older software).
    To install both OS's, it would be best to partition the drive into two partitions, using the Disk Utility. You can then install Panther, and your applications on one partition, and Leopard, and any applications, on the other partition. Installing this way, will also avoid any conflict that Leopard may have with older Panther components (as opposed to installing over Panther).
    Let me know if you have further questions.

  • Javax.naming.OperationNotSupportedException:[LDAP: error code 12-00000057

    Hi All,
    I getting the below OperationNotSupportedException while searching the LDAP container
    "'ou=Subscriptions,ou=BMCMarimba,DC=marimba,DC=bmc-dns,DC=com'".
    In our application during the initial search i'm able to search the above container and get the results.But during subsequent search getting the below mentioned error.
    javax.naming.OperationNotSupportedException: [LDAP: error code 12 - 00000057: LdapErr: DSID-0C09068F, comment: Error processing control, data 0, vece]; remaining name 'ou=Subscriptions,ou=BMCMarimba,DC=marimba,DC=bmc-dns,DC=com'
         at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3048)\
         at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2934)\
         at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2740)\
         at com.sun.jndi.ldap.LdapCtx.searchAux(LdapCtx.java:1811)\
         at com.sun.jndi.ldap.LdapCtx.c_search(LdapCtx.java:1734)\
         at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_search(ComponentDirContext.java:368)\
         at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCompositeDirContext.java:328)\
         at javax.naming.directory.InitialDirContext.search(InitialDirContext.java:245)\
         at com.marimba.tools.ldap.physical.LDAPConnectionImpl.getResult(LDAPConnectionImpl.java:901)\
         at com.marimba.tools.ldap.physical.LDAPConnectionPoolImpl.searchWithConnection(LDAPConnectionPoolImpl.java:1369)\
         at com.marimba.tools.ldap.physical.LDAPPagedSearchPR.getPage(LDAPPagedSearchPR.java:402)\
         at com.marimba.tools.ldap.physical.LDAPPagedSearchPR.getPage(LDAPPagedSearchPR.java:238)\
         at com.marimba.tools.ldapsync.util.PageResultEnumeration.getNextPage(PageResultEnumeration.java:159)\
         at com.marimba.tools.ldapsync.policy.core.PolicySync.processNewPolicies(PolicySync.java:351)\
         at com.marimba.tools.ldapsync.policy.core.PolicySync.syncPolicies(PolicySync.java:164)\
         at com.marimba.tools.ldapsync.core.TargetSync.syncTargets(TargetSync.java:163)\
         at com.marimba.tools.ldapsync.core.LDAPDBSync.run(LDAPDBSync.java:617)\
         at java.lang.Thread.run(Thread.java:534)
    Any idea why this exception is coming only in the subsequent search.
    Any help would be greatly appriciated.
    Thanks
    Vallinayagam

    Hope this question raised long back and no suitable answers provided. I want to share my solution which worked for this problem to all the developers hitting their heads to thier PC :-)
    You must use single LDAP connection to retrive all the results.
    For example:
    If your query returns around 10000 results, best way to get the results is using paging. Let us assume you set the page size to 500. Once you retrieve the first 500 results LDAP Connection will give you cookie which stores the information on last page. We need to set the cookie to future use i.e., for retrieving next page (next 500 results). If the connection to get next page is new/different (can be new instance or retrieved from pool) you will get "javax.naming.OperationNotSupportedException:[LDAP: error code 12-00000057".
    So, to avoid this you need to use the same LDAP connection (conext) till you retieve all the results.
    Regards,
    Nageswara Rao.V                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How do you guys upgrade the DDL of your apps?

    This is to start a brainstorming discussion, just like the one you would have between DBAs and developers around the watercooler...
    I am considering revamping the way DDL upgrades are done in-house.  I was wondering how you guys go about doing that, whether you are an Independent Software Vendor or the developer for an in-house application.
    if you're an ISV, how do you supply and implement new versions of your DDL to your customers?
    if you are responsible for the development/maintenance of an in-house application, how do you carry out your DDL upgrades?
    I would like your responses to be around the methods and the tools you use to upgrade the SQL code (mainly the DDL) of your applications.
    Looking forward to everyone's input.

    In a modern application, a developer should seriously consider Edition Based Redefinition (EBR) - a feature (comes with the database)  every customer has since 11g R2.  With EBR, have the ability to install new versions of your code (plsql, triggers, views, synonyms -etc) in the database without impacting (blocking, locking, overwriting) the existing version.  So you can install version 2 of your application while version 1 is still running.
    Additionally - taking it a step further - if you put editioning views in place (a special kind of view that allows you to only select from a single table, no where clause, just a select list - sort of like a synonym with a select list), you can achieve many online DDL upgrades as well.
    for example, let's say you wanted to add a new index to a table, change the format of an existing column from number to varchar2 (to allow for alpha-numeric values in the future) and drop an existing column that is no longer needed - you could (assuming the editioning views are in place):
    a) create a new edition as a child of an existing edition.  It'll be as if you copied all of your code/synonyms/etc - you haven't, but it will feel like it
    b) add a new column of type varchar2. (this column will NOT be visible to version 1 at all in any way)
    c) put in place a forward edition trigger that will take any modification of the existing number column and reflect it in the new varchar2 column
    d) use dbms_parallel_execute to update the existing number column to itself ,this update can commit every 100 rows or so (no locking issues really) and will cause the new varchar2 column to be populated for all existing rows.  any new rows added by version 1 of the application will automagically be reflected
    e) in version 2, create a new editioning view that selects out the right columns from the table (don't select the number, select the varchar2 and alias it as the old column name if you want)
    f) put your new plsql/synonyms/grants whatever in place in version2
    g) create an invisible index on the table you wanted to index - you can do this online.  the index will be invisible so it won't affect ANY existing query plans (you haven't tested the old sql with it - you just know that version 2 likes having it)
    Now version 1 is running and version 2 is ready to go.  Easiest way to roll out would be to schedule a tiny maintenance window - alter the databases default edition to version 2, make the index visible and restart your app servers.  the are now running version 2
    a) drop/set unused the old number column
    b) get rid of the forward edition trigger
    if you'd like to read more about this:
    A Closer Look at the New Edition
    Ask Tom: Edition-Based Redefinition, Part 2
    Ask Tom: Looking at Edition-Based Redefinition, Part 3
    and of course
    http://docs.oracle.com/database/121/ADFNS/adfns_editions.htm#ADFNS020
    tom kyte

  • Forms 6i- Good variable naming convensions

    Could you suggest any good naming conventions on Forms 6i

    Thanks for your time Brian,
    This morning I solved,
    If I tell you what it was you won't believe it.
    To Oracle Forms 10g don't like that global variables comes in this way:
    PACKAGE TGLOBAL IS
    SEDE_AZIENDA VARCHAR2(1):= '1';
    other variables
    END;
    but they have to be set before you call library Package, that is, set it, call library's function where you modify it !!!
    TGLOBAL.SEDE_AZIENDA := '1';
    CALL_FORM (......... SHARE_LIBRARY_DATA .....
    Hope this helps other with same problem!!!!
    Thanks again for your time, Brian and Have a good and Merry Christmas

  • Where would you check performance of webi? query is taking long time to run

    Hello All,
    In the bex query world running on portal you were able to go to sm50 and check what the query is doing and where it is taking a long time or atleast you were able to see the processes runing.
    Where would you check the running processes when you are running a webi query, we are trying to write a webi report which is on universe which is created on bex query. The report is very simple just two fields and an mandatory variable which is coming from bex query (have defined the variable in bex query). When we exeute the query it is taking a long time just spinning and I am not getting any data back, on the same query before even hitting the run query button, I am trying to put a object in query filters and set the filter as In list from Value(s) from list and it is taking forever to set that filter.
    Can we go to CMC or BW backend and check anywhere we are using sap authentication, I see the number of sessions in CMC but that is it.
    Thanks for help in advance.

    Thank you both for the replies.
    How would I get the MDX that is generated by the query, I remember there is a note for starting the MDX logging. Can you please let em know how would I get the MDX statement. Thanks.
    Gowtham - What is the optimal array fetch size that needs to set for the universes, can you explain bit more about array fetch size?
    All our universes are on BEx queries designed in SAP BW in that case does the array fetch size matter and array bind size matter? I had read this in oneof the universe designer manuals for OLAP universes The Array fetch size, Array bind size, and Login timeout parameters are not used for OLAP connections
    Thanks again for replies.

  • Variable naming method

    What is the good way to name the variable name? my method is first 3characters is datatype :
    int intNumber;
    String strName;
    JButton btnGo;Any comment for my naming conversion? I think all expert java programmers not like this right? why?

    This looks very MS standard.
    If you use an IDE, the type is displayed as you type the variable, so finding the type is much simpler than it used to be.
    If you change the type of a variable you would have to rename it as well.
    I would suggest just naming the variable based on what it does and why it is there.

  • Very odd behavior regarding variable naming with DataService.fill()

    I'm experiencing this odd behavior in LCDS 2.5, wich pertains
    to variable naming for the objects returned by a DataService.fill()
    call. I ceated a simple destination with a Java adapter. the Server
    side Java data object is defined as follows)
    package test;
    public class RepositoryObject
    private String m_strObjectId;
    private boolean m_bIsValid;
    private long m_lSize;
    [public setters and getters here]
    On Flex side, the ActionScript value object is defined as
    follows:
    package test
    [Bindable]
    [RemoteClass(alias="test.RepositoryObject")]
    public class RepositoryObject
    public var m_strObjectId:String;
    public var m_bIsValid:Boolean;
    public var m_lSize:Number;
    public function RepositoryObject()
    The FDS destination definition (in
    data-management-config.xml):
    <destination id="testDs">
    <adapter ref="java-dao" />
    <properties>
    <source>test.TestDS</source>
    <scope>application</scope>
    <metadata>
    <identity property="m_strObjectId"/>
    </metadata>
    <network>
    <session-timeout>20</session-timeout>
    <paging enabled="false" pageSize="10" />
    <throttle-inbound policy="ERROR" max-frequency="500"/>
    <throttle-outbound policy="REPLACE"
    max-frequency="500"/>
    </network>
    <server>
    <fill-method>
    <name>getObjects</name>
    </fill-method>
    </server>
    </properties>
    </destination>
    What I figured while debugging into the client was is the
    data returned by the service (I'm using the mx:DataService call)
    returns objects whose variable names
    do not match my definition:
    m_strObjectId becomes objectId
    m_lSize becomes size
    m_bIsValid becomes isValid
    I wonder why that renaming??? Basically "m_str" prefix was
    stripped and capital "O" became lower case "o" for my first
    variable etc.
    For instance, in a datagrid cell renderer I could not
    reference the returned value as {data.m_strObjectId}, but if I use
    {data.objectId}, it works.
    Any ideas why this behavior (which I found confusing and odd)
    would be greately appreciated.
    Robert

    The latter, as "getM_strObjectId " is an ugly name... don't
    tell me that causes issue...ok kidding, I got you. The
    setter/getter names are important in this context.
    Thanks a lot.
    Robert

  • What is a PUK code and where do you find yours for your phone

    What is a PUK code and where do you find yours

    Log on to Verizon wireless and under your account after logging in, look at the device in question and it shows there. It stands for Phone Unlock Code
    Good Luck
    Message was edited by: Elector

  • Request for "WHERE  -   IN" Combination with Bind Variables.

    Hi,
    In ADF BC
    Im Creating the Bind Variables Searching methodolgy in ViewObject.
    SQL Editor:
    Query Like
    SELECT * FROM SEASON season WHERE season.MMYEAR IN (102007,112007) Here Done this query.
    In ViewObject Bind Variable Like B_MMYear .
    SQL Statement : SELECT season.Code,season.Location,season.MMYEAR FROM SEASON season already is there in SQL Statement in ViewObject
    Just im adding this conditon "WHERE season.MMYEAR IN (:B_MMYear)"
    after
    Drag&drop the ExecutewithParams form
    and im giving the MMYear like *102007,112008* then push ExecutewithParams....no Rows to Display...
    when im giving the only one vlaue like 102007 (Or ) 112007 then displays the suitable Row.
    how i can give the query Like "WHERE - IN" Combination in Bind Variables.
    Thanks,
    Rama.
    Edited by: user634195 on Oct 17, 2008 6:37 AM

    Thanks for rply Mr Timo.
    my BindVariable is not Numeric Type...it as a String. ok
    i already checks the debugging
    but i didn't get Exact Query
    query seems without Values same As SQL Statement in ViewOBject.
    like this
    SELECT season.Code,season.Location,season.MMYEAR FROM SEASON season WHERE season.MMYEAR IN (:B_MMYear)
    you Know...India Season of the Culture....
    see.
    In India Colture have Two Seasions
    1.Rabi.
    2.Kharif.
    example:
    Present Year : 2008 ok
    Rabi Season Strats from Oct2008 to March2009.
    Kharif Season Starts from Apr2008 to Sep2008.
    ok
    In my JSP Page one DropDown is there that is Season ok.
    when i select the Rabi....Then Rabi Months comes to page in CoreTable.
    i already done in DB:
    For Rabi:
    SELECT season.Code,season.Location,season.MMYEAR FROM SEASON season WHERE season.MMYEAR IN (10,11,12,01,02,03) done.
    For Kharif:
    SELECT season.Code,season.Location,season.MMYEAR FROM SEASON season WHERE season.MMYEAR IN (04,05,06,07,08,09) also done.
    the realtion b/w Bind Variable and Value....i think is somethink diff.
    Edited by: user634195 on Oct 17, 2008 7:50 AM

Maybe you are looking for

  • Installing bootcamp, pauses and reads "Back up the disk and format it to a single Mac OS extended journaled"

    I just ran disk utility as promted and checked, the main disk is already formatted to a single Mac OS extended (journaled). It previously had parallels partitioning, it is still installed and I can't uninstall it, could this be the problem?

  • Satellite A200 - Need driver for CD/DVD drive

    Hey folks. Recently installed WXP Pro on my A200 PSAEC laptop, so I'm now dual booting XP and Vista on my laptop. Problem is, I've got all the drivers working on XP and everything's running perfect, but when I tried to burn a DVD, Nero says the recor

  • My iPhone Experience :)

    The Purchase Tonight, i walked into the Glendale Galleria (in CA) and purchased an 8gig iPhone. I would have bet my first born that they would have been sold out by 8pm or 10pm. So i gave them a call and the very nice gentlemen who answered told me t

  • Sapscript modification not displaying in invoice print preview

    Hi everyone, I have created a new sapscript and assigned it as a routine  to an output type in IMG. The testing part went fine and print preview was OK both through  SE71 form preview tool and VF03 (billing document). However I noticed I had to make

  • Increase row height of a configurable table

    Dear SCN members, This is related to a configurable table realized using <chtmlb:configTable>. Please let me know about the following possibilities with this: 1. Is it possible to increase the row height of this table? 2. The content of a given cell