Why Scientists Should Not Be Allowed To Do Programming

                work2(i,k)= (exp(log(((1.496e-6*((t(i,k))*sqrt(t(i,k)))        &
                            /((t(i,k))+120.)/(den(i,k)))/(8.794e-5             &
                            *exp(log(t(i,k))*(1.81))/p(i,k))))                 &
                            *((.3333333)))/sqrt((1.496e-6*((t(i,k))            &
                            *sqrt(t(i,k)))/((t(i,k))+120.)/(den(i,k))))        &
                            *sqrt(sqrt(den0/(den(i,k)))))
                coeres = rslope2(i,k,2)*sqrt(rslope(i,k,2)*rslopeb(i,k,2))
!               psmlt(i,k) = xka(t(i,k),den(i,k))/xlf*(t0c-t(i,k))*pi/2.       &
!                           *n0sfac(i,k)*(precs1*rslope2(i,k,2)+precs2         &
!                           *work2(i,k)*coeres)
                psmlt(i,k) = (1.414e3*(1.496e-6*((t(i,k))*sqrt(t(i,k)))        &
                            /((t(i,k))+120.)/(den(i,k)) )*(den(i,k)))          &
                            /xlf*(t0c-t(i,k))*pi/2.                            &
                            *n0sfac(i,k)*(precs1*rslope2(i,k,2)+precs2         &
                            *work2(i,k)*coeres)
                psmlt(i,k) = min(max(psmlt(i,k)*dtcld/mstep(i),                &
                            -qrs(i,k,2)/mstep(i)),0.)

About Tony Heller

Just having fun
This entry was posted in Uncategorized. Bookmark the permalink.

25 Responses to Why Scientists Should Not Be Allowed To Do Programming

  1. suyts says:

    lol, what the hell is that?

  2. Paul H says:

    I started to get a little bit confused after seeing the word “work”, but then it always has that effect on me.

  3. Sparks says:

    That can NOT be real code, it completely destroys whatever data is in ‘Log’.

  4. Sparks says:

    It appears to be a secret star chart!! am I joking??

  5. glacierman says:

    It is either to figure out how many angels can dance on the head of a pin, or it is Michael Mann’s code to determine the global average temperature to within 0.01 degree from three strip bark trees in Yamal.

  6. Scarface says:

    Something with a planet in orbit around the sun and IR or photons through a dense atmosphere?

  7. rw says:

    p, t, den, dtcld ? No, this isn’t particularly well-written code.

  8. DirkH says:

    I once had to port a photogrammetric software package from Fortran to C++. Looked similar. I ended up automating the translation with some scripts; just converting the syntax. No way i could have refactored it to look sane. You can call me Harry. 😉

  9. Neil says:

    All those “magic numbers”… maintaining this garbage must almost be a full time job!

  10. Dave N says:

    I’m a programmer by trade.. there’s a term for code like that:

    Maintenance Nightmare

    Most times even the original author will waste too much time working out what it does, especially if they haven’t looked at it for some time.

    • Rattus Norvegicus says:

      It’s not that bad, but there are too many “magic numbers”. Many of the constants should be defined, and it might be helpful to have better variable names if the person reading the code doesn’t know what it is supposed to do, but otherwise, it is not that bad. A complex mathematical calculation is a complex mathematical calculation. Live with it. Breaking it up would actually make it less clear if you know what you are looking at.

      • Sparks says:

        Programming 101:

        Recursion! The general method of solving problems by reducing them to simpler problems, It’s not about making an understood equation more complex, ever! it’s in-fact the opposite. For example the general framework for a recursive solution to a complex program looks like this.

        Solve recursively (problem)
        If the problem is trivial, do the obvious
        Simplify the problem! (D’oh)
        Solve recursively (simpler problem)
        (possibly) combine the solution to the simpler problem(s)
        into a solution of the original problem.

        “Any intelligent fool can make things bigger and more complex…
        It takes a touch of genius – and a lot of courage to move in the opposite direction.”

        “As far as the laws of mathematics refer to reality, they are not certain; and as far as they are certain, they do not refer to reality.”
        Albert Einstein

        Basically, statically complex (even if apparently accurate) ratios are BULL SH1T!!

  11. I recently got involved in an online exchange at Shub Niggurath’s on a (to me) obvious point:

    A computer, as the saying goes, is an ass, i.e. it will only do what asked and will only do it literally. Anybody programming it without the necessary level of expertise is bound to be lead around by the ass.

    In other words, the vast majority of scientific papers based on computer models are very likely to be elegantly-thought garbage.

Leave a Reply

Your email address will not be published. Required fields are marked *