Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations SSS148 on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Should Undergraduates Be Taught Fortran? 3

Status
Not open for further replies.
truckcab,

I like Perl for manipulating text. It has a couple of built-in functions for search and replace, that are amazing. On the other hand, I like playing with computers, and I don't mind learning new languages.

The best argument for Fortran is that non-computer technical people have better things to do than learn new computer languages. I have not seen any good books on Fortran in the local stores, so when I have to use a computer language for calculations, I tend to use[ ]C. C[ ]is not that good a language for calculations, and for analysis, the mid-level capabilities of[ ]C are not that useful, but if you have a hammer, your problem looks like a nail.

I have done calculations using the AutoLISP built into AutoCAD.

Critter.gif
JHG
 
Personally I use Matlab (or Octave) for post-processing data, with C-MEX extensions for things Matlab alone cannot do (although that list has got shorter over the 19 years I've been using it!).

C for general maths isn't that good. C++ is a lot better, with its overloads and template classes. I've spent the last week or two converting code from Matlab to C++, line-by-line with hardly any changes.

- Steve
 
One could argue that the MATrix LABoratory is king of computations.
[peace]

Fe
 
I'm torn. Matlab is the (auto at least) industry standard for those who have grown up and renounced Excel. But it is still proprietary, even though there are clones that use the same syntax. Teaching Matlab to students seems akin to teaching PowerPoint - vendor lock-in.

Mind you, most software vendors shower their goods on universities, so TMW aren't in any way the guilty ones.

I would have killed to use ML in my uni days, had I known it was there.

- Steve
 
I can write in every programming language in the world. How do I achieve this feat? Simply because before starting most things (big or small), I'll write the pseudo code. With sufficient iterations the pseudo is detailed enough for me to program in any language since it's just "vocabulary" by then.

What I'm saying is that most people focus on learning a computer language as opposed to learning how to program. They are quite different things. You can know a language well but be a poor programmer. But if you are a good programmer, switching languages is really just learning the correct syntax.



-
Syl.
 
I totally agree with SylvestreW. He hit it right on.

[peace]

Fe
 
I disagree, like I always do.

When I first found Matlab, it was a revelation. It still is in some ways, although I can't be done with all the "improvements" over the last few years.

Likewise, when I first learned C. Amazing compared with what I's known before.

And I'm still learning new tricks in C++.

Pseudo-code? Pah!

- Steve
 
My first opinion:
Students should learn a programming language so they get the basics of programming logic and understand some of what their computer is actually doing (as stated above). Frankly I don't care if it's FORTRAN, BASIC, C++, etc. Most engineers will not be programming in one of these languages anyway. It's the education that's most important here. BTW, I took FORTRAN 77 back when it was brand new. I dinked around with BASIC after college, but it was for fun and not for any professional use. However, the skills I learned made me a very good RPN programmer for my various HP calcs, and I use most of my programs professionally. We have 12 engineers in our office, and half use an HP calc, but I am the only one who programs either kind (mostly my HP-42S, and sometimes my HP-41CX and HP-48G+).

My second opinion (everyone wants a second opinion): Students should get a good grounding in Excel, Mathcad, and/or Mathematica because they will likely be using one or more of these professionally. I venture to guess that most of use Excel every day or nearly so, and I would make Excel training a requirement and Mathcad and Methematica an elective. For Excel training, I don't mean just learning how to use the program itself, but how to use to solve real-world problems. BTW, I use Excel daily and Mathcad once in a while. I used to use Mathcad more often, when I was doing more pure design. I am the only Mathcad user in my office of 12 engineers, and I am pretty sure I am the only Mathcad user in our region of the company (>200 engineers). I am also one of only two engineers in the office who use Excel for more than just basic calculations. The other guy is a recent graduate and he's like me in the sense that if we see an opportunity to automate and standardize a frequent calculation, we build a spreadsheet.

I'm not trying to brag. I'm just more facinated by numbers, equations, and ways to simplify my calculation life by taking on the task of building a solution (even if it takes longer). On the other hand, I'm not terribly fascinated by project management and the financial side of the business, even though I do that more now than design.
 
I can think of about 10 things that undergrad engineers should learn instead of Fortran.

1) How to spell
2) How to make an outline of a report before starting to type
3) How to use Excel the way it's designed
4) How to turn off MSN while at work
5) How things in their field of interest are manufactured
6) How their employers actually generate income and profit
7) How and where to find which design loads to use
8) What "design requirements" are.
9) How to work with others
10) How to talk to clients

Come to think of it, I have about 15 more, but I need to get to work.

tg
 
lol, that MSN one is sooo true. [smile]

Fe
 
I had to take a Fortran course in college which meant of course in those days all the things that went with it; punch cards, lines at the computer lab, waiting for days for your turn for your program to be run only to discover that you had built a 'do loop' into the thing and you had to do the whole thing over again. It was much less important to me at the time than the slide rule training that I had also had just a little earlier. That is how I got calculations done on a day to day basis and when examinations had to be taken.

I have never used it since even though I did get the first programmable calculator that HP came out with (10 steps-wow-I thought I'd died and gone to heaven, and I was the envy of the office) but I never equated my having learnt Fortran with any ability to use it. I can't program the HP 23 that I own today.

Still, and even to this day even though my type of engineering doesn't require me to write programs (I use plenty, however), I think it gave me a basic understanding of what is going on inside the belly of the beast when a computer does computations or sizing for me and it helped me understand early on that "garbage in = garbage out".

rmw
 
One of my early beefs with programming (possibly fodder for a new thread) was:

i = i + 1

Ouch...
 
i++;

Makes much more sense. Except that "i" is reserved in some languages.

- Steve
 
What's wrong with i=i+1 ?
I sometimes use this in Matlab. Although, for obvious reasons not in C.

[peace]

Fe
 
Fex, try subtracting i from both sides of the equation and see what your high school Algebra teacher has to say.

All this talk of index counts is giving me flashbacks to my 2 years of C at university (Aero had to take C, Mechanical got to take visual basic). My most complex program for the end of year project wouldn't work because I got them mixed up somehow.

Both years were given by completely unintelligible lecturers, one from Iran and one from Newcastle. I heard the one from Newcastle took a course on how to be a better teacher after our reviews of his course. The one from Iran on the other hand wanted us to submit 2 reviews, one anonymous as was school policy the other with our names on it as he thought there would be a difference in how we graded him if we feared retribution. Not me, I filled in both exactly the same, mostly 1's & 0's (fitting for a computing course though the scale was something like 1-5 with 5 being good) with my name on one in big letters.

And I wonder why I'm having trouble finding an alternative employer;-).

As to the OP, not sure it has to be Fortran but learning C has given me some appreciation for how code is done, what's going on behind the scenes in other programs etc. Even when doing some stuff in Excel this comes in handy.

KENAT,

Have you reminded yourself of faq731-376 recently, or taken a look at posting policies: What is Engineering anyway: faq1088-1484
 
Real life story form a practising engineer...

I created a C++ matrix class about 10 years ago for DoE/optimisation stuff using our simulation results. I wanted to make Matlab->my code easy to translate.

This past few months I've extended it to be a template class (needed complex variables). Then I've used it for some big matrix maths it was never really designed for. So I've had to interface it with lapack and blas, which are both FORTRAN.

Had I not known the intricacies FORTRAN, I would have been stuffed.

- Steve
 
KENAT said:
Fex, try subtracting i from both sides of the equation and see what your high school Algebra teacher has to say.

That is i gets i+1.

As opposed to the equals operator, which is what you are discussing. APL uses an arrow as an assignment operator. C uses == as the equals operator.


Critter.gif
JHG
 
i = i+1 is just shorthand. The subscripts have been dropped:

i(n) = i(n-1)+1

Personally, while I agree that it could anger algebra teachers, I like it. By knowing that i = i + 1 is a valid statement (in certain applications) I feel more powerful. I can now look at somebody that only knows algebra and not programming and say, "You can't say i = i + 1, but I can, because I know something you don't." ;)

-- MechEng2005
 
MechEng2005, I agree

i(n)-i(n)=i(n-1)+1-i(n)...

KENAT also has an algebraic point. But, when I am programming I rarely think of it as just algebra.

[peace]


Fe
 
... anyone who uses "i" as an index will get bitten when their code becomes complex. Or "j".

- Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor