1997Q3/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: [MUD&#45;Dev] Languages: "strong" vs "weak" -->
<!--X-From-R13: ptNnzv&#45;pt.UenlEntr.Sqzbagba.OP.QO (Quevf Uenl) -->
<!--X-Date: Sun, 10 Aug 1997 22:19:29 +0000 -->
<!--X-Message-Id: 9708102311.8b3i@ami&#45;cg.GraySage.Edmonton.AB.CA -->
<!--X-Content-Type: text/plain -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, [MUD-Dev] Languages: "strong" vs "weak"</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00457.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00459.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00459.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00455.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00458">Author</A>
&nbsp;|&nbsp;<A HREF="#00458">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00458">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>[MUD-Dev] Languages: "strong" vs "weak"</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:mud-dev#null,net">mud-dev#null,net</A></LI>
<LI><em>Subject</em>: [MUD-Dev] Languages: "strong" vs "weak"</LI>
<LI><em>From</em>: <A HREF="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</A> (Chris Gray)</LI>
<LI><em>Date</em>: Sun, 10 Aug 97 16:11:45 MST</LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
I'm just converting my header files from Draco (a "strongly" typed
language) to C (a less-"strongly" typed language), and some more of
the subtler differences have been brought to my attention.

- C treats character constants to be of type 'int'. Other languages
    typically treat them as type 'char'. I *think* C++ changed this.

- C treats members of an enumeration as of type 'int'. Other languages
    treat them as of the new type of the enumeration. This can prevent
    a lot of errors when dealing with enumerations.

- C has no 'bool' type. Instead, it uses int's, sortof. This leads to
    C having the &amp;&amp;, || and ! operators work on ints, which often
    prevents compilers from pointing out logic, precedence or bracketing
    errors.

- C has no separate "pointer-to-no-object" value. It uses the token 0
    as that value. This can lead to confusion as to whether an expression
    is yielding an int or not. (In my C code, I always use "NULL" as
    a pointer, reserving 0 only for true integer uses. This appears to
    be in direct conflict with what C++ folks want you do do.)

- C's 'if' and 'while' constructs compare their test expressions
    against some "special" value for whatever type the expression yields.
    For ints, that is 0. For pointers, it is also 0, but differently.
    Other languages typically define the conditions as requiring a value
    of type 'bool'. This requires a bit of extra typing:

    C: if (count)
    other: if (count != 0)

    C: if (ptr)
    other: if (pointer != nil)

    C: if (bits &amp; (BIT1 | BIT2))
    other: if (bits &amp; (BIT1 | BIT2) != 0)	/* precedences changed! */

    C: if (flag1 &amp;&amp; bits1)
    other: if (flag1 and bits1 != 0)

    etc.

So, in the sense that C is "sloppier" or "more forgiving" about this
stuff, it is less strongly typed than other languages. However, what it
may gain in perceived convenience, it definitely loses in the ability
of the compiler to tell you about errors of several kinds. And yes, you
can use the "other" forms in C, (I do) but you still won't get the
checking.


As has come out in this list, different people have different preferences
about this stuff. For example, LPC, being based on C, pretty much has the
same rules on this as C does. My AmigaMUD language, being based on Draco,
pretty much has the same rules as Draco does. So, as has been said several
times, the choices here come down to who will be using the language, and
what they are comfortable with. I will claim, however, that if you want
to entice non-programmers to become programmers in your MUD, the simpler
your language is, and the more well-defined it is, the more likely they
are to not get too frustrated. IMHO, a "strongly-typed" language has a
bit more of an initial learning hump than a "weakly-typed" language has,
but once over that hump, the ongoing frustration is less. At least for
a newcomer to programming. For someone who has used a "weakly-typed"
language for 10 years, the initial hump may well never go away.


As for static typing versus dynamic typing, its probably strongly
governed by experience. Someone with a lot of experience with dynamically
typed languages will have developed automatic type-checking skills that
make type errors less frequent. However, that skill depends on uptodate
knowledge of the program in question, and the variables, structures, etc.
that it contains, and what types they are supposed to be. Errors are much
more likely in maintainence work, where the programmer does not have the
uptodate knowledge. It is in that kind of work that I believe the strength
of statically typed languages lies. Unfortunately, very few programmers
are paid to always write new code - they spend much more time maintaining
(adding to, changing, updating, fixing) code, both their own and others.

--
Chris Gray   cg#ami-cg,GraySage.Edmonton.AB.CA

</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00457.html">Re: [MUD-Dev] Mud Languages</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00459.html">[MUD-Dev] porting question</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00459.html">[MUD-Dev] porting question</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00455.html">Re: [MUD-Dev]	Dots in a name?</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00458"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00458"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><STRONG>Re: [MUD-Dev]  New to this mailing list</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<LI><strong><A NAME="01103" HREF="msg01103.html">Re: [MUD-Dev]  New to this mailing list</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Fri 05 Sep 1997, 04:00 GMT
<UL>
<LI><strong><A NAME="01109" HREF="msg01109.html">Re: [MUD-Dev]  New to this mailing list</A></strong>, 
Jeff Kesselman <a href="mailto:jeffk#tenetwork,com">jeffk#tenetwork,com</a>, Fri 05 Sep 1997, 17:51 GMT
<UL>
<LI><strong><A NAME="01133" HREF="msg01133.html">Re: [MUD-Dev]  New to this mailing list</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Sat 06 Sep 1997, 18:37 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
</ul>
</ul>
</ul>
</ul>
</ul>
</LI>
<LI><strong><A NAME="00459" HREF="msg00459.html">[MUD-Dev] porting question</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Sun 10 Aug 1997, 23:38 GMT
<LI><strong><A NAME="00458" HREF="msg00458.html">[MUD-Dev] Languages: "strong" vs "weak"</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Sun 10 Aug 1997, 22:19 GMT
<LI><strong><A NAME="00455" HREF="msg00455.html">Re: [MUD-Dev]	Dots in a name?</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Sun 10 Aug 1997, 18:12 GMT
<UL>
<LI><strong><A NAME="00456" HREF="msg00456.html">Re: [MUD-Dev] Dots in a name?</A></strong>, 
Matt Chatterley <a href="mailto:root#mpc,dyn.ml.org">root#mpc,dyn.ml.org</a>, Sun 10 Aug 1997, 18:51 GMT
<UL>
<LI><strong><A NAME="00460" HREF="msg00460.html">Re: [MUD-Dev] Dots in a name?</A></strong>, 
Martin Keegan <a href="mailto:martin#cam,sri.com">martin#cam,sri.com</a>, Sun 10 Aug 1997, 23:43 GMT
<UL>
<LI><strong><A NAME="00461" HREF="msg00461.html">Re: [MUD-Dev] Dots in a name?</A></strong>, 
Matt Chatterley <a href="mailto:root#mpc,dyn.ml.org">root#mpc,dyn.ml.org</a>, Mon 11 Aug 1997, 06:28 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>