The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Value Safety

0 replies.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a flat view of this topic  Flat View
Previous Topic   Next Topic
Threaded View: This topic has 0 replies on 1 page
Jimmy Nilsson

Posts: 694
Nickname: jimmyn
Registered: Aug, 2003

Jimmy Nilsson is a developer, author and trainer for JNSK in Sweden.
Value Safety Posted: Feb 15, 2008 5:35 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by Jimmy Nilsson.
Original Post: Value Safety
Feed Title: Jimmy Nilsson's weblog
Feed URL: http://www.jnsk.se/weblog/rss.xml
Feed Description: Patterns, OO, DB, .NET, ...
Latest Agile Buzz Posts
Latest Agile Buzz Posts by Jimmy Nilsson
Latest Posts From Jimmy Nilsson's weblog

While listening to my colleague Niclas Nilsson's presentation called "Dynamic Languages for Statically Typed Minds" last week at PBT Group in Cape Town it occurred to me that what Dynamic Languages lack in type safety, they gain in *value* safety.
:-)

Niclas showed that in static typed languages such as Java and C#, if you instantiate an int with 100000000 (one hundred millions) it's still an int. If you then multiply that int by itself and store it in the same int, it's still an int, but the value is 1874919424. Doesn't look right, does it?

If you do the same in Ruby, instantiate a member with 100_000_000, it's a FixNum. If you multiply that FixNum by itself, it becomes a BigNum. But the value is 10000000000000000 which seems to be more correct than in the Java/C# case. Type safety? No, but Value safety!

Read: Value Safety


Topic: Presenting on Continuous Integration at The Silicon Valley Chapter of the ACCU Previous Topic   Next Topic Topic: Simple Answers to Simple Questions

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use