* How difficult is ada to learn? @ 2005-06-30 0:44 Sm704 2005-06-30 5:11 ` Ludovic Brenta ` (4 more replies) 0 siblings, 5 replies; 20+ messages in thread From: Sm704 @ 2005-06-30 0:44 UTC (permalink / raw) How difficult is the Ada programming language to learn? I have Pascal/Object pascal experience, and want to move to a new language soon. C/C++ is too scary for my tastes. I was considering either Ada or modula2 as my next language. How does Ada compare in power to modula2 and the Borland's dialect of Pascal? Thanks ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: How difficult is ada to learn? 2005-06-30 0:44 How difficult is ada to learn? Sm704 @ 2005-06-30 5:11 ` Ludovic Brenta 2005-06-30 6:15 ` Preben Randhol 2005-06-30 14:19 ` Gene ` (3 subsequent siblings) 4 siblings, 1 reply; 20+ messages in thread From: Ludovic Brenta @ 2005-06-30 5:11 UTC (permalink / raw) "Sm704" writes: > How difficult is the Ada programming language to learn? I have > Pascal/Object pascal experience, and want to move to a new language > soon. C/C++ is too scary for my tastes. I was considering either Ada > or modula2 as my next language. How does Ada compare in power to > modula2 and the Borland's dialect of Pascal? > > Thanks I would say: Pascal < Modula-2 < Object-Pascal < Ada But, if you know Object-Pascal, learning Ada won't be too difficult for you. The main areas where you'll learn new things are tasking and the Ada way of doing OOP. I suggest you read the following article, which will help you: http://homepage.sunrise.ch/mysunrise/gdm/pascada.htm HTH -- Ludovic Brenta. ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: How difficult is ada to learn? 2005-06-30 5:11 ` Ludovic Brenta @ 2005-06-30 6:15 ` Preben Randhol 0 siblings, 0 replies; 20+ messages in thread From: Preben Randhol @ 2005-06-30 6:15 UTC (permalink / raw) To: comp.lang.ada On Thu, Jun 30, 2005 at 07:11:17AM +0200, Ludovic Brenta wrote: > I suggest you read the following article, which will help you: > > http://homepage.sunrise.ch/mysunrise/gdm/pascada.htm and http://www.adapower.com/ where you will find on-line books on Ada. -- Preben Randhol -------------- http://www.pvv.org/~randhol/Ada95 -- �For me, Ada95 puts back the joy in programming.� ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: How difficult is ada to learn? 2005-06-30 0:44 How difficult is ada to learn? Sm704 2005-06-30 5:11 ` Ludovic Brenta @ 2005-06-30 14:19 ` Gene 2005-06-30 14:34 ` Matthew Heaney 2005-06-30 15:01 ` Matthew Heaney 2005-06-30 16:43 ` Martin Krischik ` (2 subsequent siblings) 4 siblings, 2 replies; 20+ messages in thread From: Gene @ 2005-06-30 14:19 UTC (permalink / raw) There are really two answers. If you intend to structure programs as in the other languages, then it's quite easy to shift sideways into Ada syntax. If you want to exploit Ada's full power, then you'll have to figure out the Ada way to do things and learn the parts of the langauge that are not found elsewhere---task types for example. In that regard, one of the best things about Ada is that the language designers put their thinking in the rationale documents and then Cohen took the whole art of explaining how to use a langauge to a new level. There is so much glop out there on the language-of-the-week that these two books really stand out. Most people who start with Borland Pascal miss the built-in set and string data types. Ada gets the same effects with packages, but the syntax is far less elegant and readable. (disclaimer: I have no real Modula2 experience) GR ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: How difficult is ada to learn? 2005-06-30 14:19 ` Gene @ 2005-06-30 14:34 ` Matthew Heaney 2005-06-30 15:00 ` Duncan Sands ` (2 more replies) 2005-06-30 15:01 ` Matthew Heaney 1 sibling, 3 replies; 20+ messages in thread From: Matthew Heaney @ 2005-06-30 14:34 UTC (permalink / raw) Gene wrote: > > Most people who start with Borland Pascal miss the built-in set and > string data types. Ada gets the same effects with packages, but the > syntax is far less elegant and readable. I haven't done any Pascal in a while, so I don't remember the syntax for set manipulation, but Ada 2005 will have a set container type. It's an abstract data type, declared in a package in the normal way. It supports union, intersection, etc. If not having "built-in" syntax is a hardship, then you can always define array-based set operations yourself. For example, suppose we have a set whose element type is Integer, then we can do this: type Integer_Array is array (Positive range <>) of Integer; function "+" (IA : Integer) return Integer_Sets.Set is S : Set; begin for Indx in IA'Range loop S.Include (IA (Indx)); end loop; return S; end; Now you can say: declare S1 : Set := +(1, 2, 3); S2 : Set := +(2, 3, 4); S3 : Set := S1 or S2; S4 : Set := S3 and +(1, 3); S5 : Set := +(42, 43) or +(44, 45); begin ...; That's not that inelegant. Not much different from Pascal, as I recall... ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: How difficult is ada to learn? 2005-06-30 14:34 ` Matthew Heaney @ 2005-06-30 15:00 ` Duncan Sands 2005-06-30 18:38 ` Gene 2005-06-30 18:59 ` Randy Brukardt 2 siblings, 0 replies; 20+ messages in thread From: Duncan Sands @ 2005-06-30 15:00 UTC (permalink / raw) To: comp.lang.ada; +Cc: Matthew Heaney > > Most people who start with Borland Pascal miss the built-in set and > > string data types. Ada gets the same effects with packages, but the > > syntax is far less elegant and readable. > > I haven't done any Pascal in a while, so I don't remember the syntax for > set manipulation, but Ada 2005 will have a set container type. It's an > abstract data type, declared in a package in the normal way. It > supports union, intersection, etc. Don't forget that arrays of booleans automatically have "and", "xor" and "or" defined (i.e. intersection, symmetric difference and union), so can be used for sets. All the best, Duncan. ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: How difficult is ada to learn? 2005-06-30 14:34 ` Matthew Heaney 2005-06-30 15:00 ` Duncan Sands @ 2005-06-30 18:38 ` Gene 2005-06-30 19:32 ` Matthew Heaney 2005-06-30 18:59 ` Randy Brukardt 2 siblings, 1 reply; 20+ messages in thread From: Gene @ 2005-06-30 18:38 UTC (permalink / raw) Thanks! You're absolutely right that sets are less of an issue than strings. I overstated by saying "most people." My reference point is undergrads in CS1, where small things can make a difference. You perfectly illustrated what I meant. The overloaded plus constructor is quite idiomatic. In Pascal, set construction just happens. So students who know sets as an early exercise in Pascal do a doubletake when they try the same in Ada. This mysterious-looking plus pops up, and they must dig in to figure out operator overloading and parameterized types in order to do what used to be self-evident. This isn't a bad thing, but it does cause them to "miss" Pascal sets. Best regards, Gene ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: How difficult is ada to learn? 2005-06-30 18:38 ` Gene @ 2005-06-30 19:32 ` Matthew Heaney 0 siblings, 0 replies; 20+ messages in thread From: Matthew Heaney @ 2005-06-30 19:32 UTC (permalink / raw) Gene wrote: > > You perfectly illustrated what I meant. The overloaded plus > constructor is quite idiomatic. And the syntax for Pascal sets isn't idiomatic??? Anyway, we're comparing apples and oranges; see my post about Ada's built-in sets. But even the new set container looks an awful lot like Pascal. For example, the tutorial here: http://www.geocities.com/SiliconValley/Park/3230/pas/pasl1010.html gives these examples: exclude(myday,Friday); include(myday,Friday); That's no different from: declare myday : Day_Sets.Set; begin ... Exclude (myday, Friday); Include (myday, Friday); end; Again, Ada's choice of names here is quite deliberate. If you're a teacher, it wouldn't take any effort to provide a helper package for your students, something like: with Ada.Containers.Ordered_Sets; generic with package Sets is new Ada.Containers.Ordered_Sets (<>); use Sets; package Generic_Set_Arrays is type Element_Array is array (Positive range <>) of Sets.Element_Type; function To_Set (Element : Sets.Element_Type) return Set; function To_Set (Elements : Element_Array) return Set; function "+" (E : EA) return Set renames To_Set; function "and" (L : Set; R : EA) return Set; function "or" (L : Set; R : EA) return Set; ... function "and" (L, R : EA) return Set; function "or" (L, R : ET) return Set; ... end Generic_Set_Arrays; Given overloadings like these, it's not even necessary to use the "+" conversion operator: declare S1 : Set := To_Set (1); S2 : Set := S1 and (2, 3, 4); S3 : Set := S2 or (4, 5); S4 : Set := (6, 7) and (7, 8); begin ... I can't imagine students who are struggling with the syntax for Ada sets to have an easier go of it in similar languages as C++, Java, etc, which are also taught in contemporary CS curricula. Yes, Pascal has slightly more built-in support for sets than Ada does (i.e. syntax for a set literal), but sooner or later students will have a need for a more sophisticated set, that can store more than elements of a discrete type with small range of values. And eventually they'll need a map or a list, and then what will they do? ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: How difficult is ada to learn? 2005-06-30 14:34 ` Matthew Heaney 2005-06-30 15:00 ` Duncan Sands 2005-06-30 18:38 ` Gene @ 2005-06-30 18:59 ` Randy Brukardt 2005-06-30 19:36 ` Matthew Heaney 2 siblings, 1 reply; 20+ messages in thread From: Randy Brukardt @ 2005-06-30 18:59 UTC (permalink / raw) "Matthew Heaney" <mheaney@on2.com> wrote in message news:42c40313$0$32193$39cecf19@news.twtelecom.net... Matt Heaney wrote: > If not having "built-in" syntax is a hardship, then you can always > define array-based set operations yourself. For example, suppose we > have a set whose element type is Integer, then we can do this: The following example seems pretty confused. > type Integer_Array is array (Positive range <>) of Integer; > > function "+" (IA : Integer) return Integer_Sets.Set is What's the definition of "Integer_Sets.Set"? Shouldn't IA have type Integer_Array, rather than Integer? > S : Set; > begin > for Indx in IA'Range loop > S.Include (IA (Indx)); > end loop; > > return S; > end; > > Now you can say: > > declare > S1 : Set := +(1, 2, 3); > S2 : Set := +(2, 3, 4); > S3 : Set := S1 or S2; > S4 : Set := S3 and +(1, 3); > S5 : Set := +(42, 43) or +(44, 45); Presuming that Integer_Sets.Set has "or" and "and" operations. Randy. ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: How difficult is ada to learn? 2005-06-30 18:59 ` Randy Brukardt @ 2005-06-30 19:36 ` Matthew Heaney 0 siblings, 0 replies; 20+ messages in thread From: Matthew Heaney @ 2005-06-30 19:36 UTC (permalink / raw) Randy Brukardt wrote: > >>type Integer_Array is array (Positive range <>) of Integer; >> >>function "+" (IA : Integer) return Integer_Sets.Set is > > > What's the definition of "Integer_Sets.Set"? Shouldn't IA have type > Integer_Array, rather than Integer? Yes. A slipe of the ... fingers. > Presuming that Integer_Sets.Set has "or" and "and" operations. Yes. Integer_Sets is an instantiation of Ada.Containers.Ordered_Sets. ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: How difficult is ada to learn? 2005-06-30 14:19 ` Gene 2005-06-30 14:34 ` Matthew Heaney @ 2005-06-30 15:01 ` Matthew Heaney 2005-06-30 22:35 ` Robert A Duff 2005-07-01 5:37 ` Jeffrey Carter 1 sibling, 2 replies; 20+ messages in thread From: Matthew Heaney @ 2005-06-30 15:01 UTC (permalink / raw) Gene wrote: > > Most people who start with Borland Pascal miss the built-in set and > string data types. Ada gets the same effects with packages, but the > syntax is far less elegant and readable. Thinking about it some more, I forgot that Ada does built-in support for sets a la Pascal, in the form of arrays whose component subtype is Boolean. There are predefined operations for and'ing, or'ing, etc. Of course, sets of this type have the same constraints as Pascal, meaning that the element type must be discrete and constrained, e.g. subtypes of Character or Integer, etc. The languages aren't much different here (as you might expect, given Ada's pedigree). ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: How difficult is ada to learn? 2005-06-30 15:01 ` Matthew Heaney @ 2005-06-30 22:35 ` Robert A Duff 2005-07-15 2:27 ` Waldek Hebisch 2005-07-01 5:37 ` Jeffrey Carter 1 sibling, 1 reply; 20+ messages in thread From: Robert A Duff @ 2005-06-30 22:35 UTC (permalink / raw) Matthew Heaney <mheaney@on2.com> writes: > Gene wrote: > > Most people who start with Borland Pascal miss the built-in set and > > string data types. Ada gets the same effects with packages, but the > > syntax is far less elegant and readable. > > Thinking about it some more, I forgot that Ada does built-in support for > sets a la Pascal, in the form of arrays whose component subtype is > Boolean. There are predefined operations for and'ing, or'ing, etc. Right. And you normally want to use pragma Pack on that array. Ada's array-of-boolean doesn't have the annoying restriction of Pascal sets to a small range. If you want 10_000 bits, that's fine in Ada, but Pascal compilers typically won't allow it. The Pascal syntax for sets is nicer than Ada's, though. - Bob ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: How difficult is ada to learn? 2005-06-30 22:35 ` Robert A Duff @ 2005-07-15 2:27 ` Waldek Hebisch 2005-07-15 5:14 ` Ludovic Brenta 0 siblings, 1 reply; 20+ messages in thread From: Waldek Hebisch @ 2005-07-15 2:27 UTC (permalink / raw) Robert A Duff <bobduff@shell01.theworld.com> wrote: > Ada's array-of-boolean doesn't have the annoying restriction of Pascal > sets to a small range. If you want 10_000 bits, that's fine in Ada, > but Pascal compilers typically won't allow it. > Use good Pascal compiler. GNU Pascal sets are limited by integer size. On 32-bit machines you are still limited to 256 MB (while packed bit array is able to use 64-bit indices and fill whole 4GB), but on 64-bit machines the other limits strike first. Even on 32-bit machines I would not call it "small range". -- Waldek Hebisch hebisch@math.uni.wroc.pl ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: How difficult is ada to learn? 2005-07-15 2:27 ` Waldek Hebisch @ 2005-07-15 5:14 ` Ludovic Brenta 0 siblings, 0 replies; 20+ messages in thread From: Ludovic Brenta @ 2005-07-15 5:14 UTC (permalink / raw) Waldek Hebisch <hebisch@math.uni.wroc.pl> writes: > Robert A Duff <bobduff@shell01.theworld.com> wrote: >> Ada's array-of-boolean doesn't have the annoying restriction of >> Pascal sets to a small range. If you want 10_000 bits, that's fine >> in Ada, but Pascal compilers typically won't allow it. >> > > Use good Pascal compiler. GNU Pascal sets are limited by integer > size. On 32-bit machines you are still limited to 256 MB (while > packed bit array is able to use 64-bit indices and fill whole 4GB), > but on 64-bit machines the other limits strike first. Even on 32-bit > machines I would not call it "small range". Why would I use a good Pascal compiler if I already use an Ada compiler? -- Ludovic Brenta. ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: How difficult is ada to learn? 2005-06-30 15:01 ` Matthew Heaney 2005-06-30 22:35 ` Robert A Duff @ 2005-07-01 5:37 ` Jeffrey Carter 1 sibling, 0 replies; 20+ messages in thread From: Jeffrey Carter @ 2005-07-01 5:37 UTC (permalink / raw) Matthew Heaney wrote: > > Of course, sets of this type have the same constraints as Pascal, > meaning that the element type must be discrete and constrained, e.g. > subtypes of Character or Integer, etc. They don't have to be subtypes. In Pascal, there were often limits on the range of the universe, and the compiler would reject sets over too large a universe, but there's nothing in Ada to stop you from writing: type Character_Set is array (Character) of Boolean; pragma Pack (Character_Set); type Integer_Set is array (Integer) of Boolean; pragma Pack (Integer_Set); C : Character_Set; I : Integer_Set; and the worst the compiler can do is issue a warning that the declaration will raise Storage_Error. Actually, with a 32-bit Integer, Integer_Set will occupy 512 MB. That's less than the physical memory on many modern PCs, so you might not even get a warning. -- Jeff Carter "We call your door-opening request a silly thing." Monty Python & the Holy Grail 17 ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: How difficult is ada to learn? 2005-06-30 0:44 How difficult is ada to learn? Sm704 2005-06-30 5:11 ` Ludovic Brenta 2005-06-30 14:19 ` Gene @ 2005-06-30 16:43 ` Martin Krischik 2005-06-30 19:36 ` svaa 2005-06-30 22:53 ` chris 4 siblings, 0 replies; 20+ messages in thread From: Martin Krischik @ 2005-06-30 16:43 UTC (permalink / raw) Sm704 wrote: > How difficult is the Ada programming language to learn? I have > Pascal/Object pascal experience, and want to move to a new language > soon. C/C++ is too scary for my tastes. I was considering either Ada or > modula2 as my next language. How does Ada compare in power to modula2 > and the Borland's dialect of Pascal? Well I have Pascal/Modula 2 experience and found Ada a perfect replacement for the two. Ada really is the Pascal for grown ups having all the features which where missing in Pascal. Even Turbo-Pascal comes close to Ada's Power. As for Modula-2: Apart from the nice support for modules the feature set was in fact reduced when compared to Pascal. If you want to learn more about Ada look at: http://en.wikibooks.org/wiki/Programming:Ada The are 192 Web Pages of tutorial material out there. Martin -- mailto://krischik@users.sourceforge.net Ada programming at: http://ada.krischik.com ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: How difficult is ada to learn? 2005-06-30 0:44 How difficult is ada to learn? Sm704 ` (2 preceding siblings ...) 2005-06-30 16:43 ` Martin Krischik @ 2005-06-30 19:36 ` svaa 2005-06-30 22:53 ` chris 4 siblings, 0 replies; 20+ messages in thread From: svaa @ 2005-06-30 19:36 UTC (permalink / raw) If you have experience with Pascal, I don't think that will be very difficult to learn. There are some new concepts like generics, discriminants and tasks. You will find things different like objects and pointers, and you'll miss some things like an easy strings management, sets, and little more. In the other hand, I like Ada sintax for blocks, that is, you don't see a cascade of wild "end", you see "end nameprocedure" or "end if" etc. I like the restrictions of types, harder that pascal (and much harder than C). I like that the standard has a lot, a big lot of functions that are standard in any Ada compiler. There is also a new way of doing things in Ada. You will need some experience to get the touch. If you use borland's products, you will miss a good IDE. Nowadays languages have libraries (packages in Ada) some standard, some added by vendor, and some added by yourself. There are thousands of functions, procedures and data structures, all that information is difficult to handle without good tools. Borland is a master in this matter, good integrated help, fast access to record fields and to methods of an object, etc. There is nothing like that in Ada, and that's a big problem, specially for a beginner. ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: How difficult is ada to learn? 2005-06-30 0:44 How difficult is ada to learn? Sm704 ` (3 preceding siblings ...) 2005-06-30 19:36 ` svaa @ 2005-06-30 22:53 ` chris 2005-06-30 22:54 ` chris 2005-07-01 5:39 ` Jeffrey Carter 4 siblings, 2 replies; 20+ messages in thread From: chris @ 2005-06-30 22:53 UTC (permalink / raw) Sm704 wrote: > How difficult is the Ada programming language to learn? Not very. I found it easy to learn from a pascal background, so you should have no problem. The Ada Lovelace tutorial is a quick intro, but for a more in depth you might want to look at Cohens "Ada as a second language" and Englishs' "Ada 95: The Craft of Object-Oriented Programming" are good. Cohens goes over everything, but is a rather large book and that might be offputting. Englishs' book isn't in print anymore, and is orientated towards beginners but it does cover Adas OO and generics well. ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: How difficult is ada to learn? 2005-06-30 22:53 ` chris @ 2005-06-30 22:54 ` chris 2005-07-01 5:39 ` Jeffrey Carter 1 sibling, 0 replies; 20+ messages in thread From: chris @ 2005-06-30 22:54 UTC (permalink / raw) chris wrote: > Sm704 wrote: > The Ada Lovelace tutorial is a quick intro, but for a more in depth you > might want to look at Cohens "Ada as a second language" and Englishs' > "Ada 95: The Craft of Object-Oriented Programming" are good. Cohens > goes over everything, but is a rather large book and that might be > offputting. Englishs' book isn't in print anymore, and is orientated > towards beginners but it does cover Adas OO and generics well. Crap. Forgot to say that Ada: The craft is available online for free though! ^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: How difficult is ada to learn? 2005-06-30 22:53 ` chris 2005-06-30 22:54 ` chris @ 2005-07-01 5:39 ` Jeffrey Carter 1 sibling, 0 replies; 20+ messages in thread From: Jeffrey Carter @ 2005-07-01 5:39 UTC (permalink / raw) chris wrote: > > Not very. I found it easy to learn from a pascal background, so you > should have no problem. The US Military Academy (West Point) did a controlled study that concluded that Ada was a better 1st language than Pascal. Presumably that means Ada's easier to learn than Pascal. -- Jeff Carter "We call your door-opening request a silly thing." Monty Python & the Holy Grail 17 ^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2005-07-15 5:14 UTC | newest] Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2005-06-30 0:44 How difficult is ada to learn? Sm704 2005-06-30 5:11 ` Ludovic Brenta 2005-06-30 6:15 ` Preben Randhol 2005-06-30 14:19 ` Gene 2005-06-30 14:34 ` Matthew Heaney 2005-06-30 15:00 ` Duncan Sands 2005-06-30 18:38 ` Gene 2005-06-30 19:32 ` Matthew Heaney 2005-06-30 18:59 ` Randy Brukardt 2005-06-30 19:36 ` Matthew Heaney 2005-06-30 15:01 ` Matthew Heaney 2005-06-30 22:35 ` Robert A Duff 2005-07-15 2:27 ` Waldek Hebisch 2005-07-15 5:14 ` Ludovic Brenta 2005-07-01 5:37 ` Jeffrey Carter 2005-06-30 16:43 ` Martin Krischik 2005-06-30 19:36 ` svaa 2005-06-30 22:53 ` chris 2005-06-30 22:54 ` chris 2005-07-01 5:39 ` Jeffrey Carter
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox