
What languages do you use?
#1 Posted 28 March 2017 - 01:30 AM
At the moment I know fortran, R, bash, VBA, and am currently getting into Python. I'll also try to pick up some basic matlab down the line to the point where I can interpret basic blocks.
My background is civil engineering, specializing in ground foundations, although I'm currently doing a PhD in the area which involves pretty high level research. I'm using fortran to generate random virtual soils, and design foundations using finite element analysis, then I'm interpreting the results statistically and graphically using R in a Monte Carlo framework.
However the more I get into Python, the more tempted I am to shift my programming to it. I'll keep the sophisticated, computationally intensive subroutines in fortran since it's by far the fastest and would involve a lot of work to port over, and implement the overall handling in python. This should also allow me to incorporate the statistical analysis from R into the program to have a single self-contained executable. Plus unlike fortran, Python allows for a GUI. Not to mention Python is the fastest to work with in terms of generating/testing code, and is very high level in terms of the built-in functions and standard libraries. Naturally I'll be using some of the popular calculation modules such as numpy and scipy. Out of the six I've listed above, it's by far the most general-purpose language, while the others tend to focus on specific areas.
Here's the language ranking based on popularity: https://www.tiobe.com/tiobe-index/
#2 Posted 28 March 2017 - 03:29 AM

This post has been edited by Mark.: 28 March 2017 - 03:30 AM
#3 Posted 28 March 2017 - 04:20 AM

#4 Posted 28 March 2017 - 04:32 AM

#5 Posted 28 March 2017 - 02:13 PM

#6 Posted 28 March 2017 - 02:59 PM
Mark., on 28 March 2017 - 03:29 AM, said:

It's still good, and I recently did some tweaks to it for Tea Monster, something about inverted normals? I'll dig it up and post the latest version in it's thread.
Here is the blender.org md3 import export script. I only came in and updated it back then because it didn't work on newer versions at the time.
https://wiki.blender...port-Export/MD3

Number of downloads: 361
Quote
WOW

https://forums.duke4...-export-script/
I haven't used much python since, I use java mostly dealing with libGDX. Python is just too, I don't know, too pyhton. Learning CON lead easily into C which is basically java (for me and my purposes) I still remember qbasic but haven't written anything in it in ages.
#8 Posted 28 March 2017 - 03:37 PM
Hendricks266, on 28 March 2017 - 03:30 PM, said:
Good to know I'm backing the right horse moving to python.
What about the speed? Obviously it's a lot slower than compiled languages. I know it can be sped up with certain packages that use compiled libraries, and there's the numba JIT compiler and Cython, but I gather there's no universal solution.
This post has been edited by Micky C: 28 March 2017 - 03:37 PM
#9 Posted 28 March 2017 - 03:39 PM
#10 Posted 29 March 2017 - 03:09 AM
The only things I regularly use C for are my fantasy computer emulation project (the emu itself is C#) and BUILD stuff.
I used to write in PHP too, but see above. Happens to be the only language in this list that I regularly need to consult the docs for.
#11 Posted 29 March 2017 - 07:24 PM
What about Julia though? Apparently that's slowly gaining dominance in a few areas.
#12 Posted 29 March 2017 - 09:07 PM
I've only heard about Julia in articles that also talk about Haskell, etc.
#13 Posted 30 March 2017 - 12:51 AM
#14 Posted 30 March 2017 - 06:53 AM
Hendricks266, on 28 March 2017 - 03:30 PM, said:
I strongly disagree with you, I hate python. It has some usefulness with automation scripts, but for the life of me I can't understand why people use it for anything else. I personally like C# a lot for tools and even automation, and C++ for everything else.
Micky C, on 30 March 2017 - 12:51 AM, said:
I also hate Fortran, the syntax is terrible, and for computation heavy stuff, you really should move to C++.
This post has been edited by icecoldduke: 30 March 2017 - 06:55 AM
#15 Posted 30 March 2017 - 10:26 AM
I mostly stopped though when compilers became crap or things became too heavy. Also, languages like Python and Perl as well as what Java became are what really made me stop for good because their sheer level of inefficiency and the instability/poor quality of the tools for them was something I found intolerable. Many people seem to think that as computers are more powerful now, it means they have a free pass to make things less efficient and it doesn't matter how heavy an application's footprint is. One has to wonder how well things would run if everything were optimized to the same level as older code.
I suppose if it counts as a language, I do still use CON sometimes.

Edit: Oh, I forgot. ASP.NET for the win, fuck PHP, talk about heavy footprint. Terrible language, terrible tools.
This post has been edited by High Treason: 30 March 2017 - 10:29 AM
#16 Posted 30 March 2017 - 10:38 AM

#17 Posted 30 March 2017 - 11:47 AM

I don't see why it should take half a Cray just to display a message box. To be honest, I didn't find the language very friendly either and would probably fare better if I'd tried to learn C# properly. If you're going to use a kiddie language like that, why not VB? Or whatever the equivalent is now. Much more lightweight.
¹For the record, I know that you did not write that and that it wasn't even in said language, but I couldn't resist making the joke.
#18 Posted 30 March 2017 - 12:49 PM
I mean, look at this shit. Here's a random method from my roguelike, as decompiled from the binary back into its source language:
public void PopulateTabstops() { this.Tabstops.Clear(); foreach (Entity e in base.ParentBoard.Entities) { //This part used to be "if it's a door or clutter, continue" but the decompiler decided on this. Whatever. if (!(e is Door)) { if (!(e is Clutter)) { this.Tabstops.Add(new Point(e.XPosition, e.YPosition)); } } } if (Cursor.LastTarget != null) { Point ltp = this.Tabstops.FirstOrDefault((Point p) => p.X == Cursor.LastTarget.XPosition && p.Y == Cursor.LastTarget.YPosition); if (ltp.X + ltp.Y == 0) { Cursor.LastTarget = null; } if (Cursor.LastTarget != null) { if (!player.CanSee(Cursor.LastTarget)) { Cursor.LastTarget = null; } else { base.XPosition = ltp.X; base.YPosition = ltp.Y; this.Tabstop = this.Tabstops.IndexOf(ltp); } } } }
Here's the exact same method decompiled to VB:
Public Sub PopulateTabstops() Me.Tabstops.Clear() For Each e As Entity In MyBase.ParentBoard.Entities If Not(TypeOf e Is Door) Then If Not(TypeOf e Is Clutter) Then Me.Tabstops.Add(New Point(e.XPosition, e.YPosition)) End If End If Next If Cursor.LastTarget IsNot Nothing Then Dim ltp As Point = Me.Tabstops.FirstOrDefault(Function(p As Point) p.X = Cursor.LastTarget.XPosition AndAlso p.Y = Cursor.LastTarget.YPosition) If ltp.X + ltp.Y = 0 Then Cursor.LastTarget = Nothing End If If Cursor.LastTarget IsNot Nothing Then If Not player.CanSee(Cursor.LastTarget) Then Cursor.LastTarget = Nothing Else MyBase.XPosition = ltp.X MyBase.YPosition = ltp.Y Me.Tabstop = Me.Tabstops.IndexOf(ltp) End If End If End If End Sub
Wow, it's like...
Incidentally, that game runs quite adequately on this ol' clunker. The only thing that doesn't is my emulator.
#19 Posted 30 March 2017 - 03:05 PM
#20 Posted 30 March 2017 - 03:27 PM
Hendricks266, on 30 March 2017 - 10:38 AM, said:
Just now looked up hello world in C. My god the convolution...
Although that image isn't strictly accurate anymore. With python3 it needs to be print("hello world!"). For some reason they replaced the print statement with a print function.
icecoldduke, on 30 March 2017 - 06:53 AM, said:
I also hate Fortran, the syntax is terrible, and for computation heavy stuff, you really should move to C++.
You're entitled to your preferences. I like fortran syntax overall. It does have a lot of minor issues such as declaring variables becomes pretty cumbersome in a large program, particularly if you're allocating everything dynamically. It'd be much better if an array just popped into existence with the right size at the right time/location without any prior work. It's also pretty tedious to do anything string related. Not to mention a lack of built-in functions for things like the average. Then you have integer division...
Python's "batteries included" philosophy should save time in the long run.
I'm guessing that on average people would be most comfortable with the syntax they first learned to code with.
Kawa, on 30 March 2017 - 12:49 PM, said:
I mean, look at this shit. Here's a random method from my roguelike, as decompiled from the binary back into its source language:
Wow, it's like...
Incidentally, that game runs quite adequately on this ol' clunker. The only thing that doesn't is my emulator.
I do prefer the second one. Obviously it takes up a bit less space (and python takes up less space still). But IMO it's preferable to differentiate the ends of if blocks and loops for code readability and debugging.
This post has been edited by Micky C: 30 March 2017 - 04:04 PM
#21 Posted 31 March 2017 - 06:54 AM
Hendricks266, on 30 March 2017 - 10:38 AM, said:
Micky C, on 30 March 2017 - 03:27 PM, said:
When people code up a system, they tend to forget that someone else may have to come in and maintain what you have written. So while I do understand where you are coming from, I strongly disagree that its not your problem that most of the world hates Fortran, Pascal and for that matter Python. Systems should be coded up in a way they are maintainable for the long haul, and that includes picking a language that most engineers don't cringe at

This post has been edited by icecoldduke: 31 March 2017 - 06:58 AM
#22 Posted 31 March 2017 - 06:07 PM
Fortran has a very large amount of important specialized, validated mathematical libraries associated with it. These subroutines typically don't need to be maintained as they already do what you want quite nicely.
I've started converting some of my smaller subroutines to python, and by doing a few things differently I've managed to reduce large chunks of code to roughly half the size while making it more generalized at the same time. I know I'm contradicting my praise of fortran given above, but the code I'm talking about is relatively trivial compared to what the big subroutines do, so there's no need for the fine control and sheer efficiency that fortran provides in these cases.
Since when does most of the world hate Python? I take it you're speaking from the perspective of someone who produces high quality code for a living. However there are a lot of people out there who code simply as a means to an end to produce results, and the less time you spend coding the program, the sooner you can get the results.
I've been using the PyCharm IDE and it's fantastic. It seems to be continuously scanning your code and pointing out areas where it thinks things don't look right, which is great for a newbie like me. The only downside is drains the macbook battery like a mother f*cker. Somehow got only 1.5 hours out of what usually lasts ~7

This post has been edited by Micky C: 31 March 2017 - 06:10 PM
#23 Posted 31 March 2017 - 06:23 PM

This post has been edited by Mark.: 31 March 2017 - 06:24 PM
#25 Posted 01 April 2017 - 03:53 PM
#26 Posted 01 April 2017 - 04:17 PM
...Also disgruntled programmers who feel things like C++' template system or standard library and such aren't very good.
Honestly, when I see << and >> as stream operators when everywhere else including in the rest of C++ they're shift ops, I get this "wth" feeling. And then I learn that "<< endl" doesn't just emit a newline, but also flushes the output stream, thus lowering file performance.
More honestly, I'm not disgruntled. I just quite literally get mild headaches trying to read nontrivial C++ code.
#27 Posted 01 April 2017 - 06:51 PM
My first dabbling in scripting/programming was with Visual Basic 3.0. Made a pump selecting program and sold it to other engineers. Then someone told me VB ain't not no programming language, like I cared. Anyway. Got myself a book about C, did not capture my interest. Rumor had it that some stuff of the Windows OS is written in C++. Got myself a beginner's book for C++, and it was love at first sight. The main reason was and still is, I can visualize the code in my mind, because it is broken into small digestible blocks (objects). It's then just a matter to obey the rules of the language. One needs real brains to do coherent stuff in C.
p.s. endl is redundant in most cases, use /n instead.
#28 Posted 02 April 2017 - 08:51 AM
Also, it's \n not /n. Which makes endl one of many redundant functions in C++'s standard library, and one of many that also misbehaves in subtle (sometimes less so) ways.
#29 Posted 02 April 2017 - 09:35 AM
Kawa, on 02 April 2017 - 08:51 AM, said:
Also, it's \n not /n. Which makes endl one of many redundant functions in C++'s standard library, and one of many that also misbehaves in subtle (sometimes less so) ways.
What is hand-written C?
As for /n \n lol, did I mention I use an IDE that captures stupid typos with instant read flags?
Also, endl is redundant most of the time, not redundant.
#30 Posted 02 April 2017 - 01:26 PM
Also, if endl is only redundant to \n most of the time, and the only difference is that it also flushes, you might as well use \n all the time and flush when you (or the system) want to.