• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Static vs. Dynamic typing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Static vs. Dynamic typing


  • Subject: Re: Static vs. Dynamic typing
  • From: Oscar Morales Vivó <email@hidden>
  • Date: Thu, 3 Jul 2003 12:15:05 +0200

For example C is weakly typed since it really is only operating on chunks of bits. Whether that chunk is a integer, pointer, or part of a string is not inherent in the value itself and you can change the typed interpretation of a given set of bits at will.

The problem with C is not its more or less weak typing, but rather its arbitrary rules for implicit type promotion (or, far worse, demotion). If you want to do a static typed language, go all the way. And include a readable typecasting operator (C++ goes halfway to solving that). Unfortunately C++ inherits those too.

My take on this: static typing is ok as long as it doesn't make you jump through too many hoops and can be worked around easily when needed (i.e. not Java's typecasting & introspection hell :P). Obj-C is fine in that aspect, as you'll get fine warnings if you use typed pointers, but you can just use an id (or ignore the warnings) if warranted.

BTW, been fighting with C/C++ function pointers lately. God Bless CodeWarrior's smart syntax highlighting, as otherwise I wouldn't know where the hell is the identifier 5 minutes after writing it. Would rent my soul to whoever could adapt the @selector syntax to C/C++ :P. Maybe it's time to try a little macro magic... (I know, it's evil, but sometimes the end justifies dabbling in the dark arts)

/*
Oscar Morales Vivs

Eternal Computer Science Student. Master of C++ Templates. Cocoa Nut. Computer Graphics Scientiam Lumina. UI Guru in Training. Dabbler in all things CS and most which are not.

Web stuff: http://homepage.mac.com/oscarmv/index.html
*/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Static vs. Dynamic typing (From: Eric Dahlman <email@hidden>)

  • Prev by Date: Re: [OT] Re: EOF undead?
  • Next by Date: Re: Really Big NSOpenGLView
  • Previous by thread: Re: Static vs. Dynamic typing
  • Next by thread: Re: Static vs. Dynamic typing
  • Index(es):
    • Date
    • Thread