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

  • SEARCH
  • Home
  • 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

Ask A Question

Stats

  • Questions 111k
  • Answers 111k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Yes, but you have to specify the language using the… May 11, 2026 at 9:42 pm
  • Editorial Team
    Editorial Team added an answer It isn't that an address can't be taken (the compiler… May 11, 2026 at 9:42 pm
  • Editorial Team
    Editorial Team added an answer You can use #undef TRANSPARENT but that may cause errors… May 11, 2026 at 9:42 pm

Related Questions

Say I have a very simple java object that only has some getXXX and
How could i implement Type-Safe Enumerations in Delphi in a COM scenario ? Basically,
Moved from preview 2 to preview 5 and now my Html.ActionLink calls are all
The C preprocessor is justifiably feared and shunned by the C++ community. In-lined functions,
Have I missed something with WPF (and Windows Forms before it) in regards to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.