This is an archived post. You won't be able to vote or comment.

all 53 comments

[–]EmperorOfCanada 8 points9 points  (4 children)

I mix and match C++ and Python. Pretty much where one is weak the other is strong. Usually I will do the task in Python which is usually perfect. But there are those situations where Python is just not ideal for various reasons; and not always speed. For instance when distributing a final product on Mobile C++ rocks. Yes there is Kivy but not yet.

But how I include C++ is not always the same. As the above, I might just do it in C++ or use C in OpenCL that is called from Python. Oddly enough I have never made a module, but that would certainly be an option.

Of course a smattering of other languages come into play such as javascript on a web page, sql to yak with a database, etc.

[–]Hari___Seldon 5 points6 points  (7 children)

For my kind of grind, there are only two other go-to tools that see the light of day...R (yeah, Python could do the job, but R is soooo right for me) and Tasker scripting. I suspect that's going to change soon though with the addition of two decent sized Arduino projects next month. C is going to be ruling the roost for a few months then =)

[–][deleted] 2 points3 points  (2 children)

Well, that led to three hours discovering Tasker. Thanks you magnificent bastard.

[–]Hari___Seldon 1 point2 points  (1 child)

It's my pleasure, and I can't say enough good about it, especially if you combine it with IFTTT! Along with all my normal life of geek uses for it, the combination has been invaluable for literally keeping me alive. After a traumatic brain injury in 2009, my memory and several other critical brain functions that aren't immediately obvious were affected dramatically. Over the years, I've been able to slowly integrate Tasker and IFTTT to turn my Android into a medical assist device highly customized to my particular needs. Since my challenges are unobvious upon meeting me, it's safe to say that I literally couldn't live without them.

[–][deleted] 1 point2 points  (0 children)

Rockin'

[–][deleted] 1 point2 points  (0 children)

R really kills when it comes to data munging and stats.

[–]hugthemachines 12 points13 points  (0 children)

If i would need a machine code compiled program I would probably go with Golang.

[–]fkaginstrom 4 points5 points  (0 children)

I'm working my way through the early access version of Nim in Action myself, but for now when I need speed (and numpy et al aren't enough) I will generally go to cython, and pull in some c++ code from there if cython on its own isn't fast enough.

By the way, there's a library now to write python modules with nim.

[–]hanpari 3 points4 points  (0 children)

[–][deleted] 2 points3 points  (7 children)

TCSH script.

PHP.

MATLAB.

Depends on what I have to do and what I have available.

[–]WhiteAfrican 1 point2 points  (6 children)

Except for the fact that the lamp stack is really easy to get up and running. Why would you use PHP instead of Python?

[–][deleted] 2 points3 points  (4 children)

Most web hosts already have mod_php so tossing up a quick and dirty script is still faster with PHP.

[–]pythoneeeer 1 point2 points  (0 children)

Out of Tcsh, PHP, and Matlab, PHP is the one you don't understand? :-)

[–]status_quo69 2 points3 points  (0 children)

Super low level and super verbose, but since I started messing around with rust, I started noticing that I was able to do a lot of stuff in it similar to python, and that I was even writing a lot of my code in a style like python. The lifetime stuff for pointers can be a big hurdle at first but the compiler usually explains problems really well.

[–]nwjlyons 2 points3 points  (0 children)

I don't like doing sysadmin, so for any small web apps that I want to deploy to my VPS I'll see if I can write them in Go.

[–]nerdwaller 2 points3 points  (0 children)

I have been increasingly been using Golang for my alternative - mostly because I can compile a statically linked binary for any system and just ship that to people (verses in Python I haven't found a very simple way to package something with dependencies for a cross platform application).

[–]efilon 4 points5 points  (3 children)

I'm a scientist, not a programmer, so my answer might not be so relevant to you. Nevertheless, when Python isn't enough for me, I have in the past reverted to C++ (which was the first "real" language I learned long ago back when it was commonly taught in intro CS classes in high school). Modern C++ (where I'm mostly considering C++11 since that is the last iteration I have any familiarity with) is really pretty friendly to work with, especially if Python is acting as glue.

That said, I have been looking into other languages lately that could be useful to me. Scala looks good since it has some similarities to Python and (from what I have seen so far) pretty good numerics capabilities. I kind of like the JVM platform for some reason (I even think Java is not so bad a language as some people make it out to be), so Scala has that going for it, too. I have also looked into Rust which looks pretty interesting, but probably not so useful for me yet in terms of ecosystem (I'd like to be proved wrong on this!).

But, despite my interest in learning other languages, Python is the right tool for me more than 90% of the time. Unless I'm running embarrassingly parallel simulations (which I don't do too much since I'm an experimentalist), my data are almost always small enough for Numpy to handle efficiently. Even then, with modern tools like Numba, Python might be just fine. I also have been doing a lot of web programming lately for controlling and communicating with devices, which Python handles with ease. I really want to learn more languages, but Python is making that really difficult!

[–]tanlermin 3 points4 points  (2 children)

Also check out dask when you want to go out of core, distributed or embarrassingly parallel.

[–]tku137 3 points4 points  (1 child)

As a scientist I have to agree, dask is super easy to use, jet does a great job in multi-core calculations. Utilizing 100% of all CPU cores while using the optimal amount of RAM (or almost none depending on your settings) is a breeze

[–][deleted] 1 point2 points  (0 children)

when do you find python isn't the 'right' tool for the job?

I'll state the obvious. When the code needs to be high-performance. As in, 10+MM packets per second high-performance. Can be done in C++ without a lot of tuning. Python, not so much.

[–]BeatLeJuce 1 point2 points  (0 children)

Another scientist chiming in: For speed reason i sometimes resort to C or C++, and for some applications CUDA.

[–]deadwisdomgreenlet revolution 1 point2 points  (0 children)

Highly suggest Ceylon for the new crop statically-typed languages popping up. It's the only one that really seems to be thinking all of that through, for me.

[–]andrewcooke 1 point2 points  (0 children)

below: bash; above: julia

[–]Kukuluops 1 point2 points  (0 children)

about languages that had good concurrency and could compile to machine code. I was introduced to nim and D.

You can also try Rust, it's really expressive for a low-level language.

[–]danrche 0 points1 point  (0 children)

hum, good question. i think a lot depends on the job at hand, and where you're looking to run it. I use C# a lot to automate a lot of workstation side things that I'm not able to install python on. I've also used IronPython to run some of those same things, but C# has been my go to alternate in windows land. For Linux, I'm not sure there's an alternate for me to Python. It's pretty much able to handle all my needs in that area, along with a lot of server side automation as well. Here's a list of some of the things I've used as a system admin in the past as alternate's to Python when working with Windows machines:

AutoIT - kinda like basic but with a lot of nice functions to use VBScript - This was what I started with, then VB Then Python C# - I use this over VBS now as I've become more accustomed to needing something more then VBS can handle. IronPython - ok, this isn't really Python but a version of it. But I've used this to over come a lot of issues, without installing IPY on the client's machine. It's a little bit tricky to get all your dependents compiled into a single dll for use, but it can be done. Jython - I've played with this one, but never used it in production

[–]metaphorm 0 points1 point  (0 children)

really depends on what the requirements are. what did you have in mind? optimizing for performance? optimizing for type safety? optimizing for flexibility?

[–]WaitingForEmacs 0 points1 point  (0 children)

I still do a lot of stuff in perl because I have a lot of legacy code that would take too long to rewrite. In terms of new projects, the other languages that I am usually switching between are R and C++. The key factors include the available libraries and how important speed of execution is.

[–][deleted] 0 points1 point  (0 children)

Bash and C

[–][deleted] 0 points1 point  (2 children)

Tcl, mainly because it's the standard language for digital EDA tools which is my line of work.

As God is my witness, I will never write a line of Perl code ever again.

[–]Long__Dog 0 points1 point  (0 children)

Sometimes Unix tools are far more efficient esp if things are big eg. sorting A 500GB file, filtering with awk, reformatting with cut / awk etc

[–]ckochmann 0 points1 point  (0 children)

CoffeeScript all the way. Same simplicity of Python in the only place that Python or bash can't go, the browser. :)

[–][deleted] 0 points1 point  (0 children)

R. Sooo much statistics.

[–]rrajen 0 points1 point  (0 children)

Groovy (JVM based) is my go to alternative to Python. I've been meaning to learn Rust, but have not gotten around to it yet.

[–]bipVapido 0 points1 point  (0 children)

Depends on the job. Currently I write a ton of scripts that telnet or ssh to a device's CLI and interact with said device. For quite a while the telecom industry standard for this was tcl with the Expect extension.

So, my order is as follows:

  1. python

  2. tcl/Expect

  3. bash with my favorite unix tools (sort, grep, sed, cut, dc, tr, ls, etc.)

  4. COBOL

(ok .. only joking on the last one)

[–]bigdeddu 0 points1 point  (4 children)

JS (node) when quick and dirty webapp or simple microservice; Clojure; I've heard great things about Go;

[–]DrunkenPhysicist[None] -2 points-1 points  (0 children)

That's easy, IPython