Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Ada > Re: Are there n...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 29 of 42 Topic 5611 of 5827
Post > Topic >>

Re: Are there noticable differences in Ada acceptance by country?

by gpriv@[EMAIL PROTECTED] Mar 20, 2008 at 03:59 PM

On Mar 20, 6:17 pm, Simon Wright <simon.j.wri...@[EMAIL PROTECTED]
> wrote:
> "Dmitry A. Kazakov" <mail...@[EMAIL PROTECTED]
> writes:
>
>
>
> > On Thu, 20 Mar 2008 20:22:22 +0000, Simon Wright wrote:
>
> >> gp...@[EMAIL PROTECTED]
 writes:
>
> >>> I think strong typing should not be dismissed.  Unfortunately Java-
> >>> based (and C/C++/C#) courses don't explain to students that X and Y
> >>> coordinates being fundamentally integer (or float) types are not the
> >>> same thing.
>
> >> I always disliked an X binding which had (sub)types for X, Y
> >> coordinates. Wrong level of abstraction, I thought: use something
like
>
> >>    type Position is record
> >>       X : Float;
> >>       Y : Float;
> >>    end record;
>
> >> and you get a _lot_ less scope for confusion.
>
> > If no rotations involved I would suggest:
>
> >    type Horizontal_Coordinate is new Float;
> >    type Vertical_Coordinate is new Float;
> >    type Position is record
> >        X : Horizontal_Coordinate;
> >        Y : Vertical_Coordinate;
> >    end record;
>
> > In some cases I would consider making absolute positions and relative
> > offsets different types, similar to Time and Duration.
>
> Well, to be fair, I suppose I would have used Metres (or Pixels)
> rather than plain Float.
>
>   subtype Metres is Float;
>
> But I don't see the real advantage in using different types for H_C
> and V_C. How ofen are users actually going to get this wrong?

From my own C experience: using code from different sources X and Y
coordinates in function calls were in different order: foo(x,y);
boo(height, width), etc. Easy to overlook.

George.

> There is
> some comment-like advantage to subtyping -- rather like AdaCore's
> library packages with eg
>
>   subtype Path_Name is String;
>
> but full typing is only going to clutter the place up with
> conversions. Or perhaps you lie to provide all the operations a person
> could need (acceleration x duration -> speed etc)?
>
> Why would things be different if there were rotations involved?
 




 42 Posts in Topic:
Are there noticable differences in Ada acceptance by country?
Mike Silva <snarflemik  2008-03-18 12:08:30 
Re: Are there noticable differences in Ada acceptance by country
Pascal Obry <pascal@[E  2008-03-18 21:41:49 
Re: Are there noticable differences in Ada acceptance by country
"Phaedrus" <  2008-03-18 14:58:15 
Re: Are there noticable differences in Ada acceptance by country
Mike Silva <snarflemik  2008-03-18 15:25:50 
Re: Are there noticable differences in Ada acceptance by country
Ludovic Brenta <ludovi  2008-03-18 23:50:00 
Re: Are there noticable differences in Ada acceptance by country
Thomas <thomas@[EMAIL   2008-03-19 12:42:13 
Re: Are there noticable differences in Ada acceptance by country
Thomas <thomas@[EMAIL   2008-03-19 08:42:17 
Re: Are there noticable differences in Ada acceptance by country
"Peter C. Chapin&quo  2008-03-19 06:35:16 
Re: Are there noticable differences in Ada acceptance by country
"Phaedrus" <  2008-03-19 13:21:21 
Re: Are there noticable differences in Ada acceptance by country
Dennis Lee Bieber <wlf  2008-03-19 23:08:06 
Re: Are there noticable differences in Ada acceptance by country
David Thompson <dave.t  2008-03-31 04:27:45 
Re: Are there noticable differences in Ada acceptance by country
DScott <Merlin43PhD@[E  2008-03-31 00:40:24 
Re: Are there noticable differences in Ada acceptance by country
Ludovic Brenta <ludovi  2008-03-19 05:09:07 
Re: Are there noticable differences in Ada acceptance by country
Ludovic Brenta <ludovi  2008-03-19 05:16:08 
Re: Are there noticable differences in Ada acceptance by country
"framefritti@[EMAIL   2008-03-19 05:51:51 
Re: Are there noticable differences in Ada acceptance by country
Tero Koskinen <tero.ko  2008-03-19 21:04:58 
Re: Are there noticable differences in Ada acceptance by country
Jean-Pierre Rosen <ros  2008-03-20 09:57:30 
Re: Are there noticable differences in Ada acceptance by country
svaa@[EMAIL PROTECTED]   2008-03-19 12:55:05 
Re: Are there noticable differences in Ada acceptance by country
"Phaedrus" <  2008-03-19 13:14:40 
Re: Are there noticable differences in Ada acceptance by country
Ivan Levashew <octagra  2008-03-20 07:34:56 
Re: Are there noticable differences in Ada acceptance by country
gpriv@[EMAIL PROTECTED]   2008-03-19 21:37:59 
Re: Are there noticable differences in Ada acceptance by country
gpriv@[EMAIL PROTECTED]   2008-03-19 21:52:47 
Re: Are there noticable differences in Ada acceptance by country
Simon Wright <simon.j.  2008-03-20 20:22:22 
Re: Are there noticable differences in Ada acceptance by country
"Dmitry A. Kazakov&q  2008-03-20 21:48:14 
Re: Are there noticable differences in Ada acceptance by country
Simon Wright <simon.j.  2008-03-20 22:17:18 
Re: Are there noticable differences in Ada acceptance by country
"Dmitry A. Kazakov&q  2008-03-21 08:52:38 
Re: Are there noticable differences in Ada acceptance by country
Simon Wright <simon.j.  2008-03-21 16:44:50 
Re: Are there noticable differences in Ada acceptance by country
gpriv@[EMAIL PROTECTED]   2008-03-20 14:17:57 
Re: Are there noticable differences in Ada acceptance by country
gpriv@[EMAIL PROTECTED]   2008-03-20 15:59:25 
Re: Are there noticable differences in Ada acceptance by country
tmoran@[EMAIL PROTECTED]   2008-03-20 20:54:04 
Re: Are there noticable differences in Ada acceptance by country
"Jeffrey R. Carter&q  2008-03-21 04:16:40 
Re: Are there noticable differences in Ada acceptance by country
Simon Wright <simon.j.  2008-03-21 16:41:21 
Re: Are there noticable differences in Ada acceptance by country
Simon Wright <simon.j.  2008-03-21 16:39:31 
Re: Are there noticable differences in Ada acceptance by country
gpriv@[EMAIL PROTECTED]   2008-03-21 12:15:53 
Re: Are there noticable differences in Ada acceptance by country
gpriv@[EMAIL PROTECTED]   2008-03-21 12:21:52 
Re: Are there noticable differences in Ada acceptance by country
Adam Beneschan <adam@[  2008-03-21 14:11:34 
Re: Are there noticable differences in Ada acceptance by country
Simon Wright <simon.j.  2008-03-22 07:02:38 
Re: Are there noticable differences in Ada acceptance by country
Maciej Sobczak <see.my  2008-03-22 07:00:03 
Subtypes to represent coordinate charts
Eric Hughes <eric.eh9@  2008-03-22 10:16:21 
Re: Are there noticable differences in Ada acceptance by country
gpriv@[EMAIL PROTECTED]   2008-03-24 11:01:49 
Re: Are there noticable differences in Ada acceptance by country
Tero Koskinen <tero.ko  2008-03-25 20:02:43 
Re: Are there noticable differences in Ada acceptance by country
Gautier <gautier@[EMAI  2008-03-25 20:57:51 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 0:19:37 CDT 2008.