Jump to content

Hungarian Notation


Value

Recommended Posts

De curand mam imprietenit cu fostul admin al acestui forum "Rock" si mia aratat cateva chestii interesante despre variabile si am zis sa vi le impartasesc si voua.

Este vorba despre Hungarian Notation.

Iam vazut cateva coduri mai noi si a inceput sa foloseasca aceste prefixe desii eu nu prea inteleg ce e cu ele dar totusi mi sa parut folositor.

Cum mia spus si el, poate ati vazut si voi cum arata codul lui Slice, toate variabilele au un prefix si acum miam dat seama ca nu e la intamplare.

Un exemplu

{ // Put all the benchmarking code inside a block so we can use it multiple times without "variable already exist" errors.
    new
             iMeasureTime = %0, // Number of milliseconds to run the code
             iCount = 0, // Number of time the code was executed
             iTick = GetTickCount( ), // Current tick
             iStartTick, // The tick when the benchmarking started
        bool:bWarmup = true // Warmup?
    ;
    
    do { } while ( iTick == GetTickCount( ) ); // Wait and start right after the tick counter goes up (for precision)
    
    iTick = GetTickCount( );
    iStartTick = iTick;
    
    while ( iTick - iStartTick < iMeasureTime || bWarmup ) // While the execution time hasn't exceeded iMeasureTime or warmup
    {
        if ( bWarmup ) // If we're in a warmup..
        {
            if ( iTick - iStartTick >= iMeasureTime ) // ..and the time has passed
            {
                bWarmup = false; // No more warmup
                
                iTick = GetTickCount( );
                
                do { } while ( iTick == GetTickCount( ) ); // Wait for the next tick
                
                iTick = GetTickCount( );
                iStartTick = iTick;
                
                iCount = 0; // Reset the counter since we just did the warmup
            }
        }
        {
Mam uitat pe wikipedia in acel articol si i-ul ala vine de la
iSize : integer (Systems) or index (Apps)

b-ul de la boolean si tot asa.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.