answersLogoWhite

0


Best Answer

You mean static typing, not strong typing. Strong typing simply means hit the keys harder!

Static typing means that the compiler knows the type at compile time and can therefore check to ensure that all operations upon those types conform to the operations expected of those types. Thus we cannot inadvertently make a silly error such as trying to multiply two strings together. Static typing also means that the compiler can optimise code to suit the specific types being operated upon, rather than generalising the code for a generic type.

User Avatar

Wiki User

8y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

9y ago

It reduces errors by ensuring type conversions are done in an efficient and consistent manner. For instance, converting a floating point value to an integer may result in data loss, as might converting a multi-byte integer to a single-byte integer. Since compilers know the length of every type, they can alert programmer whenever they attempt to perform an implicit conversion that could result in unintended data loss. Programmers can still explicitly convert between types with data loss, but by forcing the programmer to be explicit there is less chance of accidental loss.


This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How does strong typing help in reducing errors in programs?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is strong-typing versus weak-typing?

Strong-typing vs Weak-typingWeak typing is where a language allows you to treat blocks of memory defined as one type as another (casting). Languages like C and C++, although statically typed, are weakly typed.Languages like Perl and PHP are weakly typed because you can do things like adding numbers to strings and the language will do an implicit coercion for you.Languages like Java, C# and Python are strongly typed - there is no way you can add a number to a string without doing an explicit conversion.In addition, there are many large systems that have been created with dynamic type systems. Catching type errors (typos) at compile time only catches a very small proportion of errors and a strong testing strategy produces much more reliable systems irrespective of the type system in use.Strong type is checking the types of variables at compile time. weak typing is checking the types of the system at run-time. For scripts & quick stuff we'll use weak typing, In big programs, strong typing can reduce errors at compile timeThe above answer is not 100% correct. C++ doesn't allow for an integer (int) to be added to a string, unless you mean appending. In which case, C# and Java behave in similar fashion by doing an implicit conversion. For a better answer see the answer to "Strongly typed programming language" in this site.Juan R--------------------------------------------------------------------------------------------------------------Strong typing provides greater type safety. You might have specially heard it about DataSets being strongly typed, where instead of referring columns as datacolumns(index).value, you create an XML schema from which you make a dataset derived class. Strong typing is preferred as there remains no type ambiguity. Another example is, turning on Option strict in VB, where you have to do explicit type casts.Instead of running into situation where you get a type that you did not expect and try performing an operation on it, you go for strong typing so that such errors are caught during compile time itself.--------------------------------------------------------------------------------------------------------------strong typelanguage specication requires its typing rules strongly (i.e. more or less allowing only those automatic type conversions which do not lose information),one can refer to the process as strongly typed, if not, as weakly typed.example in c languageint a;float b, c;b=2.2;c=3.3;a=b+c;// here we are losing data result is 5 instead of 5.5 because a is an integercout


What are the different types of error in C plus plus?

Well its not clear what kind of errors that you are looking at. Is it programming error or error during execution? If its programming error then its basically deviation from the standard formats or definitions as defined in C.


Why do you need data types in c language?

All programming languages require types. Some are dynamically-typed while others are statically-typed. C is a statically-typed language. Static-typing means values are bound to types at compile time, thus optimising storage requirements and rejecting invalid operations at compile time. Dynamic-typing means values are bound to types at runtime. While dynamic-typing is more flexible and generally easier to work with, that flexibility comes at a cost in terms of performance and maintenance. Invalid operations will result in runtime errors but, even if no errors occur, the runtime must still test for them, resulting in decreased performance and increased code size. Since C can eliminate type-based errors at compile time, most runtime-checks become redundant, code is more compact and performance is optimal.


What should I do for my arm throbbing from typing?

The arm throbbing from typing for long is a reaction of the muscles and nerves which might be strained. This will ideally resolve itself in a short while.


Resource typing involves the categorizing of resources based on?

kind

Related questions

What would prevent errors in a database?

It is difficult to completely prevent errors, especially in a complex database. Good design and good validation can reduce the amount of errors. You can give users lists to choose from rather than them typing things in, reducing their chances of typing something wrong for example.


What are some good keyboard typing programs for kids?

There are some excellent resources for kids learning keyboard typing. Some include programs such as: Software 2013, Keyboard Typing for Kids or free programs at Free Typing Games dot net.


How do you write programs in bluej?

by typing it in bluej


What is typing speed?

I believe that's the typing speed, with corrections (deductions) for errors.


Is Rapid typing software a type of typing software?

The Rapid typing software is type of typing software that is to increase the typist speed in a fun way with games. There are a variety of types of typing programs .


What is it called when you are looking for errors while typing?

budda


Does Microsoft Word marks certain typing patterns as errors?

yes it detects errors


How do you practice typing?

Use programs, go to school, or just type!


Would be something to check for when revising locally.?

Typing errors


What would be something to check for when revising locally?

Typing errors


How do you type properly?

In order to type properly, you would have to practice for a while. There are various typing programs which are available on the internet to improve proper typing.


What are some free programs that teach you how to type?

There are many online programs provided by different sites like powertyping, typingweb, learntyping, typingstudy,etc..One can learn typing by playing typing games with fun on freetypinggames site.