Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Meaning of 'type-safe'??

Options
  • 19-04-2004 1:49pm
    #1
    Registered Users Posts: 1,253 ✭✭✭


    what does the term 'type-safe' refer to when talking about collections in microsoft visual c++ (6.0)??

    cheers...

    edit: for example, when talking about lists, arrays, or maps.


Comments

  • Closed Accounts Posts: 5,564 ✭✭✭Typedef


    It means you pay me homage, with trinkets, small gifts, shiny metalic objects called tender, sisters &/or small furry animals.


  • Registered Users Posts: 20,939 ✭✭✭✭Stark


    It means you define a variable to explicity hold data of one type and it can't store anything but that type of data (mostly).

    For example in a language like php which isn't type-safe you can have
    $p = "hello"
    $p = 123;

    Whereas say in Java you have

    String s;
    s="Hello";
    s = 123 (can't do this).

    Well technically that's strong-typing but I think type-safe is roughly the same thing.

    If it's type-safe you can also only perform actions on a data type which were meant for that data-type. For example if you're collect has a String in a[1] and an Integer in a[2] then you can do a[1].length() but not a[2].length()

    ⛥ ̸̱̼̞͛̀̓̈́͘#C̶̼̭͕̎̿͝R̶̦̮̜̃̓͌O̶̬͙̓͝W̸̜̥͈̐̾͐Ṋ̵̲͔̫̽̎̚͠ͅT̸͓͒͐H̵͔͠È̶̖̳̘͍͓̂W̴̢̋̈͒͛̋I̶͕͑͠T̵̻͈̜͂̇Č̵̤̟̑̾̂̽H̸̰̺̏̓ ̴̜̗̝̱̹͛́̊̒͝⛥



  • Registered Users Posts: 1,253 ✭✭✭gobby


    that seems to make sense stark, cheers.

    typedef, trinkets are on their way. no sisters im afraid so im sending you a yak.


  • Registered Users Posts: 15,443 ✭✭✭✭bonkey


    Theres a nice, short explanation of type-safe here

    jc


  • Registered Users Posts: 1,253 ✭✭✭gobby


    Originally posted by bonkey
    Theres a nice, short explanation of type-safe here

    jc
    cheers jc... :)


  • Advertisement
Advertisement