[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 38 KB, 500x375, Gondar_Ethiopia.jpg [View same] [iqdb] [saucenao] [google]
5493707 No.5493707 [Reply] [Original]

Hey /sci/, What programming language do you recommend for an engineer?
Right now, Im planning on learning C.

>> No.5493729

java

>> No.5493746

making apps: C#, Java

number crunching: haskell, matlab or octave

>> No.5493776

>>5493746
>number crunching

actually Fortran is the shit if you invest a little time

>> No.5493779

>>5493707
>Right now, Im planning on learning C.
C is well-known, so many pseudo-code and scripting languages look like it

However it's low-level so if you just want to model something, in that case Matlab is preferred

>> No.5493784

>>5493779
>C is well-known, so many pseudo-code and scripting languages look like it
Agreed.

It's worth learning C OP, firstly because it won't take long, and secondly because almost everything looks like C.

>> No.5493785

Fortran = physics tier
C = pleb tier

>> No.5493790

>>5493746
Do people actually use Octave as compared to Matlab?

>Haskell for numbercrunching

>> No.5493793

>>5493707
Perl.

Srsly, tho, Python.

>> No.5493794

>>5493793
I don't think engineers would really need to use Perl or Python.

It's helpful to know a scripting language, sure, but it's much more helpful to learn C or Matlab as mentioned above.

>> No.5493805

>>5493776
Why would you think that?
Fortran is horrendous for anything but simple linear algebra. And it's hardly "the fastest" as some people would claim. That might have been true back when compilers sucked, e.g. 10-20 years ago. You won't even find a single optimized BLAS implementation that still uses fortran.

>> No.5493811

>>5493790
probably scilab over octave

>> No.5493819

I doesn't matter what language you learn, they're all modern languages can do basically the same thing. Learning college level computer science deals more with ideas that you can apply to any language.

And anway, once you pick one up the rest are easy. I started with C++, now I do primarily C#, and am trying to learn Python but what the fuck why am I allowed to make variables without identifying what I want that variable to be this doesn't make any sense

>> No.5493821

FORTRAN

>> No.5493861

depends on what kind of engineer.

there is as many kinds of engineers as there is science fields

>> No.5493864

>>5493819

python does it for you. when u put in an integer.. why cant the computer identify the integer as an integer. its only pedantic to always have to write int before it.

the python complier(or wahtever) scans thorough your code. looks for how you format the number. "puts" an int or float before it. thats some way to deal with it i guess

>> No.5493868

I'll answer this the same way I always do: learn asm on at least one architecture, though some standard model and a harvard architecture is preferred; learn C; pick a powerful high-level language like a lisp (CL, scheme, or racket) or an ML (haskell, ocaml, or even SML).

>> No.5493870

>>5493819

It's called dynamic typing. Have you learned computer science?

>> No.5493869

>>5493864
python does not have type inference

>> No.5493877

>Java
>C#
>octave

Kill yourselfs

>> No.5493879

>>5493707

Unless you are explicitly a software engineer I'd go learn VBA. It will save you more time in Excel, and you will likely use Excel a lot, than you can even begin to imagine.

Although, if you get really good at C#, VBA will come naturally.

>> No.5493882

>>5493870

so what does python different, to get the dynamic typing. does it give the same size to everything. how is float numbers represented in python on a bit level ?

>> No.5493883

>>5493882
if you want to know how interpreters work, just read your SICP

>> No.5493887

>>5493861
OP here. I'm doing environmental engineering.

>> No.5493895

No, every engineering professor and working engineer I know hates scilab and octave. Everything in industry and research is done with Matlab+(C/C++ mex files that may be link other libraries). The only people I've ever seen support those two are the dirtiest of FOSS hippies that refuse to even use drivers or codecs if they can't masturbate to 100% of the lines of code they where written in without a single copyright on them, even if they're free.

A gimp version without toolboxes is retarded and your better off at that point to just using python+NumPy+SciPy. Every student is practically expected to pirate Matlab until they get jobs and then it is provided to them from the corporations/universities they are working for.

>> No.5493899
File: 37 KB, 796x310, op_status.jpg [View same] [iqdb] [saucenao] [google]
5493899

>>5493887

>> No.5493900

>>5493779
>C
>However it's low-level

No it's not. Just because it's compiled doesn't make C low level. C is perfectly fine and easy to use for all kinds of non-OO programing.

>> No.5493909

>>5493864
>its only pedantic to always have to write int before it.
No it's not, an integer could just as well be an:
unsigned char
char
unsigned short
short
unsigned
int
unsigned long
long
unsigned long long
long long

Type safety is a very important part of C/C++/all real languages.

>> No.5493914
File: 154 KB, 800x700, 4.png [View same] [iqdb] [saucenao] [google]
5493914

Learn C++ then learn Matlab. That's how my university does it.

>> No.5493937

>>5493887
Engineers use Matlab. If you are going to a real school mist of you upper division classes will have Matlab programming assignments.

The think I hated the most about engineering coding.

>> No.5493961

>>5493900

it is low level.

>> No.5493994

>>5493961
http://en.wikipedia.org/wiki/Low-level_programming_language

No it's not. Just because your too stupid to code in something without a built in garbage collector it doesn't make it low level.

>> No.5494042

>>5493994

reading throuth your link

se this
>many programmers today might refer to C as low-level

>> No.5494084

>>5494042
>many programmers today might refer to C as low-level
>many might

still doesn't make it correct.

>> No.5494088

C is good. If anything, even if there might be better languages for your specific task, C will almost definitely make learning any other language really easy. If you need to to OO for some reason, learn C#. And then Matlab for modeling.

>> No.5494106

Ocarina of Time

Nobody will get this...

>> No.5494115

>>5494084

doesnt make it false

>> No.5494117

>>5494106

object oriented ?

but its OOP not OOT

>> No.5494122

>>5494117
No.
One of the most well known speedrunners, runnerguy2489, is a civil engineer.

>> No.5494123

>>5493914
i want more like these

>> No.5494131

>>5494122

implying civil engineer is a engineer.

do they even math?

dont even know what they do. arent they like construction workers

>> No.5494144

>>5494131
The fuck do I know.
He just said he once made something with street lights.

>> No.5494146

>>5494123
no you don't, only an idiot from /g/ would put python at "hacker" tier and perl at "shit" tier. python's great and all but that's ridiculous.

>> No.5494148

>>5494146
Would Lua also be among these somewhere or is it something else ?

>> No.5494167

>>5493914

is matlab a programming language. isnt that just like cheap version of wolframaplha

>> No.5494170

Matlab and Fortran if you are in the nuclear sector.

>> No.5494177

>>5494167
not really, but you've got the right idea

matlab's specialty is numerical methods
wolfram alpha/mathematica's specialty is symbolic methods

>> No.5494207

>>5494167
you are now a confirmed massive faggot

>> No.5494231

>>5494177
>http://en.wikipedia.org/wiki/Low-level_programming_language

nothing on the pc is symbolic, it just uses enough decimal places, that you cant see the difference

>> No.5494339

>>5494231
no. MATLAB is for numeric calculations. Wolfram (and the real version, Mathematica) are more computer algebra. Though I have more experience with and prefer to use Maple.
>>5494167
u wot m8? do you even symbolic algebra systems?

>> No.5494357

>>5493909
> type safety is a very important part of c/c++
i fucking lol'd

do people actually think this? I always assumed it was just trolling.

>> No.5494361

>>5494148
lua is pretty sweet as far as embedded languages go, pretty much the best one

>> No.5494420

>>5494361
Lua is about as pleasant to write in as getting punched in the dick. The language looks pleasant enough until you start doing something more than a cute 100-line script... at which point it turns out half of the shit you expect to be there - because it's there in every other language - is missing. Can't really provide examples, I've done a large project in Lua a couple of years ago and I avoid it like plague since then.

Lua is good for simple stuff like NPC scripting in a game, and that's about it. Use Python, Ruby or - if you feel creative - Perl for everything else.

>> No.5494423

>>5494420
> large project in lua
It was not designed for this kind of work. But it's very schemey which is awesome. Metatables are pretty fucking cool.

Overall 8/10 language but yeah, not really made for huge projects.

>> No.5494433

>>5494357
Well the language is type-safe, though half of the really cool shit everyone does is based on explicitly throwing that type-safety out of the window (void pointers, pointer casts, in general everything that involves a pointer and wouldn't be in an "introduction to C" class). So it's more about the users than about the tool, I guess.

However
>>5493864
has no idea what he's talking about, which you can infer from thinking that python is compiled, anyway. Type safety is a very useful thing to have in large projects, ESPECIALLY projects coded by multiple people. Same with public/private class members and all that jazz, it's mostly to simplify debugging by knowing that there are limits to the shit that's being done with your class.

>> No.5494442

>>5494423
Yeah I know, but some people seem to talk about it like it's a general purpose scripting language, misleading the noobs.

It was definitely a horrible language for the project, but the client insisted on it for some reason so meh.

>> No.5494536

>>5494167
Matlab is a real programming language, it's just not suited to everything that, for example, C, C++ or Java would be good for, because it is interpreted and the interpreter is slow.

However if you mainly use built in functions such as matrix multiplication, it's pretty fast. I prefer matlab to numpy/scipy because I prefer value semantics to pointer semantics. Matlab can do both, but matrices are always passed by value (with copy-on-write optimization).

>> No.5494593

Just learn C and be done with it. You'll be able to understand any other language easily after knowing C.

>> No.5494708

1. C++
2. C
3. Java

>> No.5494733

>>5493914
Wow, that is the shittiest language ranking ever. It doesn't even know what troll it wants to be.

C# is considered by /g/ to be shit tier.
Ruby is professional tier since half the web runs on it, it was hipster back when it first came out and of course /g/'s info is years out of date.
Haskell is enthusiast/academic tier.
Java is professional tier.
/g/ considers Matlab shit tier because it's newbie friendly and proprietary.
Html, CSS, and VB are very unpopular on /g/ so not /g/ tier.
Perl is hacker tier.

What were you thinking?

>> No.5494795

>>5494733

Where the fuck is Lisp?

>> No.5494809
File: 7 KB, 223x226, rubiks.jpg [View same] [iqdb] [saucenao] [google]
5494809

What language do you guys use for project euler?

using python right now, hope to move on to c after problem 100, c++ after problem 200, and then an assembly language after problem 300.

will mix it up after problem 400.

Thing is, I might be starting a potentially 500+ line problem (program to solve rubik's cubes). And I thought I might have to make my own data structures and sorting algorithms. So, should I start working with c now (I understand it's a good first language, and still allows me to some cool stuff).

I'm thinking of doing the problems in both c and python since python is so easy to do the problems in.

>inb4 project euler is a waste of time
>inb4 project euler is not a good way to get used to using a programming language.

>> No.5494820

>>5494733
>implying /g/'s opinion should be trusted. or indeed /sci/'s

>> No.5494851

>>5494809
I dislike PE because of heavy focus on string operations and combinatorial math.

Probably Java or Python are good languages for it.

>> No.5494872

>>5494851
is therecany thing like it, that is better?

>> No.5494878

>>5494809
python exclusively. why do you want to drive in nails with a screwdriver? it's possible, but there are better tools.

don't actually code in assembly, especially PE problems. after trying C you'll be too frustrated with coding your own data structures etc already. if you want to get the hang of assembly, code some simple shit under DOSBox (try doing graphics!), or program a microcontroller. or both.

with C, assuming you're a noob, you might be better off to start with C++'s STL library, which implements common data structures etc for you. when you stop running into language syntax at every step, code a few in C then move on to something else.

>> No.5494911

>>5494872
Rosalind is a solid bioinformatics workout, although I dislike that much of it is re-implementation of classical algorithms.

Is there really any point in rediscovering Needleman-Wunsch in this day and age?

But yeah, it will definitely get you an A in any bioinformatics class.

>> No.5494954

>>5494795
lisp->scheme->racket

Racket/scheme is what you would use for production code

>> No.5494956
File: 315 KB, 800x1100, 3.jpg [View same] [iqdb] [saucenao] [google]
5494956

>> No.5494965
File: 8 KB, 240x240, skullncrossbones.jpg [View same] [iqdb] [saucenao] [google]
5494965

>>5493785
>>5493776
matlab is a lot like fortran in some respects
especially in terms of 'vectorized operations' or 'array operations'
c doesn't have that shit, but in matlab you do that stuff all the time, simply adding two arrays together is just A=B+C where these are all lists


>>5494911
yes, there is a need for understanding these algorithms because you need to know what's already been done in order to create newer and better algorithms for alignment (still a important topic in high throughput sequencing)

>> No.5495207

>>5494965
I challenge your notion that better algorithms can be created only by improving NW.

Perhaps there is another, better approach that nobody thought of before because it was unthinkable at the computational power that has been previously available. Then, you've just wasted all that time spent on NW.

Also, there is the fact that putting significant time into learning how to write code which is already freely available is not a great career decision.

There is a point where recapitulating all prior progress before starting work yourself begins to yield diminishing returns..

>> No.5495243

>>5493707
For actual engineering:

C++ and MATLAB when required. These are simply the default for all code given to you by a third party - especially if they're instrument drivers & interfaces.

Python for everything else, if you have the choice. Using it is so fucking pleasant. Futher, all numerical stuff is pushed to C/Fortran for speed where required.
http://scipy.org/
http://code.google.com/p/pythonxy/

>> No.5495257

>>5495243
Interfaces will be in C because C++ is a pile of fucking shit. What a driver is written in is irrelevant 99.9% of the time because you're not modifying it, you're linking to it.

>> No.5495260

Assembly, anything else and you're just a stupid brogrammer.

>> No.5495309

>>5495207
You might be right for some things, but this isn't reimplementing a large scale software. it's a simple algorithm. and learning algorithms is important, it's not a 'waste of effort'

My perspective comes from my teacher...he says a lot of 'algorithms' that newby programmers develop are basically what he calls 'gobbledegook'. they just random things that they think will get a good answer. while they are creative and might even get the job done, it's not really correct in a mathematical sense. learning to implement things correctly is important.
Rosalind is a good example that you mentioned, and it actually has many small little tricks that you have to follow in order to get the truly correct answer. i like it for this reason, i've only done about 10 levels but i wanna get to the more advanced ones soon

>> No.5495340
File: 32 KB, 480x640, microscope.jpg [View same] [iqdb] [saucenao] [google]
5495340

>>5493879
From a purely practical standpoint, either VBA or C# are very good suggestions. Basically, Excel is your friend, and it's widely used in both schools and workplaces. Data acquisition or design software your company gets from external vendors will almost always be written with Excel support in mind, and you'll be able to hack open any other data files you like with C#.

Personally, I hate Python, but it seems a reasonable second choice. It does everything, but it does nothing particularly well. If you don't have the desire to learn several languages which are more suitable to specific types of tasks, then Python would be okay.

You might also end up being exposed to Fortran, but if you already have another language under your belt, you can learn it in a day. Learning Fortran first is just going to expose you to a lot of bad habits.

C/C++ are probably overkill. A lot of scientific work is being done in Java these days because of quick dev time, but that's probably outside your scope. Haskell and Racket are very pretty, but almost no one uses them, so they're probably a waste of your time. Same goes for Prolog, language of kings.

Matlab, Octave, Mathematica, and R are all useful if and only if you plan on doing the kind of work for which they are designed. Also, Maple and Maxima are possibilities if you want something for solving differential equations and shit.

>> No.5495362

Fortran for efficient computing and supercomputing. C or C ++ for low demand computing and building an interface with less tech inclined.

>> No.5495377

>>5495309
My perspective comes from an extensive education in math coupled to exposure to real-world theoretical math problems, and from active research in bioinformatics.

It seems that too often it is assumed that to improve upon something, you must first master it. Firstly, this is self defeating: There will come a point where that thing will be too big to master in a lifetime and no progress will occur. Secondly, the solution of one problem need not affect the solution of another. It is wrong to assume a priori that problems with the NW, for instance, cannot be solved without intimate knowledge of NW (there is the question of why, if knowledge of previous progress is so helpful, the original authors couldn't progress farther than they have).

I mean, I like Rosalind and I see that retracing footsteps of others ultimately teaches you something. But imagine if somebody wandered around in 100 km of circles and zigzags before reaching a destination that is 1 km away from the starting point. Subsequent explorers need not follow those 100 km, and could just walk straight to the destination, now that they know where it is, and invest their energy into where to go next.

>> No.5495432

>>5495340

this guy is so full of shit it isn't even funny.

>> No.5495470

>>5495432
Not really, his post is by far the most realistic.

A lot of the posts above have been made those who clearly haven't been working in the industry for a few years.

As much as I hate to say it, you really are going to have to know Excel & VBA quite well...

>> No.5495538
File: 1.74 MB, 177x150, Cage smirk.gif [View same] [iqdb] [saucenao] [google]
5495538

>>5495340
>A lot of scientific work is being done in Java

>> No.5495777

>>5495470
excel and visual basic are for people who can't write software in a realistic language, and they conceptually don't even go together. Formulas in excel are essentially a mini functional language while visual basic is a straightforward imperative language. Mixing the two is fine; it's called "scheme."

>> No.5495796

learn COBOL, best language ever

>> No.5495878

>>5493899
What's VBA?
And I also will be majoring in Petroleum Geology. I should've put that in my first comment.

>> No.5495883

>>5493914
What university do you go to?

>> No.5495897

>>5495243
>>5495257
Thank you two.

>> No.5496070

>>5494809
> what language do you guys use for project euler
when I was fucking around with it, I used scheme and then racket.

> C
C seems like the worst language to use for PE. Assembly would be cool but I don't enjoy programming in assembly. I don't find it interesting or elegant. But I see in the comments that some folks use it. If it's your thing, might be cool.

> should I start working with C now
Everyone should know C who wants to program.

>> No.5496125

>>5493794
You can pick up the basics of Perl in a couple of days to a much greater degree of applicability than you could C, Python, or anything else. It's there as a matter of convenience.

>> No.5496134

>>5495878
>What's VBA

Visual Basic for Applications. Essentially an API to the Microsoft Office suite. Most businesses use Office, and most businesses can benefit from having their processes more tightly integrated with Office, hence VBA.

>> No.5496141

>>5496134
> most businesses can benefit
Microsoft can benefit every time they upgrade Office even though no features of note have been added for over a decade.

>> No.5496154

Depends. Are you just looking to write simple tools to help you with engineering problems? If so, I'd recommend C# if you don't mind being limited to Windows, Java if you do. Alternatively, Common LISP.

>> No.5496563

>>5496141
lol bullshit, excel is gets tremendously better from version to version, and is by far top dog when it comes to spreadsheets and shit (what do you want me to use, google docs? libre office?)

>> No.5496572

>>5495538
My astrophysics group works almost entirely in Java. Basically, the project leads got tired of having to rewrite and revalidate code every time we moved to a new cluster or HPC facility, because Fortran and C++ implementations vary a lot over time.

Also, recent incarnations of Java aren't any slower than C++ for most applications, and actually performs better in cases where garbage collection and dynamic code optimization are beneficial. This turns out to be a lot of cases, and in particular those involving intensive numerical calculations. And even if the code happened to run 5% slower, that's more than made up for by the weeks saved by having to port an unportable language.

>> No.5496643

As an engineer (or even as a physicist as myself) you don't want to learn THE programming language. In your job, be it academia or industry, you are faced with different sorts of challenges in a rather short time. Each task can be tackled by different approaches, and different programming languages.
In the last year, programming-wise, I used (I HAD to use): Mathematica, Matlab, R, Python, FORTRAN77, C, VBA, bash and ugh, even Java.

The point is, don't keep yourself fixed on one or two languages, learn as many as you can at any given opportunity.

>> No.5496687

>>5496643
>ughing at Java
>managing to use F77 without covering yourself in vomit

>> No.5496690

>>5496643
Don't you think he should be good with at least one or two languages?

>> No.5496743

>>5493707
A proper engineer should be good at regular C and one of the 3M products. One also needs to learn to integrate them, i.e. call some C code from a 3M product etc.

>> No.5496806

>>5493819
I'm in the same boat. I've learned a large part of C++ and C, and I've recently started learning python. And I hate how I can't easily declare a variable for my loops. (And the whitespace is slightly annoying, but I think I'll get used to it)

>> No.5496839

Baby programmer here, Getting into an astrophysics PhD next year. For the moment, when I have to do something, modelling or some shit, I usually work in two steps. First I do some research and play around with IDL (nobody mentionned it ? weird, I thought it was pretty common in my field, and there seems to be some astrophysicists around here). It's very simple to use, even magical sometimes (the where command in the fuckin shit) so it's perfect to explore a problem. Once I know what I want to do, I just do everything in C. It's pretty intuitive.

>> No.5497256

>>5496563
> excel gets tremendously better from version to version
name three features added that indicate a trend toward "tremendously better" since excel 97

>> No.5497264

>>5494167
MATLAB is a legit programming language. It even has OO, although it's kinda clunky.

>> No.5497272

>>5494433
>has no idea what he's talking about, which you can infer from thinking that python is compiled, anyway
Python IS compiled, you moron. Just because it doesn't shit out a single compiled file every time you run it doesn't mean it's not compiled, and you can very easily have Python fully compile your program if that's what you desire.

>> No.5497277

>>5494809
>>inb4 project euler is not a good way to get used to using a programming language.
It's not. Project Euler is shit for learning programming, because you can only do about fifteen problems before you're completely able to code the answer to a problem but are hamstrung by not knowing the only algorithm that doesn't take hours to run.

>> No.5497278

>>5497277
Project "find the algorithm that isn't O(n!)"

>> No.5497287

>>5497256
Sort by cell color, for one.

>> No.5498351

>>5497277
>>5497278

Lol sure is shitty programmer in here.

>> No.5498432

>>5498351
> bumping to shitpost
it's like you're really a tripfag