Prev: proble in common
Next: GNU f90 read() run time error
From: J. Clarke on 8 May 2010 09:24 On 5/8/2010 1:07 AM, glen herrmannsfeldt wrote: > Jim Xia<jimxia(a)hotmail.com> wrote: > >>> F77 is pretty easy to understand and learn if you have any kind of math >>> aptitude. ?The advanced features and syntax of f90 and up obscure the >>> language, in my opinion. ? I think it would be wise to learn the basics >>> before going on to the esoteric stuff, especially if you don't already >>> know some other programming languages. > >> I would have agreed with these opinions 15 years ago. As a physicist, >> all I cared were algorithms and computations expressed mathmetically. >> I even canceled an enrollment of a course on Scientific Computations >> using Fortran 90. But then after I've moved across multiple fields >> and different languages, I view these opinions as near-sighted and >> narrow minded. > > If you have already used other languages, and are used to thinking > in programming language terms, then yes. There are some features > in Fortran 2003 that will take some getting used to, but not so bad. > > But the OP was asking about it as a beginner. Are there any > beginner level Fortran 2003 books? Is there (I haven't looked) > a "Fortran 2003 for Dummies" yet? Not a "for dummies" but there is a university text ("Fortran 95/2003 for Scientists and Engineers" by Chapman) aimed at freshmen with no prior programming experience other than what one gets in high school or teaches oneself. I've not seen it and have no idea if it's any good. >> True, if you want to write a toy program in one >> afternoon, F77 can pretty much suffice what you need. But from a >> serious software engineering point of view, F77 or F90/95 are >> handicaped. Most Fortran programs I've seen are brittle and hard to >> modify or integrate with other components. This was partially caused >> by the lack of facility in these old languages. But more importantly >> these softwares were mostly written by scientists/engineers who >> normally lacked formal trainings in software engineering. As I see >> it, if we don't encourage newcomers to proper learn the principles in >> software engineers and embrace the new language features that encourge >> these practices, and keep teaching them how to write old F77/F90 code, >> I'd say we'll drive them away from Fortran in no time. > > Some people only need to write small, simple programs. It is, > at least, a good way to start. > >> I've written F77 longer than any other languages. However after real >> application experiences with C, C++ and Java in a number of fields, my >> view on Fortran changed dramatically. Coming back to Fortran 7 years >> ago, I picked up Fortran 2003 and never wrote a F77/F90 code again. >> I'm looking forward to seeing what F2008 offers me :-) > > I don't know how easy C89 is to learn as a first language, but it is, > in most ways, a fairly simple language. A small number of different > statements and intrinsic types. The Java language (separate from > the standard class libraries) is also fairly small, though somewhat > more complicated than C89. I think if you already know F77 or earlier, C becomes more difficult to learn well--as the saying goes "you can write Fortran in any language" and inertia leads one to treat such things as pointers as being complicated add-ons rather than essential tools.
From: Richard Maine on 8 May 2010 10:00 Jim Xia <jimxia(a)hotmail.com> wrote: > I've written F77 longer than any other languages. However after real > application experiences with C, C++ and Java in a number of fields, my > view on Fortran changed dramatically. Coming back to Fortran 7 years > ago, I picked up Fortran 2003 and never wrote a F77/F90 code again. My " conversion" from f77 came right around 1990, after having used many languages, but f66 and f77 as my primary ones for 22 years. It wasn't directly related to the release of f90. It was that I was starting a new major project that I decided was going to be painful in f77. I really wanted something like structures and dynamic allocation. I knew how to "fake" those in f77, but that was just going to greatly complicate the new project. So I went searching for what other language I wanted to use. I looked at several. C certainly had all of the basic functionality, but my personal productivity (particularly when you include debugging) in C was just horrid. I found it painful to write C, and I made many, many errors. I decided that if it was going to have to be C, that I'd drop the project instead. I played with Ada a bit, but decided it wasn't right for me either. While I was looking, I heard about f90. Even though there were no compilers yet, I decided it was going to be the solution for me. -- Richard Maine | Good judgment comes from experience; email: last name at domain . net | experience comes from bad judgment. domain: summertriangle | -- Mark Twain
From: Jim Xia on 8 May 2010 12:40 > My " conversion" from f77 came right around 1990, after having used many > languages, but f66 and f77 as my primary ones for 22 years. It wasn't > directly related to the release of f90. It was that I was starting a new > major project that I decided was going to be painful in f77. I really > wanted something like structures and dynamic allocation. I knew how to > "fake" those in f77, but that was just going to greatly complicate the > new project. My first real C experience came around late 90's. It was a large application, with around 10 million lines of code and 400 developers. It was a real eye-opening learning experience, and helped me build solid fundation in C. Later I moved to C++ and Java in research and development projects. Those helped me understand how to best construct softwares -- you paid more attention to design issues than programming or language issues. Last time I worked on a C project was around 2001 - 2003, which was only 3 million lines of code and around 50 developers. It was an easy project as it was nowhere near the complexity of the 10 million line project I worked on in late 90s. > > So I went searching for what other language I wanted to use. I looked at > several. C certainly had all of the basic functionality, but my personal > productivity (particularly when you include debugging) in C was just > horrid. I found it painful to write C, and I made many, many errors. I > decided that if it was going to have to be C, that I'd drop the project > instead. I played with Ada a bit, but decided it wasn't right for me > either. While I was looking, I heard about f90. Even though there were > no compilers yet, I decided it was going to be the solution for me. Yes, if you want to build abstract data types, then F77 is hopeless. What I found as the most useful features in F90 is array languages. Working on multi-dimension arrays is a pain in any language, and F90 makes it less painful :-). I adopted it immediately after I started the F2003 project. I've never used F90 when my F03 project just began, but by reading the standard, I can quickly relate most the language features to what offered in other languages. Some of the F90/95 features I liked include elemental functions, modules (but I think submodules are the key missing part), allocatable arrays, implicit none. What I believe Fortran hasn't addressed (and should have) is the requirement for explicit interfaces for routines. This is an error prone area. Jim Cheers,
From: Louis Krupp on 8 May 2010 13:03 On 5/8/2010 7:24 AM, J. Clarke wrote: > On 5/8/2010 1:07 AM, glen herrmannsfeldt wrote: >> Jim Xia<jimxia(a)hotmail.com> wrote: >> >>>> F77 is pretty easy to understand and learn if you have any kind of math >>>> aptitude. ?The advanced features and syntax of f90 and up obscure the >>>> language, in my opinion. ? I think it would be wise to learn the basics >>>> before going on to the esoteric stuff, especially if you don't already >>>> know some other programming languages. >> >>> I would have agreed with these opinions 15 years ago. As a physicist, >>> all I cared were algorithms and computations expressed mathmetically. >>> I even canceled an enrollment of a course on Scientific Computations >>> using Fortran 90. But then after I've moved across multiple fields >>> and different languages, I view these opinions as near-sighted and >>> narrow minded. >> >> If you have already used other languages, and are used to thinking >> in programming language terms, then yes. There are some features >> in Fortran 2003 that will take some getting used to, but not so bad. >> >> But the OP was asking about it as a beginner. Are there any >> beginner level Fortran 2003 books? Is there (I haven't looked) >> a "Fortran 2003 for Dummies" yet? > > Not a "for dummies" but there is a university text ("Fortran 95/2003 for > Scientists and Engineers" by Chapman) aimed at freshmen with no prior > programming experience other than what one gets in high school or > teaches oneself. I've not seen it and have no idea if it's any good. > >>> True, if you want to write a toy program in one >>> afternoon, F77 can pretty much suffice what you need. But from a >>> serious software engineering point of view, F77 or F90/95 are >>> handicaped. Most Fortran programs I've seen are brittle and hard to >>> modify or integrate with other components. This was partially caused >>> by the lack of facility in these old languages. But more importantly >>> these softwares were mostly written by scientists/engineers who >>> normally lacked formal trainings in software engineering. As I see >>> it, if we don't encourage newcomers to proper learn the principles in >>> software engineers and embrace the new language features that encourge >>> these practices, and keep teaching them how to write old F77/F90 code, >>> I'd say we'll drive them away from Fortran in no time. >> >> Some people only need to write small, simple programs. It is, >> at least, a good way to start. >> >>> I've written F77 longer than any other languages. However after real >>> application experiences with C, C++ and Java in a number of fields, my >>> view on Fortran changed dramatically. Coming back to Fortran 7 years >>> ago, I picked up Fortran 2003 and never wrote a F77/F90 code again. >>> I'm looking forward to seeing what F2008 offers me :-) >> >> I don't know how easy C89 is to learn as a first language, but it is, >> in most ways, a fairly simple language. A small number of different >> statements and intrinsic types. The Java language (separate from >> the standard class libraries) is also fairly small, though somewhat >> more complicated than C89. > > I think if you already know F77 or earlier, C becomes more difficult to > learn well--as the saying goes "you can write Fortran in any language" > and inertia leads one to treat such things as pointers as being > complicated add-ons rather than essential tools. To be pedantic, this might be true if F77 (or FORTRAN IV) is all you know, but experience with assembler makes C easier to learn. That's how I did it; I compiled VAX C files with /MACHINE_CODE or whatever it was turned on, and I eventually figured out what those pointers were all about. It didn't hurt that I was using the original Kernigan & Richie C manual. I wouldn't want to give up ANSI C and go back to that, but it was nice starting with something short and concise. Fortran might be similar; do you learn something simple (e.g., FORTRAN IV, my first language) so you can get something done right away (I actually couldn't, since my FORTRAN LOAD card started in the wrong column, and nobody caught it, and my first successful program was in Burroughs ALGOL), or do you take the time to learn something more robust (like Fortran 95/2003)? Louis
From: glen herrmannsfeldt on 8 May 2010 14:20
J. Clarke <jclarke.usenet(a)cox.net> wrote: (snip on Fortran 77 books) > I think if you already know F77 or earlier, C becomes more difficult to > learn well--as the saying goes "you can write Fortran in any language" > and inertia leads one to treat such things as pointers as being > complicated add-ons rather than essential tools. Not so long after I started in Fortran, I started learning assembly, first from reading the generated assembly code from the Fortran compiler, and later actually writing some myself. One you are used to thinking in terms of addresses, learning C pointers is much easier. Directly from Fortran 66 to C, might be somewhat harder. -- glen |