Duke4.net Forums: What languages do you use? - Duke4.net Forums

Jump to content

  • 3 Pages +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic

What languages do you use?

User is offline   Micky C 

  • Honored Donor

#1

I'm curious what languages people on this forum use and what they use them for.

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/
0

User is offline   Mark 

#2

The first thing you have to do with your Python expertise is to update md3 model import and export for Blender. :blink: Drek did one 2 or 3 years ago but didn't keep it updated for new Blender revisions.

This post has been edited by Mark.: 28 March 2017 - 03:30 AM

0

User is offline   Micky C 

  • Honored Donor

#3

You think my python is that good? I've only done a codecademy introduction. If you want a loop and an if statement in a function then I'm your man :blink:
1

User is offline   Mark 

#4

Go ahead and type one in. Fill in the details later. Its a start. :blink:
0

User is offline   Micky C 

  • Honored Donor

#5

Why don't you learn python then? :blink: It's got one of the easiest learning curves of any language.
0

User is offline   Kyanos 

#6

View PostMark., on 28 March 2017 - 03:29 AM, said:

The first thing you have to do with your Python expertise is to update md3 model import and export for Blender. :blink: Drek did one 2 or 3 years ago but didn't keep it updated for new Blender revisions.

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
Attached File  blender_md3.zip (8.22K)
Number of downloads: 275

Quote

2 or 3 years ago


WOW :blink: 5 years ago now, I had to check. "Posted 21 March 2012 - 08:05 PM"
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.
1

User is offline   Hendricks266 

  • Weaponized Autism

  #7

Python is super awesome.
0

User is offline   Micky C 

  • Honored Donor

#8

View PostHendricks266, on 28 March 2017 - 03:30 PM, said:

Python is super awesome.


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

0

User is offline   Hendricks266 

  • Weaponized Autism

  #9

Speed is a tradeoff, yes, but this can be mitigated by doing your algorithmic heavy lifting in C libraries.
0

User is offline   Kawa 

#10

C# for me, mostly. I do almost everything in C#. I'm into Starbound modding, so that involves Lua. I know a bit of Javascript, but since I decided to write my webpages like it's the early 90s, I haven't been using that much. One of my game projects, made in C#, has Lua for scripting, though it used to be scripted in JS. And another game project of mine is an adventure game running in the original Sierra SCI engine, so that's basically a Lisp-like.

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.
0

User is offline   Micky C 

  • Honored Donor

#11

Yeah I'm not too familiar with C and its derivatives. If I want a fast, low-ish level programming language for calculations I'd go with fortran, but of course you're talking more general purpose.

What about Julia though? Apparently that's slowly gaining dominance in a few areas.
0

User is offline   Hendricks266 

  • Weaponized Autism

  #12

If every project you do in Python needs new C code to be written, then there's no point to using Python. I should have said that the idea is you make use of reusable, modular libraries written in C to quickly accomplish something higher-level in Python. For example, I'm sure there are libraries to read various image formats. Cryptography is another one.

I've only heard about Julia in articles that also talk about Haskell, etc.
0

User is offline   Micky C 

  • Honored Donor

#13

I already have some fortran subroutines I should be able to plug into the python program, which will be doing ~95% of the computation. The python will basically be used to manipulate the input/output of these subroutines in the desired fashion.
1

#14

View PostHendricks266, on 28 March 2017 - 03:30 PM, said:

Python is super awesome.

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.

View PostMicky C, on 30 March 2017 - 12:51 AM, said:

I already have some fortran subroutines I should be able to plug into the python program, which will be doing ~95% of the computation. The python will basically be used to manipulate the input/output of these subroutines in the desired fashion.

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

1

#15

I have not programmed anything in a very long time, but at my peak of dabbling with such things I used C# albeit rather poorly. I also made use of Java when required and found I could learn quickly in that field, I also used ASP and ASP.NET for quite some time and still have to tamper with it every so often. Many years ago I had an affair with 68K assembly but wasn't very good at it, I did achieve the simple tasks I meant to however, but required help from others to do it.

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. :blink:

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

0

User is offline   Hendricks266 

  • Weaponized Autism

  #16

C# C-shart has the flaw of trying to be too C-like. C will never be a friendly language. I'll give you that C# is better than Java, but it's still subject to the same design principles that lend them to overly bureaucratic Software Engineer-y code. Python is incredibly simple and intuitive.

Posted Image
1

#17

And they wondered why Polymer didn't run very well¹ :blink:
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.
0

User is offline   Kawa 

#18

The current equivalent of Visual Basic? That would be Visual Basic .NET. Which is almost literally C# in every meaningful way. Just with 100% fewer curly braces and more End keywords instead.

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.
0

User is offline   Mark 

#19

These days I know a little bit of con code. But long ago and far away in the 80's and probably early 90's I was pretty good with Basic and Extended Basic for the TI-99 computer. After that it was Basic and Basic XL for the Atari computer. I loaded lots of cassette tapes and 5 1/4" floppy disks of my programs. Looking back now, I'm surprised I never looked into Visual Basic for PC's. I might have had a good chance of learning it.
0

User is offline   Micky C 

  • Honored Donor

#20

View PostHendricks266, on 30 March 2017 - 10:38 AM, said:

C# C-shart has the flaw of trying to be too C-like. C will never be a friendly language. I'll give you that C# is better than Java, but it's still subject to the same design principles that lend them to overly bureaucratic Software Engineer-y code. Python is incredibly simple and intuitive.


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.


View Posticecoldduke, on 30 March 2017 - 06:53 AM, 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.


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.


View PostKawa, on 30 March 2017 - 12:49 PM, said:

The current equivalent of Visual Basic? That would be Visual Basic .NET. Which is almost literally C# in every meaningful way. Just with 100% fewer curly braces and more End keywords instead.

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

0

#21

View PostHendricks266, on 30 March 2017 - 10:38 AM, said:

C will never be a friendly language.


View PostMicky C, on 30 March 2017 - 03:27 PM, said:

You're entitled to your preferences.


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 :blink:.

This post has been edited by icecoldduke: 31 March 2017 - 06:58 AM

0

User is offline   Micky C 

  • Honored Donor

#22

Fortran is very easy to understand from a mathematical perspective. I didn't start the program from scratch. Some of the main subroutines were given to me by a non-engineering academic, and I was able to pick up the torch and run with it. I'm not even an FEM expert and yet I was able to modify the subroutine quite significantly.

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 Posted Image

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

0

User is offline   Mark 

#23

battery drain was those porno vids running in the backround. :blink: The audio output chip draws a lot of power during those loud moans and grunts.

This post has been edited by Mark.: 31 March 2017 - 06:24 PM

0

User is offline   Psycho87 

#24

C is love. C is life.
1

User is offline   Micky C 

  • Honored Donor

#25

I thought plain C was somewhat out of favour compared to say, C++?
0

User is offline   Kawa 

#26

Plenty embedded systems where C is often a better choice than C++, but newer langs aren't an option.

...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.
1

User is offline   Hank 

#27

I like C++ .
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.
0

User is offline   Kawa 

#28

Concerning your rumor: Windows 9x and NT4 are written almost entirely in C, except for drivers and even then it varies. On the other hand, COM objects, like the shell folder views used in Explorer, are C++ objects with particular standard methods. They were in fact C++ objects hand-written in C, because you can totally do that.

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.
0

User is offline   Hank 

#29

View PostKawa, on 02 April 2017 - 08:51 AM, said:

Concerning your rumor: Windows 9x and NT4 are written almost entirely in C, except for drivers and even then it varies. On the other hand, COM objects, like the shell folder views used in Explorer, are C++ objects with particular standard methods. They were in fact C++ objects hand-written in C, because you can totally do that.

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.
0

User is offline   Kawa 

#30

Hand-written in C instead of C++, despite compiling to perfectly valid C++ objects. Like this. Explorer is written in plain C, as is the set of COM components it uses to display the contents of drives and special folders (My Computer, Fonts...), yet a COM component is by definition a C++ object.

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.
2

Share this topic:


  • 3 Pages +
  • 1
  • 2
  • 3
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options