When did writing scripts become "off topic" for the CCP4BB!?


Personally, I use awk for most text-processing tasks, and since I have found that ~95% of science is converting information from one file format into another, I tend to use awk a lot.

The "k" in awk stands for Kernighan, one of the authors of "C", so the syntax is very similar. Strange to me how one of the first things you hear about any "great new language" in the last 20 years has been "it has a C-like syntax". Anyway, the main differences between awk and C is that the reading in and parsing of a text file line-by-line is implicit, as are variable types. That is, strings and numbers inter-convert automatically, depending on how you use them. A very short intro to awk (and the only one I have ever read) is here:
http://bl831.als.lbl.gov/~jamesh/pickup/awk.pdf
plus my own personal "tips & tricks" for using awk in crystallography:
http://bl831.als.lbl.gov/~jamesh/elves/manual/tricks.html#awk
and here is an awk program I wrote for taking apart a PDB file and then putting it back together:
http://bl831.als.lbl.gov/~jamesh/pickup/reformatpdb.awk
the last may be a bit "advanced" at first, but if you find yourself regularly doing weird things to PDBs that are not standard features of programs you already have like PDBSET or phenix.pdbtools, then it may be a good place to start.

That said, I should warn you that the "what is the best language" question is a sure-fire way to start a flame war. Pretty much everyone you talk to who has done even a little programming will have a "favorite language" that they will defend as emphatically and energetically as they disparage every other language. The reason for this is a sad truth: learning a language is work, and people tend to protect their investments. This is just as true for computer languages as it is for "regular" languages, and although we have things like "Rosetta Stone" and "Hello World", nothing is ever going to change the fact that communicating complex ideas (be it to a machine or to a human) requires learning a complex language. So, when you find that someone is unusually "pushy" about their favorite language: be afraid. The language may be dying, and they must have invested a tremendous amount of time and effort learning it if they are so desperate for you to join their ranks.

Oh, and don't fall for the "so other people can read your code" trick. Trust me, NOBODY wants to read your code! Unless, of course, they are trying to re-write it in their favorite language.

-James Holton
MAD Scientist

On 1/23/2012 8:46 PM, Yuri Pompeu wrote:
Hello Everyone,
I want to play around with some coding/programming. Just simple calculations 
from an input PDB file, B factors averages, occupancies, molecular weight, so 
forth...
What should I use python,C++, visual basic?
thanks

Reply via email to