Programing

과학적 환경에서 프로그래밍하는 방법?

lottogame 2020. 9. 1. 07:57
반응형

과학적 환경에서 프로그래밍하는 방법? [닫은]


배경

작년에 저는 대학의 물리학 연구 그룹에서 인턴쉽을했습니다. 이 그룹에서 우리는 주로 LabVIEW사용 하여 설정 제어, 데이터 수집 및 데이터 분석을위한 프로그램을 작성했습니다. 처음 두 가지 목적에 대해서는 꽤 괜찮지 만 데이터 분석에 있어서는 정말 고통 스럽습니다. 게다가 모든 사람이 대부분 독학을했기 때문에 작성된 코드는 일반적으로 상당히 엉망이었습니다 (모든 박사 학위가 모든 것을 처음부터 다시 작성하기로 결정한 것은 당연합니다). 버전 제어는 알려지지 않았으며 IT 부서의 엄격한 소프트웨어 및 네트워크 규정으로 인해 설정할 수 없었습니다.

자, 실제로 모든 것이 놀랍게도 괜찮 았지만 자연 과학 분야의 사람들은 어떻게 소프트웨어를 개발합니까?

질문

몇 가지 구체적인 질문 :

  • 과학 소프트웨어, 특히 데이터 분석을 개발하는 데 어떤 언어 / 환경을 사용 했습니까? 어떤 도서관? (예 : 플로팅에 무엇을 사용합니까?)
  • 프로그래밍에 대한 특별한 배경이없는 사람들을위한 교육이 있었습니까?
  • 버전 관리 및 버그 추적과 같은 것이 있습니까?
  • 개별 과학자들 (특히 물리학 자들은 고집이 센 사람들입니다!)을 너무 많이 방해하지 않고 프로그래밍을위한 적절한 환경을 만들려고 노력하는 방법은 무엇입니까?

지금까지의 답변 요약

지금까지의 답변 (또는 나의 해석) : (2008-10-11)

  • 가장 널리 사용되는 것으로 보이는 언어 / 패키지 :
  • 버전 관리는 거의 모든 응답자가 사용합니다. 버그 추적 및 기타 프로세스는 훨씬 덜 일반적입니다.
  • Software Carpentry 과정은 과학자에게 프로그래밍 및 개발 기술을 가르치는 좋은 방법입니다.
  • 개선하는 방법?
    • 사람들이 엄격한 프로토콜을 따르도록 강요하지 마십시오.
    • 환경을 직접 설정하고 다른 사람들에게 이점을 보여주십시오. 버전 관리, 버그 추적 등을 직접 시작하도록 도와주세요.
    • 다른 사람의 코드를 검토하는 것이 도움이 될 수 있지만 모든 사람이 그것을 고맙게 여기는 것은 아닙니다.

과학 소프트웨어 개발에 사용한 언어 / 환경은 무엇입니까? 데이터 분석? 어떤 도서관? (예 : 플로팅에 무엇을 사용합니까?)

저는 SciPy 의 주요 기업 후원자 인 Enthought 에서 일했습니다 . 우리는 맞춤형 소프트웨어 개발을 위해 Enthought와 계약 한 회사의 과학자들과 협력했습니다. Python / SciPy는 과학자들에게 편안한 환경 인 것 같습니다. 소프트웨어에 대한 배경 지식이없는 과학자라면 C ++ 또는 Java를 사용하는 것보다 시작하는 것이 훨씬 덜 위협적입니다.

Enthought 파이썬 유통은 모든 과학 연산 라이브러리 등, 3 차원 visualation, 음모를 꾸미고, 분석을 포함되어 있습니다

프로그래밍에 대한 특별한 배경이없는 사람들을위한 교육이 있었습니까?

Enthought는 SciPy 교육을 제공 하며 SciPy 커뮤니티는 메일 링리스트에있는 질문에 답하는 데 매우 좋습니다.

버전 관리, 버그 추적과 같은 것이 있습니까?

예, 예 (Subversion 및 Trac). 우리는 과학자들과 (일반적으로 원격으로) 공동으로 작업했기 때문에 버전 관리와 버그 추적이 필수적이었습니다. 일부 과학자들이 버전 제어의 이점을 내재화하도록하려면 약간의 코칭이 필요했습니다.

개별 과학자를 너무 많이 방해하지 않고 프로그래밍을위한 적절한 환경을 만들려고 노력하는 방법은 무엇입니까 (특히 물리학자는 완고한 사람들입니다!)

그들이 도구 체인에 익숙해 있는지 확인하십시오. 선행 투자가 필요하지만 더 친숙한 것 (Excel)에 찬성하여 거부하려는 경향이 줄어 듭니다. 도구가 실패하면 (그리고 그렇게 될 것입니다) 메일 링리스트, 사용자 그룹, 기타 과학자 및 조직의 소프트웨어 개발자와 같은 도움을받을 수있는 장소가 있는지 확인하십시오. 그들이 물리학을 더 잘 수행하도록하는 데 더 많은 도움이 필요합니다.


Software Carpentry 과정 은 특히 ​​과학 컴퓨팅을 수행하는 사람들을 대상으로하며 소프트웨어 엔지니어링의 기본과 교훈을 가르치고이를 프로젝트에 가장 잘 적용하는 방법을 가르치는 것을 목표로합니다.

버전 제어, 디버깅, 테스트, 스크립팅 및 기타 다양한 문제와 같은 주제를 다룹니다.

8 ~ 9 개의 강의를 들어 봤는데 적극 추천 할 만하다고 생각합니다.

편집 : 강의의 MP3도 사용할 수 있습니다.


여기 핵 / 입자 물리학.

  • 주요 프로그래밍 작업은 주로 CERNLIB (PAW, MINUIT, ...) 및 GEANT3를 사용하여 Fortran 에서 수행되었지만 최근에는 ROOTGeant4를 사용 하여 대부분 C ++로 수행되었습니다 . 특수 용도로 사용되는 다른 많은 라이브러리와 도구가 있으며 LabVIEW 는 여기 저기에서 일부 사용을보고 있습니다.
  • 이 사업에서 데이터 수집은 종종 상당히 낮은 수준의 작업을 의미했습니다. 종종 C에서, 때로는 심지어 어셈블리에서도 그러나 하드웨어가 더 많은 능력을 가지면서 사라지고 있습니다. 반면에 많은 보드는 이제 게이트 트위들 링이 필요한 FPGA로 구축되었습니다 .
  • 일회성, 그래픽 인터페이스 등 은 대부분 입자 물리학 커뮤니티 내부에 존재하는 여러 패키지를 포함하여 거의 모든 것을 사용합니다 ( 예전에는 Tcl / Tk 가 크며 최근에 더 많은 Perl / Tk 및 Python / Tk를 보았습니다). .
  • 코드를 작성하는 많은 사람들은 공식적인 교육이 거의 없거나 전혀 없으며, 프로세스는 구전 전통에 따라 매우 고르지 않게 전달되지만 대부분의 소프트웨어 그룹 리더는 프로세스를 진지하게 받아들이고이 영역의 결함을 보완하기 위해 필요한만큼 읽습니다.
  • 주요 도구에 대한 버전 제어는 어디에나 있습니다. 그러나 많은 개별 프로그래머는 작은 작업 때문에이를 무시합니다. 정식 버그 추적 도구는 야간 빌드, 단위 테스트 및 회귀 테스트와 마찬가지로 덜 일반적입니다.

개선하려면 :

  1. 지역 소프트웨어 리더의 좋은면을 얻으십시오.
  2. 자신의 영역에서 사용하려는 프로세스를 구현하고 허용 한 사람들도 사용하도록 권장하십시오.
  3. 기다림. 물리학 자들은 경험적인 사람들입니다. 도움이된다면 (결국!) 알아 차릴 것입니다.

개선을위한 한 가지 더 제안.

  1. 직접 함께 일하는 사람을 돕는 데 약간의 시간을 투자하십시오. 그들의 코드를 검토하십시오. 그들에게 알고리즘 복잡성 / 코드 생성 / DRY 또는 어떤 교수가 Fortran 책을 한 번 던지고 "작동 시키십시오"라고 말했기 때문에 그들이 배운 적이없는 기본적인 것에 대해 이야기하십시오. 프로세스 문제에 대해 교육하십시오. 그들은 똑똑한 사람들이고 기회를 주면 배울 것입니다.

이것은 약간 접선적일 수 있지만 관련성이 있기를 바랍니다.

저는 NI RF 및 통신 툴킷 용 소프트웨어를 작성한 National Instruments, R & D에서 일했습니다. 우리는 LabVIEW를 꽤 많이 사용했으며 다음과 같은 방법을 따랐습니다.

  1. 소스 제어. NI는 Perforce를 사용합니다. 우리는 개발 / 트렁크 브랜치, 지속적인 통합, 작업 등 일반적인 작업을 수행했습니다.
  2. 우리는 자동화 된 테스트 스위트를 작성했습니다.
  3. 우리는 신호 처리 및 통신에 대한 배경 지식을 가진 몇 명의 사람들이있었습니다. 우리는 정기적 인 코드 검토와 모범 사례 문서를 통해 코드가 기준에 부합하는지 확인했습니다.
  4. 코드 검토에도 불구하고 저와 같은 "소프트웨어 전문가"가 효율성을 위해이 코드의 일부를 다시 작성해야하는 경우가있었습니다.
  5. 완고한 사람들에 대해 당신이 무엇을 의미하는지 정확히 알고 있습니다! 우리는 코드에서 잠재적 인 성능 향상을 지적하는 것이 직접적인 개인적 모욕이라고 생각했던 사람들이있었습니다! 이것이 좋은 관리를 요구한다는 것은 말할 필요도 없습니다. 나는 이러한 사람들을 다루는 가장 좋은 방법은 변화를 위해 강하게 압박하지 않고, 필요하다면 더러운 일을 할 준비를하는 것이 아니라 천천히가는 것이라고 생각했습니다. [예 : 코드에 대한 테스트 스위트 작성].

나는 정확히 '자연적인'과학자는 아니지만 (나는 교통을 연구한다) 데이터 분석을 위해 내 자신의 소프트웨어를 많이 작성하는 학자이다. 저는 파이썬으로 최대한 많이 작성하려고 노력하지만, 기존 소프트웨어 도구를 확장하거나 사용자 정의 할 때 다른 언어를 사용해야하는 경우가 있습니다. 내 분야에는 프로그래밍 교육이 거의 없습니다. 대부분의 사람들은 독학이거나 이전에 듣거나학과 밖에서 수강 한 수업에서 프로그래밍 기술을 배웠습니다.

저는 버전 관리의 열렬한 팬입니다. 논문의 모든 코드에 대해 홈 서버에서 실행되는 Vault를 사용했습니다. 지금은 부서에 Subversion 서버를 설정하도록 노력하고 있지만 적어도 처음에는이 서버를 사용하는 유일한 사람이 제 생각입니다. 나는 FogBugs를 약간 가지고 놀았지만 버전 관리와 달리 1 인 팀에게는 거의 유용하지 않다고 생각합니다.

다른 사람들이 버전 제어 등을 사용하도록 장려하는 것은 지금 제가 직면 한 문제입니다. 저는 대학원생들에게 그들이 저를 위해하고있는 연구 프로젝트에 그것을 사용하도록 강요하고 그들 자신의 연구에 그것을 사용하도록 장려 할 계획입니다. 프로그래밍과 관련된 수업을 가르치면 아마도 학생들에게 버전 제어를 사용하도록 강요 할 것입니다 (저장소에있는 것에 대해 등급을 매김). 동료들과 대학원생이가는 한, 제가 할 수있는 일은 서버를 사용할 수있게하고 부드러운 설득과 좋은 모범에 의존하는 것뿐입니다. 솔직히,이 시점에서 나는 그들이 소스를 제어하는 ​​것보다 정기적 인 백업을하는 것이 더 중요하다고 생각합니다 (일부 사람들은 그들의 연구 데이터의 유일한 사본을 USB 플래시 드라이브에 가지고 다니고 있습니다).


1.) 스크립팅 언어는 더 나은 하드웨어로 인해 요즘 대부분의 경우 인기가 있습니다. Perl / Python / Lisp는 경량 애플리케이션 (자동화, 가벼운 계산)에 널리 사용됩니다. 저는 Unix / Linux를 좋아하기 때문에 제 작업 (컴퓨터 EM)에서 Perl을 많이 봅니다. 성능 문제의 경우 일반적으로 C / C ++ / Fortran이 사용됩니다. 병렬 컴퓨팅의 경우 일반적으로 프로그램이 암시 적으로 수행하는 것과 달리 EM에서 실행을 수동으로 병렬화합니다 (예 : 레이더 단면을 계산할 때보기 각도별로 작업을 분할).

2.) 우리는 사람들을 여기에 섞어 놓습니다. 우리가 가지고있는 많은 코드는 매우 지저분하지만 과학자들은 일반적으로 그런 종류의 것을 신경 쓰지 않는 산발적 인 무리입니다. 이상적이지는 않지만 우리는 제공 할 것이 있고 직원이 심각하게 부족합니다. 우리는 천천히 나아지고 있습니다.

3.) 우리는 SVN을 사용합니다. 그러나 버그 추적 소프트웨어는 없습니다. 버그 특정 버그가 어디에 있는지 알려주는 txt 파일이 우리에게 좋은 것입니다.

4.) 과학자를위한 모범 사례를 구현하기위한 나의 제안 : 천천히하십시오 . 과학자로서 우리는 일반적으로 제품을 배송하지 않습니다. 과학계의 어느 누구도 깨끗하고 유지 보수가 가능한 코드를 가지고 자신의 이름을지었습니다 . 일반적으로 해당 코드의 결과에서 인식을 얻습니다. 그들은 소프트웨어 관행을 배우는 데 시간을 할애하는 것에 대한 정당성을 볼 필요가 있습니다. 새로운 개념을 천천히 소개하고 따르도록 노력하십시오. 그들은 과학자이기 때문에 자신의 경험적 증거가 버전 관리와 같은 것의 유용성을 확인한 후에 항상 그것을 사용하기 시작할 것입니다!


I'd highly recommend reading "What Every Computer Scientist Should Know About Floating-Point Arithmetic". A lot of problems I encounter on a regular basis come from issues with floating point programming.


I am a physicist working in the field of condensed matter physics, building classical and quantum models.

Languages:

  • C++ -- very versatile: can be used for anything, good speed, but it can be a bit inconvenient when it comes to MPI
  • Octave -- good for some supplementary calculations, very convenient and productive

Libraries:

  • Armadillo/Blitz++ -- fast array/matrix/cube abstractions for C++
  • Eigen/Armadillo -- linear algebra
  • GSL -- to use with C
  • LAPACK/BLAS/ATLAS -- extremely big and fast, but less convenient (and written in FORTRAN)

Graphics:

  • GNUPlot -- it has very clean and neat output, but not that productive sometimes
  • Origin -- very convenient for plotting

Development tools:

  • Vim + plugins -- it works great for me
  • GDB -- a great debugging tool when working with C/C++
  • Code::Blocks -- I used it for some time and found it quite comfortable, but Vim is still better in my opinion.

I work as a physicist in a UK university.

Perhaps I should emphasise that different areas of research have different emphasis on programming. Particle physicists (like dmckee) do computational modelling almost exclusively and may collaborate on large software projects, whereas people in fields like my own (condensed matter) write code relatively infrequently. I suspect most scientists fall into the latter camp. I would say coding skills are usually seen as useful in physics, but not essential, much like physics/maths skills are seen as useful for programmers but not essential. With this in mind...

  • What languages/environments have you used for developing scientific software, esp. data analysis? What libraries? (E.g., what do you use for plotting?)

Commonly data analysis and plotting is done using generic data analysis packages such as IGOR Pro, ORIGIN, Kaleidegraph which can be thought of as 'Excel plus'. These packages typically have a scripting language that can be used to automate. More specialist analysis may have a dedicated utility for the job that generally will have been written a long time ago, no-one has the source for and is pretty buggy. Some more techie types might use the languages that have been mentioned (Python, R, MatLab with Gnuplot for plotting).

Control software is commonly done in LabVIEW, although we actually use Delphi which is somewhat unusual.

  • Was there any training for people without any significant background in programming?

I've been to seminars on grid computing, 3D visualisation, learning Boost etc. given by both universities I've been at. As an undergraduate we were taught VBA for Excel and MatLab but C/MatLab/LabVIEW is more common.

  • Did you have anything like version control, bug tracking?

No, although people do have personal development setups. Our code base is in a shared folder on a 'server' which is kept current with a synching tool.

  • How would you go about trying to create a decent environment for programming, without getting too much in the way of the individual scientists (esp. physicists are stubborn people!)

One step at a time! I am trying to replace the shared folder with something a bit more solid, perhaps finding a SVN client which mimics the current synching tools behaviour would help.

I'd say though on the whole, for most natural science projects, time is generally better spent doing research!


Ex-academic physicist and now industrial physicist UK here:

What languages/environments have you used for developing scientific software, esp. data analysis? What libraries? (E.g., what do you use for plotting?)

I mainly use MATLAB these days (easy to access visualisation functions and maths). I used to use Fortran a lot and IDL. I have used C (but I'm more a reader than a writer of C), Excel macros (ugly and confusing). I'm currently needing to be able to read Java and C++ (but I can't really program in them) and I've hacked Python as well. For my own entertainment I'm now doing some programming in C# (mainly to get portability / low cost / pretty interfaces). I can write Fortran with pretty much any language I'm presented with ;-)

Was there any training for people without any significant background in programming?

Most (all?) undergraduate physics course will have a small programming course usually on C, Fortran or MATLAB but it's the real basics. I'd really like to have had some training in software engineering at some point (revision control / testing / designing medium scale systems)

Did you have anything like version control, bug tracking?

I started using Subversion / TortoiseSVN relatively recently. Groups I've worked with in the past have used revision control. I don't know any academic group which uses formal bug tracking software. I still don't use any sort of systematic testing.

How would you go about trying to create a decent environment for programming, without getting too much in the way of the individual scientists (esp. physicists are stubborn people!)

I would try to introduce some software engineering ideas at undergraduate level and then reinforce them by practice at graduate level, also provide pointers to resources like the Software Carpentry course mentioned above.

I'd expect that a significant fraction of academic physicists will be writing software (not necessarily all though) and they are in dire need of at least an introduction to ideas in software engineering.


What languages/environments have you used for developing scientific software, esp. data analysis? What libraries? (E.g., what do you use for plotting?)

Python, NumPy and pylab (plotting).

Was there any training for people without any significant background in programming?

No, but I was working in a multimedia research lab, so almost everybody had a computer science background.

Did you have anything like version control, bug tracking?

Yes, Subversion for version control, Trac for bug tracing and wiki. You can get free bug tracker/version control hosting from http://www.assembla.com/ if their TOS fits your project.

How would you go about trying to create a decent environment for programming, without getting too much in the way of the individual scientists (esp. physicists are stubborn people!).

Make sure the infrastructure is set up and well maintained and try to sell the benefits of source control.


I'm a statistician at a university in the UK. Generally people here use R for data analysis, it's fairly easy to learn if you know C/Perl. Its real power is in the way you can import and modify data interactively. It's very easy to take a number of say CSV (or Excel) files and merge them, create new columns based on others and then throw that into a GLM, GAM or some other model. Plotting is trivial too and doesn't require knowledge of a whole new language (like PGPLOT or GNUPLOT.) Of course, you also have the advantage of having a bunch of built-in features (from simple things like mean, standard deviation etc all the way to neural networks, splines and GL plotting.)

Having said this, there are a couple of issues. With very large datasets R can become very slow (I've only really seen this with >50,000x30 datasets) and since it's interpreted you don't get the advantage of Fortran/C in this respect. But, you can (very easily) get R to call C and Fortran shared libraries (either from something like netlib or ones you've written yourself.) So, a usual workflow would be to:

  • Work out what to do.
  • Prototype the code in R.
  • Run some preliminary analyses.
  • Re-write the slow code into C or Fortran and call that from R.

Which works very well for me.

I'm one of the only people in my department (of >100 people) using version control (in my case using git with githuib.com.) This is rather worrying, but they just don't seem to be keen on trying it out and are content with passing zip files around (yuck.)

My suggestion would be to continue using LabView for the acquisition (and perhaps trying to get your co-workers to agree on a toolset for acquisition and making is available for all) and then move to exporting the data into a CSV (or similar) and doing the analysis in R. There's really very little point in re-inventing the wheel in this respect.


What languages/environments have you used for developing scientific software, esp. data analysis? What libraries? (E.g., what do you use for plotting?)

My undergraduate physics department taught LabVIEW classes and used it extensively in its research projects.

The other alternative is MATLAB, in which I have no experience. There are camps for either product; each has its own advantages/disadvantages. Depending on what kind of problems you need to solve, one package may be more preferable than the other.

Regarding data analysis, you can use whatever kind of number cruncher you want. Ideally, you can do the hard calculations in language X and format the output to plot nicely in Excel, Mathcad, Mathematica, or whatever the flavor du jour plotting system is. Don't expect standardization here.

Did you have anything like version control, bug tracking?

Looking back, we didn't, and it would have been easier for us all if we did. Nothing like breaking everything and struggling for hours to fix it!

Definitely use source control for any common code. Encourage individuals to write their code in a manner that could be made more generic. This is really just coding best practices. Really, you should have them teaching (or taking) a computer science class so they can get the basics.

How would you go about trying to create a decent environment for programming, without getting too much in the way of the individual scientists (esp. physicists are stubborn people!)

There is a clear split between data aquisition (DAQ) and data analysis. Meaning, it's possible to standardize on the DAQ and then allow the scientists to play with the data in the program of their choice.


Another good option is Scilab. It has graphic modules à la LabVIEW, it has its own programming language and you can also embed Fortran and C code, for example. It's being used in public and private sectors, including big industrial companies. And it's free.

About versioning, some prefer Mercurial, as it gives more liberties managing and defining the repositories. I have no experience with it, however.

For plotting I use Matplotlib. I will soon have to make animations, and I've seen good results using MEncoder. Here is an example including an audio track.

Finally, I suggest going modular, this is, trying to keep main pieces of code in different files, so code revision, understanding, maintenance and improvement will be easier. I have written, for example, a Python module for file integrity testing, another for image processing sequences, etc.

You should also consider developing with the use a debugger that allows you to check variable contents at settable breakpoints in the code, instead using print lines. I have used Eclipse for Python and Fortran developing (although I got a false bug compiling a Fortran short program with it, but it may have been a bad configuration) and I'm starting to use the Eric IDE for Python. It allows you to debug, manage versioning with SVN, it has an embedded console, it can do refactoring with Bicycle Repair Man (it can use another one, too), you have Unittest, etc. A lighter alternative for Python is IDLE, included with Python since version 2.3.

As a few hints, I also suggest:

  • Not using single-character variables. When you want to search appearances, you will get results everywhere. Some argue that a decent IDE makes this easier, but then you will depend on having permanent access to the IDE. Even using ii, jj and kk can be enough, although this choice will depend on your language. (Double vowels would be less useful if code comments are made in Estonian, for instance).

  • Commenting the code from the very beginning.

  • For critical applications sometimes it's better to rely on older language/compiler versions (major releases), more stable and better debugged. Of course you can have more optimized code in later versions, fixed bugs, etc, but I'm talking about using Fortran 95 instead of 2003, Python 2.5.4 instead of 3.0, or so. (Specially when a new version breaks backwards compatibility.) Lots of improvements usually introduce lots of bugs. Still, this will depend on specific application cases! Note that this is a personal choice, many people could argue against this.

  • Use redundant and automated backup! (With versioning control).


Definitely, use Subversion to keep current, work-in-progress, and stable snapshot copies of source code. This includes C++, Java etc. for homegrown software tools, and quickie scripts for one-off processing.

With the strong leaning in science and applied engineering toward "lone cowboy" development methodology, the usual practice of organizing the repository into trunk, tag and whatever else it was - don't bother! Scientists and their lab technicians like to twirl knobs, wiggle electrodes and chase vacuum leaks. It's enough of a job to get everyone to agree to, say Python/NumPy or follow some naming convention; forget trying to make them follow arcane software developer practices and conventions.


For source code management, centralized systems such as Subversion are superior for scientific use due to the clear single point of truth (SPOT). Logging of changes and ability to recall versions of any file, without having chase down where to find something, has huge record-keeping advantages. Tools like Git and Monotone: oh my gosh the chaos I can imagine that would follow! Having clear-cut records of just what version of hack-job scripts were used while toying with the new sensor when that Higgs boson went by or that supernova blew up, will lead to happiness.


What languages/environments have you used for developing scientific software, esp. data analysis? What libraries? (E.g., what do you use for plotting?)

Languages I have used for numerics and sicentific-related stuff:

  • C (slow development, too much debugging, almost impossible to write reusable code)
  • C++ (and I learned to hate it -- development isn't as slow as C, but can be a pain. Templates and classes were cool initially, but after a while I realized that I was fighting them all the time and finding workarounds for language design problems
  • Common Lisp, which was OK, but not widely used fo Sci computing. Not easy to integrate with C (if compared to other languages), but works
  • Scheme. This one became my personal choice.

My editor is Emacs, although I do use vim for quick stuff like editing configuration files.

For plotting, I usually generate a text file and feed it into gnuplot.

For data analysis, I usually generate a text file and use GNU R.

I see lots of people here using FORTRAN (mostly 77, but some 90), lots of Java and some Python. I don't like those, so I don't use them.

Was there any training for people without any significant background in programming?

I think this doesn't apply to me, since I graduated in CS -- but where I work there is no formal training, but people (Engineers, Physicists, Mathematicians) do help each other.

Did you have anything like version control, bug tracking?

Version control is absolutely important! I keep my code and data in three different machines, in two different sides of the world -- in Git repositories. I sync them all the time (so I have version control and backups!) I don't do bug control, although I may start doing that. But my colleagues don't BTS or VCS at all.

How would you go about trying to create a decent environment for programming, without getting too much in the way of the individual scientists (esp. physicists are stubborn people!)

First, I'd give them as much freedom as possible. (In the University where I work I could chooe between having someone install Ubuntu or Windows, or install my own OS -- I chose to install my own. I don't have support from them and I'm responsible for anything that happens with my machins, including security issues, but I do whatever I want with the machine).

Second, I'd see what they are used to, and make it work (need FORTRAN? We'll set it up. Need C++? No problem. Mathematica? OK, we'll buy a license). Then see how many of them would like to learn "additional tools" to help them be more productive (don't say "different" tools. Say "additional", so it won't seem like anyone will "lose" or "let go" or whatever). Start with editors, see if there are groups who would like to use VCS to sync their work (hey, you can stay home and send your code through SVN or GIT -- wouldn't that be great?) and so on. Don't impose -- show examples of how cool these tools are. Make data analysis using R, and show them how easy it was. Show nice graphics, and explain how you've created them (but start with simple examples, so you can quickly explain them).


I would suggest F# as a potential candidate for performing science-related manipulations given its strong semantic ties to mathematical constructs.

Also, its support for units-of-measure, as written about here makes a lot of sense for ensuring proper translation between mathematical model and implementation source code.


First of all, I would definitely go with a scripting language to avoid having to explain a lot of extra things (for example manual memory management is - mostly - ok if you are writing low-level, performance sensitive stuff, but for somebody who just wants to use a computer as an upgraded scientific calculator it's definitely overkill). Also, look around if there is something specific for your domain (as is R for statistics). This has the advantage of already working with the concepts the users are familiar with and having specialized code for specific situations (for example calculating standard deviations, applying statistical tests, etc in the case of R).

If you wish to use a more generic scripting language, I would go with Python. Two things it has going for it are:

  • The interactive shell where you can experiment
  • Its clear (although sometimes lengthy) syntax

As an added advantage, it has libraries for most of the things you would want to do with it.


I'm no expert in this area, but I've always understood that this is what MATLAB was created for. There is a way to integrate MATLAB with SVN for source control as well.

참고URL : https://stackoverflow.com/questions/38239/practices-for-programming-in-a-scientific-environment

반응형