[Year 12 SofDev] Data Type Sizes

Robert Timmer-Arends timmer at westnet.com.au
Fri May 31 20:06:13 EST 2013


Hello Damien

First, I'm not sure that how the various data types are physically stored is part of the study design - at least, I can't see it anywhere.

Second, one reason for the different storage sizes is probably historical as much as anything. For example, C was developed on PDP-11 which was a 16-bit minicomputer, so 2 bytes as basic int storage makes sense. C++, coming along later as it did, was probably first developed on a 32-bit machine. I wouldn't be surprised if VB.NETs owes its 2-byte integers to its ancestor quickBASIC, originally written for 8088/86 machines.The other number types would have a similar heritage.

As for char, 1 byte accomodates ASCII, while 2 bytes accomodates Unicode. I don't know why, but MS was one of the early adopters of Unicode, possibly because of its flagship product MS Word, so building chars on 2 bytes would have been a logical step for them.

The boolean data type is the interesting one. In principle it only needs one bit, but fetching a single bit from memory can be very inefficient, depending on how the memory system is designed. That leads to 1 byte storage on older machines since it's more efficient to store a byte than a bit (0000 0000 or 1111 1111), although I'm not sure how that translates to 32-bit machines!

Regards
Robert T-A

----- Original Message ----- 
  From: ATKINSON-BUCK, Damien 
  To: Year 12 Software Development Teachers' Mailing List(sofdev at edulists.com.au) 
  Sent: Friday, May 31, 2013 3:42 PM
  Subject: [Year 12 SofDev] Data Type Sizes


  Hi folks, 

              I've been working through various data dictionaries with my students and the issue of data type sizes, somebody pointed out a difference between the text and what VB.NET state, so I decided to do a bit of research into various languages and see what they store data as. Attached are the results. It's OK for SACs as we can base that on the language we're using, but just wondering what the official VCAA size might be - and if anyone can explain the reasons for the difference (I assume it's due to various compilation methods, but the brain is too fried to go into too much). Also, anyone out there using the languages that I have blank fields on that could fill them in?

  Cheers

  Damien




  Damien Atkinson-Buck
  Head of Learning Area: Technology/Arts 

        p: +61 3 9490 3848
       e: damien.atkinson-buck at ivanhoe.com.au
       
        f: +61 3 9490 3490
       w: www.ivanhoe.com.au
       


  Please consider the environment before printing this e-mail.





  Privacy, Virus and Copyright Warning

  The information contained in this electronic message (e-mail), and any files transmitted with it:

  * is intended for the named recipients only. If you have received this in error, please advise the sender and delete it and any copies immediately;
  * Any personal information in this email must be used in accordance with the Privacy Act 1988 and this always applies even if it has been sent to you in error.
  * represents the views of the sender and does not necessarily represent the views or formal advice of Ivanhoe Grammar School;
  * may be subject to Copyright, so no further use should be made of it without the author's permission.

  The School does not represent or warrant that the email or any files attached do not contain errors or are free from computer viruses or other defects nor does it accept responsibility for any loss or damage resulting directly or indirectly from the use of the email or any attached files. 


------------------------------------------------------------------------------


  _______________________________________________
  http://www.edulists.com.au - FAQ, Subscribe, Unsubscribe
  IT Software Development Mailing List kindly supported by
  http://www.vcaa.vic.edu.au - Victorian Curriculum and Assessment Authority and
  http://www.vcaa.vic.edu.au/vce/studies/infotech/softwaredevel3-4.html 
  http://www.vitta.org.au  - VITTA Victorian Information Technology Teachers Association Inc
  http://www.swinburne.edu.au/ict/schools - Swinburne University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.edulists.com.au/pipermail/sofdev/attachments/20130531/d790e571/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 51301 bytes
Desc: not available
Url : http://www.edulists.com.au/pipermail/sofdev/attachments/20130531/d790e571/attachment-0001.jpe 


More information about the sofdev mailing list