Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 228425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:40:52+00:00 2026-05-11T19:40:52+00:00

Do type-safe and strongly typed mean the same thing?

  • 0

Do “type-safe” and “strongly typed” mean the same thing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T19:40:52+00:00Added an answer on May 11, 2026 at 7:40 pm

    No, not necessarily – although it depends on your definition of the terms, and there are no very clear and widely accepted definitions.

    For instance, dynamic programming languages are often type safe, but not strongly typed. In other words, there’s no compile-time type information determining what you can and can’t do with a type, but at execution time the runtime makes sure you don’t use one type as if it were another.

    For example, in C# 4.0, you can do:

    dynamic foo = "hello";
    dynamic length = foo.Length; // Uses String.Length at execution time
    foo = new int[] { 10, 20, 30 };
    length = foo.Length; // Uses Array.Length at execution time
    dynamic bar = (FileStream) foo; // Fails!
    

    The last line is the key to it being type-safe: there’s no safe conversion from an int array to a FileStream, so the operation fails – instead of treating the bytes of the array object as if they were a FileStream.

    EDIT: C# is normally both “strongly typed” (as a language) and type safe: the compiler won’t let you attempt to make arbitrary calls on an object, and the runtime won’t let you perform inappropriate conversions.

    I’m not entirely sure where unsafe code fits in – I don’t know enough about it to comment, I’m afraid.

    Dynamic typing in C# 4 allows weakly typed but still type-safe code, as shown above.

    Note that foreach performs an implicit conversion, making it a sort of hybrid:

    ArrayList list = new ArrayList();
    list.Add("foo");
    
    foreach (FileStream stream in list)
    {
        ...
    }
    

    This will compile (there was another question on this recently) but will fail at execution time. Ironically, that’s because you’re trying to be strongly typed with respect to the stream variable, which means you have to perform a cast on the result of the iterator.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For strongly-typed & type-safe solution, I have to do the following step. Create some
What is type-safe? What does it mean and why is it important?
I want to use type-safe variadic functions introduced in C++11, but not with different
I am looking into creating type-safe generic controls. This is targeting the (reduced) generics
I've been refactoring my horrible mess of C++ type-safe psuedo-enums to the new C++0x
I'm trying to use shapeless to accumulate easily objects in a type safe manner.
To create a delegate from a method you can use the compile type-safe syntax:
Is there any primitive data type that it's safe to not initialize? How about
Is there an equivalent for the C# 4 'dynamic' keyword when using type safe
Is there any type-safe, compile-time checked possibilty of referring to values that implement multiple

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.