Programming Language

Which programming language is best to learn for math fags (not necessarily majoring in CS or anything). I'm thinking Python.

Other urls found in this thread:

lmgtfy.com/?q=learn c++
twitter.com/SFWRedditVideos

Lisp

Haskell

Best: Maple, Matlab, C++
Useful: Lua, Python, Julia
Neato: Scheme/Racket, Haskell
If your job requires it: R, Fortran, Mathematica
Waste of time: Java, C#, Ruby, PHP, Brainfuck

>Java

And here I am at the office getting paid to program in java. Get cucked. Literally nothing wrong with Java as long as you don't decide to make a physics engine on it or some shit. Also, it is one of the languages that preserves C style syntax and we should respect that, because C style is slowly dying. even though it is objectively the best way to code.

POO IN THE LOO

Guaranteed job (codemonkey): Java, JavaScript
Academia: anything not OOP

>Haskell
The only mathematically correct answer.

Probably not the most practical or useful answer though.

Whew lad what do you use programming for?

Java is the most inflated C-like language I've ever used. I mean that in terms of lines of code to write anything. Anyway, I find your level of triggered to be amusing.

>In 2016, professions imply ethnicity

Back to... tumblr? I don't fucking know.

>inflated C-like language I've ever used

This is actually a really shitty complaint.

>in terms of lines of code to write anything

So you were the guy from the CS graduate meme who made a Hello World by feeding the string as bytes of hexadecimal numbers and then parsing that shit.

Nice to meet you, I've never met a celebrity before.

OOP: Pretending there is a simple and concise process to write any program.

Would be nice if it wasn't bullshit.

I like their syntax though.

Hey, I wont pretend I wasn't like that when I was a teenager, but that's actually not my attitude, thanks for completely misunderstanding. Java isn't spaced out to be clear, Java is somehow both dense and long. This has nothing to do with leet LoC optimization. I find Java to be comparatively less readable than C/C++, JavaScript, Python, Ruby, Rust, ...

I would guess either Python or Octave are most useful.

Most all-round would be Python, best for specific numerical calculations would be Octave.

I write up all my mathematical model first drafts in C and make sure there are no bugs. After that I rewrite then in a language like Java so other people will be able to run it without their computer screaming about memory management abuse and OS level compiler errors. If I am going to publish the algorithm, I write again in MATLAB. By this point I've bug checked it so many times that when I inevitably give a presentation for it, I know it completely inside and out.

C is master race IMO, let's you do anything with a computer. Python is for people who don't know anything about their machines and want to program anyway. (This is coming from an applied math grad student)

>Python is for people who don't know anything about their machines and want to program anyway.
.. or who want to develop ideas and algorithms without having to waste time on something that's been done before.

import whatever

The scientific libraries available for python grow in numbers and maturity, which makes it an easy choice for most things related to data analysis. I don't really want to waste days or weeks in figuring out which robust fitting technique is best for some calibration process, trying them out via a scipy/numpy library is piss easy and quick.

Leaves more time for the proper science. Then add interactive shell and plots ...

Python is a solid bet and will get you pretty far. Some fields of math will require their own langauages just because they are so widely used in the field. Some examples are C, C++, Fortran, Matlab (lol), but you should not have any problem picking these up once you need to. C/C++ would also be a very solid ground to stand on, but even small projects can be alot of work, because you have to implement almost everything yourself.

The only thing that really pisses me off with python is the dynamic type shit.

Fortran

Are all Javafags as embittered as you are?

seconded

Python for easy stuff
Haskell for more math and category theory
Mathematica/Sage and matlab is for when you need it.

My man.

I think starting with Python is a solid choice OP. You have NumPy and easy plotting at your disposal, the language is sensible (unlike the fucking horror that is matlab), and lots of support is available for it. That being said you'll need to pick between Python 2 and 3. I don't have an opinion on that, because frankly I don't use Python.

Personally I am heavily biased towards C because I have a CS background. But I also have a physics background too, so this isn't purely from a CS standpoint. C gives you almost ultimate control of a computer. This is useful for writing highly optimized and integrated programs. If you doing large simulations is something you may do, this can make the difference between waiting a day and a minute for results to finish, escpecially when you have to take advantage of things like GPU resources. In my experience with engineering, the upfront savings of using languages like Matlab are completely nullified by the inherent limitations of the system when you want to do non-trivial stuff. Furthermore C enforces good programming habits, and gives the user a clearer view of whether a calculation is done efficiently or not. The major downside though is that C is very powerful, and with great power comes great responsibility (and sometimes difficult to track down bugs). It is also quite verbose, but I contend this is a strength and not a weakness. If you master C, you master your computer.

Lazarus

This is backwards imo. Octave/Matlab/Some other high level language first to prototype a method/algorithm. Extremely much faster to write and test algorithms when you don't need to keep track of hairy details. If it proves worthy make a demo in the prototyping language and probe for interest for making a real "commercial" implementation for speed and usefulness in some lower level language like C or C++ or even hard ware where you can get a hand on the details if you want to ( and need to ).

This coming from a postgraduate in applied math who has been prototyping algorithms for the last 5 years.

>>C style is slowly dying.

lol

>no OCaml
keep it real plebs

For mathfags this if you wanna do non math stuff learn c++ but don't learn phyton.

>How to spot the brainlet

Damn, I posted a couple of times and then left when the thread slowed down because you know, I got actual shit you to do you know. Unlike you fags writing shitty... idk... python scripts to share with your highschool computer club, I actually do important shit that makes actual money.

Anyways, just saying that Java is pretty okay seems to have triggered the fuck out of some people and if this is the case for you then fuck is your life meaningless.

Other than that, C++ masterrace every day, every night, but you cannot deny reality like this.

Yes, it is dying. You wouldn't know because you have never programmed outside of your nasty bedroom.

Non C-style languages like VB, python and other attrocities are really gaining momentum nowadays, and now languages like C, C++, C# and Java hold just a fraction of the market.

Why learn fortran when you can just use the time on learning c++?

How is something an 'atrocity' if companies and programmers willingly choose it in order to maximize productivity?

Physics fag here, I've only ever programmed on MATLAB and a bit of C which I've almost completely forgotten. MATLAB is so cash for anything math though. Basically my whole department uses it for DE's and (more basic) simulations and stuff.

Look,VB is not the only player in the 'code it faster' game.

C# accomplishes that pretty well, and to some extend even Java if you know your way around it.

And lets not forget that Javascript is also C-style, even though I left it out of my list. That is not to say that it is better, but if I had to choose between python and C-style python (javascript) then I'd go with C python all day long.

That said, programming without brackets and semicolons is nightmareish.

Take VB as an example, instead of the comfy {} you need to do End Sub, Exit For, Exit While, End While

The fuck is up with that?

And because of no semicolons, you cannot do multiline statements. This is critical as fuck when you want to make long if statements readable, after every AND thingy, you continue the rest in the next line so that everything follows without having to scroll to the side.

Obviously, the compilers can handle this because they are simply reading until they find the next ;

But in VB? Nope, you are fucked. The interpreters want everything in a single line so if you need to do anything more complex than a Hello World then tough luck, now your code is going to look like shit.

We had programming solved by the 60s, after that they should have made inventing programming languages illegal, They should have simply kept patching C and now the only programming language should be C++.

Brackets and semicolons were only necessary because it made things easier on the compiler.

Similarly, those atrocious C++ header files aren't needed in C# simply because computers nowadays can afford to make 2 passes over the source code.

>Brackets and semicolons were only necessary because it made things easier on the compiler.

You make a language that can handle multiline statements without having a 'end of statement' character and then I'll suck your dick.

Your complaint about C++ header files is valid though, but I don't get how it even matters.

Plus, having a short outline of an entire class can be pretty useful in a big projects where single classes break the thousands lines of code barrier.

Just a quick view of the their variables, the visibility of those variables, their functions, the visibility of those functions, the inheritance scheme and the type of inheritance used.

Retarded begginner here, is that advice about having to learn binary code before any programming language helpfull? Binary coding, python or Java first?

Header files are a terrific organization tool.

I'm currently expanding my knowledge in Java, should I just dump it and learn C/C++? I never hear anything positive about it said here... Is it a better time investment?

I'd say Haskell or Python.

Jesus yes. Java is mutilated C/C++. You'll make the transition fast and never look back.

Then again it's good you are familiar with Java because Android, if you're into that sort of thing.

what's a good IDE? for JAVA I was using eclipse, and someone recommended netbeans for library so I have that installed too along with Notepad++

what's a good book for c++?

I got through my CS degree only with vi and gcc. I don't like IDE's. For all their uses, I think they mostly promote bad coding habits.

ok thanks

For mathfags I'd say either Matlab or Maple. If you're looking for a codemonkey job, Java. Fuck off Java haters, Java is probably the easiest language to pick up and teaches you valuable coding skills you can apply to pretty much any other language.

Seconding this. Unless your work is engineering/numerical optimization-heavy (then Matlab is a good option) or statistics-heavy (then R is a good option). Mathematica/Maple seem popular too, so they're probably also good. I would avoid things like C/C++ which were designed more with systems programming in mind and less for whatever you will probably want to do.

also did this and would recommend.

Hater or not,
>Java is probably the easiest language to pick up
That's baseless as shit.

I've heard matlab is good for statistics but I don't use it because you need to pay

I say C++ but it requires more dedication to use effectively than a quick scripting language like python. But when you do learn to use it effectively it is very effective and very fast.

Java is impractical as shit and is inferior to C++ in every way.
It's like the VB.NET to C++'s C#

Python has multiline statements and no end of statement character.

Where should we meet up to do this?

Newline

Someone doesn't know much python.

>tfw first programming language was BASIC

Not even mentioned anymore

mathfag here

General purpose and babby shit.
>Python

Mathy computational algorithms + prototyping
>Matlab/Octave
>Python with Scipy/Numpy

Statistics
>R
>Stata/SPSS
>Look around, stats and data science people have their own languages and libraries for their own niches.

Serious computational shit
>C/C++ with GMP (GNU MP Bignum library)
>Specialized applications also have their own frameworks and languages such as machine learning.

>For more academic purposes
>Haskell (easy to verify correctness and build good abstractions, also teaches you to write good code by the way of functional programming, also gives you background knowledge/experience for learning category theory later on)
>Prolog (inefficient but has niche applications)

For the "If math doesn't pan out for me I can always become a codemonkey" safety net
>Java
>Javascript + Node.js + some frameworks

Matlab, definitely. it's a very forgiving language.

Not the most practical?
Literally everything is now has an equivalent written in this language.
OS, games, game engines, web frameworks and back-ends, general purpose programs, search engines, chan websites, machine learning algorithms etc.

Is Haskell fast for solving PDEs?

As long as it's not PHP or js

C is interesting because kernel programming is interesting.
Haskell is based and will continue to grow as parallel computing becomes more needed.
I have a job where I program Java and most people doing it are incredibly non-technical borderline neanderthals. Shit is pure bloat.

>And because of no semicolons, you cannot do multiline statements.

seriously _
what the fuck are you talking about

No, that's a lie.

I don't know python but I googled it and you have implicit and explicit multiline statements.

Implicit is almost there but you absolutely need your entire statement to be inside a parenthesis, and there the closing parenthesis is literally the end of statement character, as that is what the interpreter will look for.

In explicit you are literally using the slash to tell the interpreter to parse the next line too.

It is close, but that is not what I was asking for.

By the way,
>forced indenting

Absolutely haram.

Let's say that I wanted to do

Grid.SetData(Grid.Row.5,Grid.GetData(Grid.Row,1)*Grid.GetData(Grid.Row,3))

This would usually be too long to the point that you'd have to scroll to the right to see the end of it, or it would just look odd.

In VB (where this code is) I cannot just separate the line so that it all fits without needing horizontal scrolling, but in Java I could.

Grid.SetData(Grid.Row.5,
Grid.GetData(Grid.Row,1)*Grid.GetData(Grid.Row,3));

There the compiler would keep reading until that last semicolon.

This would look amazing because on the first line I am setting the position, then in the second line I am declaring the information to be written on that position of the Grid.

By the way, this is an actual program that has a Grid (think excel) and has to multiply the column 1 content times column 3 content into the column 5 content.

don't ignore me you fucks

lmgtfy.com/?q=learn c++

Anything written by Stroustrup or endorsed by him. Others you risk running into bad practice by people who think they know what they are doing.

>you valuable coding skills you can apply to pretty much any other language.

Not at all.

I'm in robotics research and we only use c++, python and matlab.
For good reasons, tbqh
python scripts get the job done if you just need something to work without it being efficient.
C++ is used for all low level robotics shit and microcontrollers, but also for general programs that need to run fast (like marker tracking systems we develop).
Matlab because sometimes you need to plot data and that's just really nice in matlab.

This and only this.
Damn I love RAII.

>java
>easy to pick up
>VALUABLE CODING SKILLS !?!?!?!?!

jesus christ you're retarded. is java the only language you know or what?

Learn C++ and Python and you will have anything you will ever need. All other languages are memes or front-end pleb shit.

>All other languages are memes or front-end pleb shit.

If you do not know a bit of everything so that you can do back end web, front end web, desktop, mobile and embedded then good luck getting a job where you have any actual freedom.

I try to imagine people who work on one language and on one platform all the time and my conclusion is that they must hate their pathetic lives.

C++ and Python give you no flexibility. One is simply faster to run and the other is faster to code. They supply almost the same need when it comes to deployment.

>If you do not know a bit of everything so that you can do back end web, front end web, desktop, mobile and embedded then good luck getting a job where you have any actual freedom.
webdev detected?

The question was what programming language was good for math, not getting employed as a code monkey.

>webdev detected?

I haven't done any web development for a company yet and I'm not exactly looking for that, but I have the knowledge and that is what matters.

As a flexible professional I am present in meetings, I propose ideas and I jump on the projects I see fit.

>The question was what programming language was good for math, not getting employed as a code monkey.

Fair enough but the conversation is already way beyond that and you did not quote even quote the OP to specify.

That said, C++ is obviously the better for math but if you are interested in the industry, knowing just C++ and C++ for kids (python) is not the greatest idea.

>code monkey.

Every single time someone uses this term I can only imagine a really ass blasted guy who can't get a job in software and has to work the shittier math jobs like stats and banking.

>C++ is used for all low level robotics shit and microcontrollers, but also for general programs that need to run fast (like marker tracking systems we develop).
C++ is used to write most of the the other compilers and interpreters that the younguns are so attached to.

Just avoid C++, Java, and C#. They are not conducive to learning, nor getting anything done.

if you want good plotting and you're working in anything but R, you're fucking up

Go is a pleasure to use.

Almost no one uses VB, you bloody spastic.

Great. More jobs for me.

statsfag detected

R isn't my favorite language to work with, but I admit it does make pretty pictures.

Coq!
Not turing complete but I guess it should work for you....

hm Ctrl+f'd and I was the only one to say coq.
Seriously guys?
Coq is made specifically for stating stuff that is to be proven, it's a mathematical proof language. Not perfect obviously (because we know proof cannot be automatized efficiently).
Also, yes,it is not turing complete, but that is not the point of coq, and it deserves at least a look if nothing else

That picture is concentrated truth. Encapsulation is a lie.

That said, some OOP concepts can be salvaged. It's just a shame that OOP owns the market. It's literally the ie6 of programming.

R is actually programming? Had to use it for a stats course in uni.

Yea but it's mainly used by stats and data science people. It's very similar to matlab/octave as well.