Learning a new programming language, which one?

<p>Have no programming experience, but want to learn so I can start doing Number Theory problems on projecteuler.net</p>

<p>Two teachers advised me. One says to use Haskell, the other says Python.</p>

<p>Which one is easier to learn?
Which one is more useful for math?</p>

<p>Which one will be more useful in the long run?</p>

<p>Thanks.</p>

<p>C++ .</p>

<p>The only math software I’ve heard of is Mathematica and Maxima. Do those not work?
I also solved a number theory problem with C++, which is more general.</p>

<p>Since Haskell is a functional language and Python is a high-level language, Haskell would be more directed towards math processing. But if it’s your first language, it’ll teach you poor syntax (imo) and will therefore make learning other languages a bit more difficult. </p>

<p>Go with C++. But of those two you mentioned, I like Perl better. You should be able to do most of the problems on PE with any of the three languages.</p>

<p>C++. If you can only choose between Haskell and Python, I would recommend Python.</p>

<p>Python</p>

<p>/10char</p>

<p>So, okay, no Haskell then.</p>

<p>Based on the replies here though, would C++ be better then, or Python?</p>

<p>It depends on the style and level of programming. Python is meant to be an elegant language, and that in itself led to its popularity. C++/C on the other hand is meant to be a more robust language, as it offers many elements of low level programming and is itself a mid-level language.</p>

<p>Which one is easier to learn?
Definitely Python</p>

<p>Which one is more useful for math?
It depends, I’ve solved several quite complex (in terms of numbers of processes) problems with Python, but generally, Python is too slow for most scientific needs (Most Numerical extensions are themselves C bindings). Although if you’re looking for a pure mathematical solution that’s also easy to learn, I would suggest Pari/GP, which is nothing really more than a glorified calculator :P.</p>

<p>Which one will be more useful in the long run?
I would suggest learning both C++ and Python. C/C++ is an industrial grade language that’s rather awkward to code in. Python on the other hand is extremely slow compared to C, but is a great language to use to prototype a project.</p>

<p>Personally, I prefer Python over C/C++, as most of my projects are just my hobbies and therefore don’t depend on the speed that gives C the advantage over Python. Python also offers you an unique experience while coding, as the logic of your code is presented in a much clearer and elegant way than C/C++ could ever achieve. (And contrary to what others assert, I do believe that Python offers you a great opportunity to become acquainted with the many elements of computer science that are pervasive across all (but the most obfuscated languages…, I’m looking at you malboge) languages. For instance, I had independently studied python before taking formal courses (well, they are introductory… but that’s not the point) in Java and found the transition extremely easy, as I had already learned most of the concepts that newcomers struggle with and am left with just the syntax and the standard library to be acquainted with.</p>

<p>c++ or java.</p>

<p>c++ is awesome</p>

<p>Java is awesome (sometimes).</p>

<p>Alternatively, you could learn Brain**** (where **** = sex, the central finger, etc.)
It is easy to learn and to use.</p>

<p>I’ll second this thought: C++, if you have to do Python or Haskell, Python.</p>

<p>I would say if you have no programming experience, go with C++. Do a couple project euler problems with it.</p>

<p>After than, learn Python. You will love it. There are tons of libraries for math/science.</p>

<p>I wouldn’t recommend delving into the programming world via C as it’s, well, much too structured. I’m not bashing the language as I also use it on a day to day basis, but it’s not a beginners friendly language at all. Many people find it easier to transition from Python to C than in the reverse order.</p>

<p>

</p>

<p>xD, highly recommended, it’s actually much easier to write a generator for bfck than to actually write the code, the easiest implementation for the Hello World program could be thus generated: (in lua)</p>

<p>



str = "Hello World"
for i=1,#str do
      for <em>=1,str:byte(i) do
            if not _str then _str = "" end
            str = _str .. "+"
      end
      _str = _str .. ".>"
end
print(</em>str)


which would give us



++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++.>+++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>+++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++.>++++++++++++++++++++++++++++++++.>++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>+++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++.>++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.>++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++.>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++.>


</p>

<p>Which amazingly is the same as Hello World xD (yes, I’m a huge computer nerd)</p>

<p>there’s also matlab and maple if you want stuff that specializes in math</p>

<p>but otherwise i would recommend c</p>

<p>failboad: :eek:</p>

<p>Yeah go with Maple</p>

<p>Haskell is great for math. I recommend Python for a first language.</p>

<p>If you invest in learning something like C, C++, or Java, you’ll very likely be able to pickup Python on your own.</p>

<p>Ruby or Python all the way.</p>

<p>Nothing on Project Euler is really that computationally intensive, as you SHOULDN’T ever be brute forcing stuff.</p>

<p>c++ is a royal pain in the ass. Don’t bother with it until you’re forced to.</p>

<p>^ C++ may be a pain in the ass, but if you know it, you will find it easy to pick up a lot of languages with similar syntax like Java, C#, PHP, Javascript etc.</p>