code comment hilarity

IRIX/Nekoware development, porting and related topics.
Forum rules
Any posts concerning pirated software or offering to buy/sell/trade commercial software are subject to removal.
User avatar
vishnu
Donor
Donor
Posts: 3174
Joined: Sun Mar 18, 2007 3:25 pm
Location: Minneapolis, Minnesota USA

code comment hilarity

Unread postby vishnu » Sun Feb 14, 2016 11:00 pm

So we use the Nato Reference Mobility Model in our vehicle simulator, I was hacking on it the other day and noticed something one of our Ph.D physicists wrote; thought it was a hoot:
Attachments
screamr3.png
Project:
Temporarily lost at sea...
Plan:
World domination! Or something...

:Tezro: :Octane2:

User avatar
dexter1
Moderator
Moderator
Posts: 2735
Joined: Thu Feb 20, 2003 6:57 am
Location: Zoetermeer, The Netherlands

Re: code comment hilarity

Unread postby dexter1 » Sun Feb 14, 2016 11:30 pm

He was paid per hour, since all he typed was "39.37" (=100/2.54) over and over again :) lrn2macro, sheesh.
Any chance this is not copyrighted to put it on the dailywtf?
:Crimson: :PI: :Indigo: :O2: :Indy: :Indigo2: :Indigo2IMP:

User avatar
vishnu
Donor
Donor
Posts: 3174
Joined: Sun Mar 18, 2007 3:25 pm
Location: Minneapolis, Minnesota USA

Re: code comment hilarity

Unread postby vishnu » Sun Feb 14, 2016 11:37 pm

Well, but he's a physicist not a coder I'm pretty sure he doesn't know anything about the preprocessor. The code is copyrighted but this little snippet is free and clear for "fair use" wherever you'd like. The code is patented so the whole thing is totally "out there" compared to this tiny snapshot. 8-)
Project:
Temporarily lost at sea...
Plan:
World domination! Or something...

:Tezro: :Octane2:

User avatar
dexter1
Moderator
Moderator
Posts: 2735
Joined: Thu Feb 20, 2003 6:57 am
Location: Zoetermeer, The Netherlands

Re: code comment hilarity

Unread postby dexter1 » Mon Feb 15, 2016 12:48 pm

Oh that explains, physicists (and beta scientists in general) are such a bunch of cowboys when it comes to hacking code...

Second glance at that code makes me think that nrmm2sub_ is a fortran routine since all arguments are pointers. Figures, since if it's mititary stuff chances are good that it is so ancient it could have been coded on a VAX or something similar.

Third glance made me realize i'm getting older :(
:Crimson: :PI: :Indigo: :O2: :Indy: :Indigo2: :Indigo2IMP:

User avatar
vishnu
Donor
Donor
Posts: 3174
Joined: Sun Mar 18, 2007 3:25 pm
Location: Minneapolis, Minnesota USA

Re: code comment hilarity

Unread postby vishnu » Mon Feb 15, 2016 2:07 pm

Yep NRMM is fortran, this particular Ph.D is a fortran whiz who only learned enough C++ to to call his fortran functions from the vehicle model, which we originally wrote in C. When we converted it to C++ I went through and converted all the #defines to consts, and of course you're right he should have used const float INCH = 39.37 and stuck it in the header file. Actually there are horrible amounts of code duplication everywhere. Apparently that's what you get when scientists write a million lines of code before they let a software engineer take a look at it... :lol:
Project:
Temporarily lost at sea...
Plan:
World domination! Or something...

:Tezro: :Octane2:

User avatar
R-ten-K
Posts: 1889
Joined: Mon Nov 15, 2004 10:36 pm
Location: Nor Cal

Re: code comment hilarity

Unread postby R-ten-K » Tue Feb 16, 2016 11:26 am

I imagine there is a forum, somewhere else, where physicists and mathematicians put up equations written by software "engineers" to laugh out loud at them.
"Was it a dream where you see yourself standing in sort of sun-god robes on a
pyramid with thousand naked women screaming and throwing little pickles at you?"

User avatar
Trippynet
Donor
Donor
Posts: 783
Joined: Thu Aug 15, 2013 6:22 am
Location: Aberdeen, Scotland, UK

Re: code comment hilarity

Unread postby Trippynet » Tue Feb 16, 2016 12:28 pm

Well, amongst thousands of other anecdotes, there is a whole section of programming stupidities here: http://www.rinkworks.com/stupid/
Systems in use:
:Indigo2IMP: - Nitrogen: R10000 195MHz CPU, 384MB RAM, SolidIMPACT Graphics, 36GB 15k HDD & 300GB 10k HDD, 100Mb/s NIC, New/quiet fans, IRIX 6.5.22
:Fuel: - Lithium: R14000 600MHz CPU, 4GB RAM, V10 Graphics, 72GB 15k HDD & 300GB 10k HDD, 1Gb/s NIC, New/quiet fans, IRIX 6.5.30
Other system in storage: :O2: R5000 200MHz, 224MB RAM, 72GB 15k HDD, PSU fan mod, IRIX 6.5.30

robespierre
Posts: 1551
Joined: Mon Sep 12, 2011 2:28 pm
Location: Boston

Re: code comment hilarity

Unread postby robespierre » Tue Feb 16, 2016 1:13 pm

It could be argued that much of mathematics is not particularly important for programmers, although I am frequently amazed at how little number theory many of them know. For instance, a problem like "calculate the sum of the multiples of either 3 or 5 less than 1000" will always be written as a loop (or, if you're really smart, a list comprehension), even though that quantity has a closed form. One programmer was very proud to have written a solution in terms of a Horn Clause solver; it can be calculated rather easier on the back of a cocktail napkin.
Last edited by robespierre on Tue Feb 16, 2016 1:18 pm, edited 1 time in total.
:PI: :O2: :Indigo2IMP: :Indigo2IMP:

User avatar
uunix
Donor
Donor
Posts: 1793
Joined: Sun Mar 27, 2011 12:48 pm
Location: Stourbridge / England / UK

Re: code comment hilarity

Unread postby uunix » Tue Feb 16, 2016 1:16 pm

Trippynet wrote:Well, amongst thousands of other anecdotes, there is a whole section of programming stupidities here: http://www.rinkworks.com/stupid/

That site is quite funny, even though I have to travel back in time for a lot of them. :lol:
-----------------------------------------------------------------------
Hey Ho! Pip & Dandy!
:Octane2: :O2: :Indigo: :Indy:
-----------------------------------------------------------------------

Rhodamine
Posts: 69
Joined: Sun Aug 09, 2015 2:37 pm
Location: Bristol, UK

Re: code comment hilarity

Unread postby Rhodamine » Fri Feb 19, 2016 10:49 pm

I'm a physicist with 30+ years experience coding. Mostly fortran77, various forms of basic and the last decade a language called IDL, but no formal teaching in coding. Just self taught starting with commodore basic on the VIC20.

I recently asked a software engineer friend to streamline some code at work, had been cobbled together over 8 years with various authors and constantly changing requirements. The code that came back worked fine, but I couldn't understand any if it, was all pointers and objects.... Not scientist friendly :)

Regards, Adam
:Onyx2: :Octane: :Indigo: :Indigo: :Indigo: :Indigo2: :Indigo2IMP: :Indy:

User avatar
vishnu
Donor
Donor
Posts: 3174
Joined: Sun Mar 18, 2007 3:25 pm
Location: Minneapolis, Minnesota USA

Re: code comment hilarity

Unread postby vishnu » Sat Feb 20, 2016 11:53 am

We bought some code from Georgia Tech, a 6DOF written in fortran entirely by one guy, one of their aerospace professors, we tried to build it with gcc's fortran compiler and got like 25,000 warnings and errors. So naturally we asked them what they used to compile it, turns out it was a 20 year old version of Microsoft's fortran compiler. Now, I'm not unused to the phenomenon of bitrot due to compiler improvements, but 25,000 warnings and errors? Our department manager wanted to scrap it but our Ph.D fortran whiz fixed the code himself, which is to say he fixed it without referring back to anyone at Georgia Tech. He assures us it still runs the same... :lol:
Project:
Temporarily lost at sea...
Plan:
World domination! Or something...

:Tezro: :Octane2:

User avatar
pentium
Posts: 4728
Joined: Mon Aug 28, 2006 6:29 pm
Location: Kamloops, BC

Re: code comment hilarity

Unread postby pentium » Mon Feb 22, 2016 9:56 am

Having run through the leaked Irix source code with grep I've found a few funny comments hidden away. Suprisingly they refrained from using the f-bomb.
:Crimson: :Onyx: :O2000: :O200: :O200: :PI: :PI: :Indigo: :Indigo: :Indigo: :Octane: :O2: :1600SW: :Indigo2: :Indigo2: :Indigo2IMP: :Indigo2IMP: :Indy: :Indy: :Indy: :Cube:

Image <-------- A very happy forum member.

User avatar
vishnu
Donor
Donor
Posts: 3174
Joined: Sun Mar 18, 2007 3:25 pm
Location: Minneapolis, Minnesota USA

Re: code comment hilarity

Unread postby vishnu » Sat Feb 27, 2016 2:17 am

Just checked the mozilla codebase; they did not refrain from using the f-bomb, 27 times in 11 files, though most of it seems to be related to spell checking. Gotta wonder who felt it was important to make sure people weren't misspelling such permutations as fuck, fucker, fuckhead, motherfucker and motherfucking... :shock:
Project:
Temporarily lost at sea...
Plan:
World domination! Or something...

:Tezro: :Octane2:

User avatar
skywriter
Posts: 3290
Joined: Fri Mar 14, 2003 5:22 am
Location: Trump-proof bunker
Contact:

Re: code comment hilarity

Unread postby skywriter » Sat Mar 05, 2016 5:29 pm

R-ten-K wrote:I imagine there is a forum, somewhere else, where physicists and mathematicians put up equations written by software "engineers" to laugh out loud at them.


LOL! Ain't it the truth :-)
:Skywriter:

DECUS Member 368596

mopar5150
Posts: 548
Joined: Tue Apr 24, 2012 6:02 pm
Location: Palm Springs, CA
Contact:

Re: code comment hilarity

Unread postby mopar5150 » Thu Mar 17, 2016 3:54 pm

R-ten-K wrote:I imagine there is a forum, somewhere else, where physicists and mathematicians put up equations written by software "engineers" to laugh out loud at them.



That is funny right there!
If the thing isn't on fire it's a software problem.

:Tezro: :O3x0: :A350:


Return to “SGI: Development”

Who is online

Users browsing this forum: No registered users and 3 guests