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

  • Thread starter fufu
  • Start date
  • Tags
    Language
In summary, Python is a versatile, robust, easy-to-use language that can be used for a variety of purposes including programming.
  • #1
fufu
13
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
  • #2
java
and in any case go object-oriented
 
  • #3
sorry for stupid questions, but what's object oriented?
 
  • #4
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.
 
  • #5
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:
  • #6
It should also be known that most scientific programs are still written in fortran.
However, a lot of OO scientific librairies are now available.
 
  • #7
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"
 
  • #8
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
 
  • #9
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. :tongue:
 
  • #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:

1. What factors should I consider when choosing a programming language?

When choosing a programming language, you should consider factors such as your project requirements, your personal preferences, the availability of resources and support, the job market demand for the language, and its community and user base.

2. Which programming language is the best to start with for beginners?

The best programming language for beginners depends on your goals and interests. Some popular options for beginners include Python, Java, and JavaScript, as they have relatively simple syntax and are widely used in various industries.

3. What are the differences between a compiled and an interpreted language?

A compiled language is translated into machine code before execution, while an interpreted language is translated line by line during execution. Compiled languages tend to be faster and more efficient, while interpreted languages are easier to debug and have a shorter development cycle.

4. Can I learn multiple programming languages at the same time?

It is possible to learn multiple programming languages at the same time, but it may not be the most efficient approach. It is better to focus on one language at a time and gain a strong understanding of its fundamentals before moving on to another language.

5. Are there any programming languages that are better for specific purposes or industries?

Yes, some programming languages are better suited for specific purposes or industries. For example, web development often uses HTML, CSS, and JavaScript, while data analysis and machine learning may use languages such as R or Python. It is important to research and consider the specific needs of your project or industry when choosing a programming language.

Similar threads

  • Programming and Computer Science
Replies
8
Views
875
  • Programming and Computer Science
Replies
15
Views
1K
  • Programming and Computer Science
12
Replies
397
Views
13K
  • Programming and Computer Science
Replies
16
Views
1K
  • Programming and Computer Science
Replies
11
Views
1K
  • Programming and Computer Science
2
Replies
69
Views
4K
  • Programming and Computer Science
2
Replies
54
Views
3K
  • Programming and Computer Science
Replies
16
Views
2K
  • Programming and Computer Science
Replies
9
Views
1K
  • Programming and Computer Science
Replies
1
Views
726
Back
Top