Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

Meaning of 'type-safe'??

  • 19-04-2004 01:49PM
    #1
    Registered Users, Registered Users 2 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,563 ✭✭✭Typedef


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


  • Registered Users, Registered Users 2, Paid Member Posts: 21,353 ✭✭✭✭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()


  • Registered Users, Registered Users 2 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, Registered Users 2 Posts: 15,443 ✭✭✭✭bonkey


    Theres a nice, short explanation of type-safe here

    jc


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


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

    jc
    cheers jc... :)


  • Advertisement
Advertisement
Advertisement