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

Discussion Overview

The discussion revolves around selecting a programming language suitable for visualizing 1D, 2D, and 3D meshes, as well as exploring mechanical properties between mesh points. Participants share their experiences and preferences regarding various programming languages, particularly in the context of scientific and engineering applications.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant expresses a desire to learn programming for a thesis project and asks for recommendations on a suitable language, mentioning Python as a potential choice due to its abundance of tutorials.
  • Another participant suggests Java and emphasizes the importance of object-oriented programming (OOP).
  • A participant explains OOP as a design paradigm that uses "objects" to model real-world scenarios, suggesting C and C++ for serious programming and Mathematica for scientific programming.
  • Some participants argue that Python is easier to use than Java and can facilitate quick development of physics animations, highlighting libraries like VPython and NumPy.
  • There is mention of Fortran's historical significance in scientific programming, with questions about its continued use in new programs and the potential for translating old Fortran code into modern languages.
  • Another participant discusses the pros and cons of various languages, noting that Python is a good choice for part-time users despite its slower performance compared to compiled languages like C/C++ and Fortran.
  • One participant emphasizes the importance of knowing a versatile scripting language like Python, especially for engineers and physicists, and recommends a specific book on Python for computational science.
  • There is a light-hearted exchange about GOTO statements, with one participant suggesting that bad code results from people, not the use of GOTO.
  • A participant inquires about the possibility of hosting Python simulations online, indicating interest in sharing work with others.

Areas of Agreement / Disagreement

Participants express a range of opinions on the best programming language for the task, with no clear consensus. Some advocate for Python, while others suggest Java, C/C++, or Fortran, reflecting differing priorities and experiences.

Contextual Notes

Participants mention various programming paradigms and libraries, but there is no agreement on a single best approach or language, highlighting the subjective nature of language choice based on individual needs and contexts.

Who May Find This Useful

This discussion may be useful for beginners in programming, particularly those interested in scientific visualization and engineering applications, as well as for those exploring different programming paradigms and languages.

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
22K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 15 ·
Replies
15
Views
4K
Replies
16
Views
3K
  • · Replies 11 ·
Replies
11
Views
3K
Replies
69
Views
11K
  • · Replies 54 ·
2
Replies
54
Views
5K
Replies
16
Views
4K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 43 ·
2
Replies
43
Views
8K