[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Click for more| Home]

Is Fortran a good first programming language? I'm transferring

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 54
Thread images: 5

Is Fortran a good first programming language? I'm transferring from a CC to a 4 year college next semester. One of the first courses I'll take is an intro programming for physics majors that uses Fortran. They also use C++ but that seems to come towards the end of the course.

Would it be good to start trying to learn Fortran now? Or pick a different language to get comfortable with before I have to take that class?
>>
fortran? If they plan on wasting your time with shit like that, maybe don't even go there?
>>
>>7583425
Do you want to do numerical analysis? Go with fortran.

Do you want to do literally anything else? Don't go with fortran.
>>
Fortran is really awful, but also it's dead easy to do simple things, so it might be an okay introduction to programming. It's not as nit-picky as C++.

It'll introduce bad habits that you'll never get out of if you decide to learn high level programming languages later on in life. But it kind of depends on what you want out of it. If those are the only programming languages you ever intend to use, then you may as well start learning it.

I'm currently doing large molecular dynamics simulations in Ruby. The savings in debug and development time more than offset any performance losses from using a high level language. But if you're not going to use it in your class, maybe hold off on that.
>>
If an employer sees Fortran as a known language on your CV he will think you are way cool and hire you immediately.
>>
It's not it's the only thing I'll use. Hopefully with some self-control, I'll teach myself more C+ and another language or two over time while I'm still there.

>>7583444
How damaging would those habits be if I tried another (maybe Python) over the summer once the class ends?

>>7583432
I want both, just unsure of the best way to start before I transfer.
>>
>>7583460
Not damaging at all. Your first language won't teach you habits, the language you decide to use as your "main" language while in college will.
>>
>>7583465
Alright, I'll go ahead and get the Fortran book they use then.
>>
>>7583425
P Y T H O N
Y
T
H
O
N
>>
I hear COBOL is really in demand right now
>>
>>7583506
what are fortran and cobol used for?
>>
>>7583542

huge legacy systems that cost slightly less to maintain than to replace with more modern technology
>>
>>7583557
Yeah but I mean what do you have to even do? I don't know what sort of systems they're used in but lets say its a database. This database was written in, say, 1985, and has been functioning since then. What are you expected to do? Suddenly revise the code if some 30 year old bug suddenly shows itself? Alter it to make it compatible with Win 10 computers that access it? What is it you do to ancient systems that you'd have no idea how to recreate anyway if they did somehow fuck themselves to hell through some weird corruption of their program?
>>
>>7583425
Learn python and fortran. Python is a solid general language that will let you do a lot, however it's not very good when it comes to heavy numerical work, which is where Fortran comes in. So what you can do is use f2py, which allows you to place Fortran subroutines inside python functions. What this means is that you can quickly and easily generate a python script to pass a series of values to a Fortan programme, which will do all the heavy lifting, then pass the all the outputs back to your python script to do what ever you want with it.
>>
>>7583564
It might also be the case that the company that is using some particular Fortran programme is expanding and needs to expand its Fortran libraries as well. Or something like that
>>
>>7583444
>It'll introduce bad habits that you'll never get out of if you decide to learn high level programming languages

You're confusing Fortran for Java and Basic

>Ruby

>>>/g/tfo
>>
>>7583425
Scheme and Haskell.
>>
>>7583542

Cobol is used anywhere money is involved. Fotran is used by masochistic physicists
>>
When I took my chemistry bachelor we had a (very) small course on fortran. I remember it being fairly easy. Not that I remember much about it
>>
File: 1433919576263.jpg (20KB, 252x252px) Image search: [iqdb] [SauceNao] [Google]
1433919576263.jpg
20KB, 252x252px
>>7583724
lmao go fuck yourself, what are you 30-40 year old with a dead end job?
>>
>>7583736
Fortran is far superior to Cobol, fam. That's just a fact.
>>
>>7583724
>2015
>Using and recommending Scheme
What is this, 4chan.org?
>>
>>7583565

This. As a physicist you want to learn one language that's easy to write in, and one language that can crunch numbers really really well. In addition, Fortran has been in use for a long time, so there are a lot of routines (in the world of physics) that are written in Fortran.
>>
>>7583565
I dunno if you're still here, but would using that f2py language still make the class easier once I start taking it?
>>
File: Euler.png (30KB, 924x700px) Image search: [iqdb] [SauceNao] [Google]
Euler.png
30KB, 924x700px
>>7583877
f2py is a python module. If your class is in Fortran, then learn Fortran and python on the side. It's a fairly simple language to pick up, since there's not much to it. Pic related is an implementation of Eulers method.

>inb4 /sci/ hates on me
>>
>>7583736
Fucking love fortran. It has its annoyances, but its so goddamn easy to use.

>>7583565
Probably less ideal, but I tend to use bash scripting for this because its easier and im lazy.

>>7583899
misspelled finish in the call cpu_time. Also, is that geany?

>>7583769
Its also the easiest to run in parallel AFAIK. Though i believe theres a c++ offshoot designed purely for use in parallel coding. As far as I've seen in hydrodynamics/astrophysics, the big codes are fortran or c++ with the occasional python code ( https://github.com/zingale/pyro2 ) for example.
>>
>>7583913
>misspelled finish in the call cpu_time.

Oh yeah.

>Also, is that geany?

Code::Blocks
>>
>>7583913
>Probably less ideal, but I tend to use bash scripting for this because its easier and im lazy.

Care to expand on this?
>>
>>7583913
Both Fortran and c++ have an MPI library for parallel computing. Both work generally the same. Really easy to pick up.
>>
>>7583460
> how damaging
It won't be that terrible. I mean, everyone else goes through it... some people spend entire careers writing in nothing but Fortran. They'd have been much more productive if they'd used something else, but they didn't know better and it gets the job done. But you'll find yourself writing a lot of unnecessary code that, when you finally go learn a high level programming language, you'll want to replicate. It's hard for the ego to spend years working with a 40 line loop of code, building a hideous spaghetti-like mess of conditions and entry/exit points, and then learn a higher level language and realize that you could have done it in 2 lines.

Python is okay. I don't use it, but that doesn't mean you shouldn't. It doesn't do anything in particular really well, but it does most things adequately. A lot of people know the basics of it (though few know it really well), so at least you don't get retarded reactions like >>7583682 when you tell someone you use it.
>>
>>7583931
The fortran code is pretty self contained, just needs input files. So will generally bash script over loops and use sed to fix the input file for each run. Then in the script, run gnuplot and move all the files to other folders so I keep the working directory clean. I suppose I could do all of this in python and in the next phase of my project will end up having to wrap everything in python, but for now I think bash is ideal?
>>
>>7583444
>> large molecular dynamics simulations in Ruby

WHY? That does not make any sense anon. Why aren't you just using a ready made molecular dynamics package like LAMMPS that has been highly optimized? Writing your own (presumably classic ) MD codes does not make any sense in this day and age.

I mean with LAMMPS you can run everything from python if you really have too.
>>
>>7584095
>be me, taking a class on molecular dynamics
>get hw
>"model 36 argon gas atoms in a periodic boundary box of this size at this temp"
>ok cool
>"write it in matlab, include the code in your submission"
Goddamn

But yeah, LAMMPS is GOAT
>>
How's MATLAB/Octave?
>>
>>7584105
>Octave

vomit
>>
ITT: academia memes who dont know jack shit about programming and actual computers
>>
>>7584105
>MATLAB
like python, but easier.
>>
>>7584100
you consider modelling 36 argon atoms as a "large molecular dynamics simulation?"
>>
>>7584185
>MATLAB
Like python, but less useful, not lightweight, and with stupider syntax.
>>
>>7584232
>mandatory white space
>not the most idiotic thing ever
>>
>>7584220
Oh, I'm not that anon, just felt like sharing
>>
>>7584232
>stupider syntax
>stupider
>syntax
lol
>>
>>7584232
everything you said except lightweight is wrong
>>
File: TestImg.gif (7KB, 87x83px) Image search: [iqdb] [SauceNao] [Google]
TestImg.gif
7KB, 87x83px
>people who complain about white space in python
>>
>>7585273
Lrn2pep8 nigger.
>>
>>7583899
>REAL*10
OH SHIT WHAT ARE YOU DOING

>>7583769
>>7583565
This, learn C++ and Fortran so you can do the heavy programming with those and then use python for the rest. This is what we do in our research group in computational physics (although I'm the only young one that knows Fortran, C++ is preferred generally).

>>7583957
>a 40 line loop of code, building a hideous spaghetti-like mess of conditions and entry/exit points
Only legacy/shit code is like that in Fortran.
>>
>>7585295
What's wrong with REAL*10?
>>
>>7585299
It's bad for portability.
>>
>>7585301
Oh okay, thanks.
>>
>>7585303
If you are only going to run your code in your machine it's ok if it works, but only *4 and *8 are universally supported. Now I'm not sure if this is only an issue for old computers, but yeah. Also, it's slower.
>>
>>7585308
>but only *4 and *8 are universally supported.

Well it's only running on my own machine, but I guess it's good to know anyway, just in case. Thanks again.
>>
File: image.gif (2MB, 718x404px) Image search: [iqdb] [SauceNao] [Google]
image.gif
2MB, 718x404px
>>7584114
eat shit
>>
>>7585517
no u.
>>
based Fortran
Thread posts: 54
Thread images: 5


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]
Please support this website by donating Bitcoins to 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
If a post contains copyrighted or illegal content, please click on that post's [Report] button and fill out a post removal request
All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site. This means that 4Archive shows an archive of their content. If you need information for a Poster - contact them.