473,406 Members | 2,439 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

strongly typed

Just wanted to confirm that my understanding of a strongly typed language is
correct:

1. .NET is a strongly typed language because each variable / field must be
declared a specific type (String, Int, Float, etc...)
2. VB 6 and VBScript were not strongly typed because both allowed you to ...

dim blah

.... which creates a variant.

3. Java, C#, etc are also a strongly typed language because each variable
must be declared a specific datatype, again like String, Int32, etc.

Correct? Is there more to it?

Thanks!

Mark
Nov 15 '05 #1
2 2347
Nobody else has chimed in yet, so here are my thoughts...

"Mark" <mf****@idonotlikespam.cce.umn.edu> wrote in message
news:up**************@TK2MSFTNGP12.phx.gbl...
Just wanted to confirm that my understanding of a strongly typed language is correct:

1. .NET is a strongly typed language because each variable / field must be
declared a specific type (String, Int, Float, etc...)
2. VB 6 and VBScript were not strongly typed because both allowed you to .... dim blah

... which creates a variant.
..Net is not a language - it's a set of technologies - including languages
like VB.NET, C#, managed C++, J# and also things like a common language
runtime (CLR) that includes the just-in-time (JIT) compiler, garbage
collector, etc, and also the classes of the base class library (BCL).

I don't know if I would say that the framework itself is strongly typed or
not. I suppose it is since every object will, be definition, have a type
associated with it (even if it is just object). But anything can be cast to
object, and that gets rid of some of the benefit of typing. For example,
you can put any object onto an ArrayList. The object will have a type, but
the ArrayList won't care. Nor will the method that pulls the object off the
arraylist, until it finds out that what it got wasn't necessarily the same
type that it was expecting.

And languages don't have to be strongly typed to use the framework. VB.NET
by default is not strongly typed, unless you use Option Strict. You are
right that VB 6 and VBScript were not strongly typed.
3. Java, C#, etc are also a strongly typed language because each variable
must be declared a specific datatype, again like String, Int32, etc.


I would agree with the following addition. Strongly typed, to me, means
that you can't just change the type of things on the fly, unless very
specific rules are followed or you indicate exactly what you mean (casting).
For example, you can't do this in c#:

Double x = 8;
Single y = x;

You must make it specifically clear that you want to cast from a high
precision number to a lower one:

Single y = (Single) x;

So I think that's the other half of being strongly typed.
--
Mike Mayer
http://www.mag37.com/csharp/
mi**@mag37.com

Nov 15 '05 #2
Perfect. I appreciate the thorough response. Thanks Mike.

"Michael Mayer" <mi**@mag37.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Nobody else has chimed in yet, so here are my thoughts...

"Mark" <mf****@idonotlikespam.cce.umn.edu> wrote in message
news:up**************@TK2MSFTNGP12.phx.gbl...
Just wanted to confirm that my understanding of a strongly typed language
is
correct:

1. .NET is a strongly typed language because each variable / field must
be declared a specific type (String, Int, Float, etc...)
2. VB 6 and VBScript were not strongly typed because both allowed you to

...
dim blah

... which creates a variant.


.Net is not a language - it's a set of technologies - including languages
like VB.NET, C#, managed C++, J# and also things like a common language
runtime (CLR) that includes the just-in-time (JIT) compiler, garbage
collector, etc, and also the classes of the base class library (BCL).

I don't know if I would say that the framework itself is strongly typed or
not. I suppose it is since every object will, be definition, have a type
associated with it (even if it is just object). But anything can be cast

to object, and that gets rid of some of the benefit of typing. For example,
you can put any object onto an ArrayList. The object will have a type, but the ArrayList won't care. Nor will the method that pulls the object off the arraylist, until it finds out that what it got wasn't necessarily the same
type that it was expecting.

And languages don't have to be strongly typed to use the framework. VB.NET by default is not strongly typed, unless you use Option Strict. You are
right that VB 6 and VBScript were not strongly typed.
3. Java, C#, etc are also a strongly typed language because each variable must be declared a specific datatype, again like String, Int32, etc.
I would agree with the following addition. Strongly typed, to me, means
that you can't just change the type of things on the fly, unless very
specific rules are followed or you indicate exactly what you mean

(casting). For example, you can't do this in c#:

Double x = 8;
Single y = x;

You must make it specifically clear that you want to cast from a high
precision number to a lower one:

Single y = (Single) x;

So I think that's the other half of being strongly typed.
--
Mike Mayer
http://www.mag37.com/csharp/
mi**@mag37.com

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Bill Cohagan | last post by:
I'm trying to figure out the "best" way to implement a strongly typed ArrayList. Using inheritance is one approach. It has the advantage that I only have to write overrides for the Add method and...
1
by: Job Lot | last post by:
I am confused how strongly typed dataset is different from un-typed dataset. Is there any good link explaining pros and cons of both? Which one should be used preferably?
2
by: David | last post by:
I have been developing applications with Java for quite a while but I am new to .NET development. I am trying to learn the ".NET way" of creating Strongly Typed Objects from a database. The...
1
by: HardBap | last post by:
I've created a strongly typed DataSet (Customers.xsd) using the xsd.exe tool. I want to be able to access fields using ds.Customer.CompanyName. The problem is when I return this DataSet from a...
2
by: Ian Gore | last post by:
Hi, I'm relatively new to VB.NET so I'd be grateful if someone could point out what I don't understand here... 1) Creating a strongly typed collection by inheriting CollectionBase. This is...
5
by: Dennis | last post by:
NOTE: This is a COMMENT...not a QUESTION: For the newbies, I've been messing around with strongly typed ArrayLists so I don't have to type so many "DirectCast". The following works great where...
20
by: Dennis | last post by:
I use the following code for a strongly typed arraylist and it works great. However, I was wondering if this is the proper way to do it. I realize that if I want to implement sorting of the...
1
by: Code Monkey | last post by:
Silly question maybe, but I've been doing the following for far too long now: public static DataTable myDataTable() { string sql = @"SELECT column1, column2, column3, column4 FROM...
4
by: Rachana | last post by:
Hi, I have understood Data Sets but what is meant by typed/untyped/ strongly typed datasets. Can any one explain me or suggest any site/ article, to get these concepts (and their ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.