Jump to content

question about languages


Comandante

Recommended Posts

I have an important question and if anyone can give answers or hints it would be great.

 

I'm moderately familiar with vb and I can write a lot of things, and when I can't I go and get some free sources to get me going.. but so far I've had this feeling that vb doesn't have a lot of potential for science-like apps. I will be investing some time into learning a new language in the next 6 months and I want to know what would be the best possible choice to go with considering that I'm intending the skill to be used for science/research. That means working with data, modelling and being able to write apps that would be used to communicate with external instruments and such. I would also be happy that this language doesn't get 'old' after a while so that I have to learn a new one again... I know it's a tough question, but hints would be great :)

Link to comment
Share on other sites

Judging from your avatar I assume you are going into chemistry. Can't help you with that. A few comments, though:

I'm moderately familiar with vb and I can write a lot of things, and when I can't I go and get some free sources to get me going.. but so far I've had this feeling that vb doesn't have a lot of potential for science-like apps.

Basically, all programming languages have pretty much the same potential. It's just that programming and maintaining the code might be more cumbersome. I don't know to what extent vb code can be run on non-Windows machines. Code that can be run on a maximum amount of different systems should imho be a top priotity, especially if you are a Windows user (code running on all common systems except windows is usually quite ok, too - but I'd personally prefer code that also runs on Windows).

 

[...] working with data, ...

Often, data is giving in plain text format. If not, you can write a vb app that converts it accordingly. Working with data is usually done with specialized software. Simple manipulations can often be done with little scripts. From my experience: If you are using Linux&Co, try using scripts as soon as possible. It's not necessary to formally learn the scripting language, though. It's pretty simple.

 

... modelling ...

"Modelling" as in "simulate processes"? Any language can do that. OOP is prefereable for projects involving more than one person. But if you get involved in such a project, you're not likely to be the one that descides which language to use, anyways.

 

and being able to write apps that would be used to communicate with external instruments and such.

I would assume the instruments usually come with their own interfaces or controlling languages. But I'm not an experimentalists, so I cannot say.

 

In particle physics, c++ is the de-facto standard, as far as I can tell. It's probably a good guess for other areas, too. I would recommend learning this over learning c, for that I think writing c (if needed) is not too hard when you already know c++.

 

Most important tip:

I think the best idea for you would be to simply visit a few people (not necessarily the professors, diploma students also/better know what they are using) in your university -preferably people doing stuff that you are interested in- and ask them for advice. If you do, pls post your insights you got from that here - other's might be interested in the results.

Link to comment
Share on other sites

What Atheist said. As someone who spends a lot of time teaching VB to business-oriented IT students, I think that if you're planning a career in science then C++ and Java are better languages to focus on because they're so much more common in scientific fields. VB/C# are fantastic managed-code languages, and managed code is making more inroads in scientific/engineering fields, but it's really more designed for business client-server work. Running reports on monthly sales figures is a very different thing from science/engineering programming.

 

I also think that even Microsoft now sees VB as a dead-end -- they focus on C# and toss new features down to VB a version or two later (usually... maybe...). The main impetus for forward language progress in Microsoft is business-oriented web application development through ASP.NET. The most popular underlying language in ASP historically has been VB, but over the last couple of years there has been an almost total about-face and now all the emphasis is on C#. Coupled with a new, AJAX-driven desire amongst ASP developers to learn Javascript, which uses the same syntax as C#/C++/Java, and it's not hard to understand why VB is falling by the wayside. Of course people have been saying that for years, but the main reasons for its continuance seem to be evaporating rapidly. I wouldn't say that it's gasping for its last breath or anything, but the writing is on the wall.

 

(This may be moot, but just to address something Atheist mentioned, there are VB tools/editors/compilers for non-Windows machines. But Visual Studio is so good that it's worth going to the extra trouble to load Windows environments for. I firmly believe that Visual Studio is the best IDE on the planet, and perhaps Microsoft's best contribution to the field of programming.)

Link to comment
Share on other sites

Fortran / HPF are still major scientific languages as well, although a bitch to work in. C++ is definitely less painful, but may or may not be used depending on what field you work in. For earth and atmospheric science models, Fortran is pretty much the definitive standard.

Link to comment
Share on other sites

C++ or JAVA, I've seen science institutes use java.

 

Which "science institutes" are those? Java, while having a relatively good JIT compiler (HotSpot), is not particularly suited to the heavy math utilized by scientific programs in the same way that languages which compile directly to native code are.

 

By the way, the proper capitalization is "Java", not JAVA or java....

Link to comment
Share on other sites

Which "science institutes" are those? Java, while having a relatively good JIT compiler (HotSpot), is not particularly suited to the heavy math utilized by scientific programs in the same way that languages which compile directly to native code are.

 

Really? How come?

Link to comment
Share on other sites

Great, thanks to all who hinted!

 

Judging from your avatar I assume you are going into chemistry.

 

Well, there abouts I'd say, I'm majoring in chemistry and biomedical (biology) science, though I will have minor in physics as well, so a wide scope of research I might be interested in, hence me asking what would be the best language (one that could aid me in PhD too hopefully :)

 

Most important tip:

I think the best idea for you would be to simply visit a few people (not necessarily the professors, diploma students also/better know what they are using) in your university -preferably people doing stuff that you are interested in- and ask them for advice. If you do, pls post your insights you got from that here - other's might be interested in the results.

 

Thanks! I went from there as well, asked around some physicists/demonstrators and it appears that C++ has got the most points, closely followed by something called MATLAB, I only heard of it once before but apparently its heavily used in 3rd/4th year. Fortran came next I think in a series of suggestions and then there was a few suggestions that Java is good too, though I forgot why exactly...

 

Also, it's not very likely that I'll be working as part of a large team, but possible, more likely is that I'll be working in smaller groups as I intend to work as lecturer/researcher, hence, as far as I'm informed, lecturers work in smaller groups or pairs depending on interest, which is what I find attractive. This reminds me of something funny, as I walked into one lecturer's office few months ago he seemed like having some kind of party in there by himself 'cause he just received an email saying that he received new funding for his research :D

 

Anyway, I'm now trying to gather few more things before I get some C++ books.. namely, what's the difference between C# and C++? Also, is C++ same as Visual C++? Sorry if that sounds noobish I'm not familiar with Microsoft's packages fully.

 

I work in Windows and I have no idea what the future will do with that OS, I just hope I don't have to re-learn everything from scratch should Microsoft go bankrupt or something! I've tried Linux and it tasted good. Felt powerful too. Since its open source I might be considering switching to that, but I really like OSX too, so I hope C++ works in them too..?

 

Many of you mentioned Java too. I have seen Java code embedded into html when I was learning web design a while back, but it looked weak to me, I don't know what kind of potential it has in science.. maybe I just saw half of story :)

 

Let me put it this way too; I'm happy to tackle a hard language as long as it's worth it, and a language that will allow easy switch to other languages should need arise; and I think, judging from the responses, that C++ pretty much fits the description.

Link to comment
Share on other sites

Wohoo, my post got lost. But I can probably make it short:

C++ seems to be a good choice for you. C++ code will work on all relevant OS. For programming c++, download and install an integrated developement enviroment (IDE). Microsoft Visual Studio is supposed to be one of the best IDEs but will probably not work on non-Windows systems. Other possible IDEs are Dev-Cpp (also win-only, I think), Netbeans with c++-plugin (never got it to work myself) and Code::Blocks (the one I currently use for c++). Perhaps google around a bit; there's other good IDEs out there, too.

Link to comment
Share on other sites

Really? How come?

 

HotSpot is great for small tight loops that do the bulk of your data processing, but any time a JIT'd native code segment completes you're essentially guaranteed cache misses when the VM resumes control of the CPU.

 

In something like a complex scientific model that's essentially executing dozens if not hundreds of small transforms, you're essentially going to incur a cache miss each time you switch between transforms, or use the output of one to feed the input of another. Depending on how you structure your program the JVM/HotSpot may be able to do automatic method inlining to mitigate this, but short of hoping for the best with the JVM you really have little control and the only optimization you can do is haphazardly restructuring your program until HotSpot is able to optimize.

 

I'm quite frustratingly having to deal with executing transforms in Java now (in this case variants of the DCT used in video codecs) and having to deal with cache misses preventing our program from working in realtime. Our solution has been a JNI extension and doing all the transforms in native code.

Link to comment
Share on other sites

... closely followed by something called MATLAB, I only heard of it once before but apparently its heavily used in 3rd/4th year.

 

Even though its proprietary, that is my recommendation as the undergraduate language of choice for most hard sciences and engineering (but not for computer science or software engineering majors).

Link to comment
Share on other sites

Even though its proprietary, that is my recommendation as the undergraduate language of choice for most hard sciences and engineering (but not for computer science or software engineering majors).

 

I have issues with matlab, and prefer R, it's more flexible and I don't have to write loops to do things with datasets over a few thousand points long...

 

I'd have much rather my uni taught me R than matlab...

Link to comment
Share on other sites

HotSpot is great for small tight loops that do the bulk of your data processing, but any time a JIT'd native code segment completes you're essentially guaranteed cache misses when the VM resumes control of the CPU.

 

In something like a complex scientific model that's essentially executing dozens if not hundreds of small transforms, you're essentially going to incur a cache miss each time you switch between transforms, or use the output of one to feed the input of another. Depending on how you structure your program the JVM/HotSpot may be able to do automatic method inlining to mitigate this, but short of hoping for the best with the JVM you really have little control and the only optimization you can do is haphazardly restructuring your program until HotSpot is able to optimize.

 

I'm quite frustratingly having to deal with executing transforms in Java now (in this case variants of the DCT used in video codecs) and having to deal with cache misses preventing our program from working in realtime. Our solution has been a JNI extension and doing all the transforms in native code.

 

That was interesting, thanks. :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.