Choosing a Programming Language for Mesh Visualization: A Beginner's Guide

  • Thread starter Thread starter fufu
  • Start date Start date
  • Tags Tags
    Language
Click For Summary
The discussion centers on selecting a programming language for visualizing 1D, 2D, and 3D meshes as part of a master's thesis project. The beginner has prior experience with BASIC and Pascal but seeks to learn a more relevant language. Python is recommended due to its ease of use, extensive tutorials, and suitability for scientific applications, particularly for physics animations using libraries like VPython. Other languages mentioned include C/C++ for performance-critical applications, Java for object-oriented programming, and Fortran, which remains prevalent in scientific computing despite its age. The conversation emphasizes the importance of choosing a language that not only meets current project needs but also offers long-term utility in programming and scientific work. Additionally, resources like books and online tools are suggested to aid in learning and application.
fufu
Messages
13
Reaction score
0
Regarding programming, I'm a bloody beginner. I came in contact with BASIC as a child and learned some Pascal in high school. I never bothered to learn more, and I'm realising now how big of a mistake that was.

So, as a little side project of my master thesis, I want to do some programming. Never mind the details, but I'd like to visualize a 1D, 2D and 3d mesh and maybe some mechanical properties between the mesh points.

So, my question is, what programming language should I use? Which one is right for the task and practiacal enoough for me to learn? Someone suggested Python to me, because there are lots of tutorials out there. Would that be a good choice? I'm willing to buckle down and spend some time to learn how to do this computer thing but I would be even more enthusiastic, if the acquired language is actually useful for me in the future..

Thanks a lot for your suggestions..
 
Technology news on Phys.org
java
and in any case go object-oriented
 
sorry for stupid questions, but what's object oriented?
 
object oriented?

OO is a software design paradigm that makes use of "objects" - which are data structures encapsulated together with methods (like complex numbers with ther operations) - that model the real world.

At this stage, OO is a stetch. If you want to be a programmer, learn C and C++, if you want to program as a scientist, learn Mathematica and C.
 
I think Python is easier to use than Java. For me, I can more quickly whip a physics animation in 3D with Python/VPython than any other language. While Python isn't the fastest, certain features can be encapsulated in an external routines written in C or C++.

http://www.vpython.org/ is a good visualization module, which caters to the physics student. One can worry more about the physics of the problem rather than other programming details. http://numpy.scipy.org/ is very useful. This looks like fun: http://kineticskit.sourceforge.net/

Of course, nothing pins you down to one language. For me, when given a programming task, I sometimes decide to write it in a new language that will force me to learn aspects of the language. I started with BASIC, then Assembler, Fortran, C, Java, C++, Perl,... right now, for my work, I use Python and Maple more than any of the others.
 
Last edited by a moderator:
It should also be known that most scientific programs are still written in fortran.
However, a lot of OO scientific librairies are now available.
 
lalbatros said:
It should also be known that most scientific programs are still written in fortran.
However, a lot of OO scientific librairies are now available.

Is this because of Fortran's long history and early widespread use?

Are most newly-written scientific programs in Fortran?
(By the way, here are some freeware Fortran compilers: http://www.freeware-guide.com/dir/softdev/fortran.html .)

Hopefully, with access to the source code, those old Fortran programs can be translated into newer, more modern languages [without GOTO statements!].

Interesting reading:
http://mindprod.com/jgloss/unmainlanguage.html
"Choice Of Language" from (what was formerly called) "How To Write Unmaintainable Code"
 
My two cents worth:

C/C++: If you are not going to use it regularly and seriously then you will find it difficult and fustrating and inevitable programs will be bug-prone.

Fortan: Good choice, but limited these days unless you purchase one of the top versions with GUIs etc.

Java: Good choice as programs are more likely to be reliable owing to the OO constraints. Performs almost as well a C++ these days.

Python: Very good choice for a part time user because it is relatively easy to pick up. Performance is slow as it is interpreted, and I mean a good order of magnitute slower at least than the other laguages mentioned here.

Powerbasic: Very good choice also. The Windows version performs almost as well as C++ but it is much easier to learn. This is a lesser known breed of Basic but it is the best, highly versatile and with good community support. You will have to pay for it but it is worth every cent.

Chris
 
fufu said:
I never bothered to learn more, and I'm realising now how big of a mistake that was.

Look at it positively, it could have been worse: you might have not realized it at all :)

So, as a little side project of my master thesis, I want to do some programming. Never mind the details, but I'd like to visualize a 1D, 2D and 3d mesh and maybe some mechanical properties between the mesh points.

Am I to conclude that you are some sort of engineering person? In that case, for several reasons, Python is a very good choice. And let me make this claim even stronger: regardless if you would later go into some other languages which people have suggested above, you should absolutely know one swiss-army-knife, ubiquitous scripting language, that Python is.

There is an excellent book on Python, that coveres not merely Python as such, but what you can and should use it for as an engineer or physicist: Langtangen, "Python Scripting for Computational Science".

More generally, if in the future you intended to use programming for own custom problem-solving, then a scripting language, like Python, plus a computer algebra system, like Matlab or Maple, would make a near full complement (as robphy nicely illustrates). If you intend to work on development of computational codes, or you really come to need raw speed, than C/C++ are a must, and Fortran may be too (though I was able to dodge it so far ;)

--
Chusslove Illich (Часлав Илић)
 
  • #10
robphy said:
Hopefully, with access to the source code, those old Fortran programs can be translated into newer, more modern languages [without GOTO statements!].
GOTO's don't make bad code. People make bad code. :-p
 
  • #11
robphys...can you host your physics simulations with python online? or are the animations for your own personal use to show otheres at work?

and yeah gotos are fun.
 
  • #12
neurocomp2003 said:
robphys...can you host your physics simulations with python online? or are the animations for your own personal use to show otheres at work?

http://www.phy.syr.edu/~salgado/software/vpython/

(If you put up a webpage with http://www.vpython.org/" applications, let me know and I will add you to my list [at the bottom of that page].)
 
Last edited by a moderator:

Similar threads

  • · Replies 397 ·
14
Replies
397
Views
20K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 15 ·
Replies
15
Views
3K
Replies
16
Views
3K
  • · Replies 11 ·
Replies
11
Views
3K
Replies
69
Views
10K
  • · Replies 54 ·
2
Replies
54
Views
5K
Replies
16
Views
4K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 43 ·
2
Replies
43
Views
6K