IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Programming language VS mind of coder
I was thinking about some really tight pressure
project I'm working on, and my turnaroud time for
requests.

Boss says, I review, I code, I produce report (lots
of big file grindthrough to figure crap out), we
validate the numbers might be sane, we throw to
client, he questions stuff, we do it again.

Boss to report is anywhere from 10 minutes to
2 hours.

Mind to code is usually less than 2 minutes, with
file wrapper, reporting, etc, another 5 to 10 minutes.

Sanity checking is most of the time.

Ok, so I write in Perl, it's the one I'm most productive
with (at least for this non-visual type of work), and
I know that if I think of something, I can have working
prototype in a very quick amount of time. Far faster
than anyone used to expect I could.

Note the used to. Damn, I raised the bar, they expect
this stuff ALL the time. Oh well, just need a bit more
caffeine.

Back to mind vs code. So I whip this stuff out, sometimes
it is throwaway crap, sometime it is a core lib that I'll reuse
since it pulls the files together, etc.

If I go back and reread the code, I use it to put my mind
back in the state I was when I wrote it. I'll review and
add comments if I need a hint for later. I can tell it really
meshes with my thoughts in a few minutes. I've read about
this aspect of setting state, but never really thought about
it before.

So now I'm thinking about historical code I've read from
other people. I knew it was REALLY bad. Thousands and
thousands of lines of cut and paste, no usage of arrays
or hashes, just total horrible crap that never worked and I
had to rewrite.

The person I was thinking of in this case was an older hot
babe. She wrote that code over a year, never delivered anything,
her boss loves her, and he'll throw a more $$ at her on the next
company he kills.

And this code was a huge window into her mind.

Perl was based on bunches of unix utils thrown together, glued
by a linguist. It grew a huge amount since then, but as most
people who dislike it know, you really can't get away from
your roots in this lanquage.

Which means it really is not like any other language I've ever
worked with.

Except English. Fast thought to code, but some very odd syntax
required since certain features grew organically and were tacked
on.

So does this window to the mind aspect work with other languages?

Sure. Somewhat.

I assume any of the more recent compact scripting languages (ruby,
python, etc) allow the very compact mind->code translation, which
means small amounts of elegent code might be obvious.

But they might not. These languages were designed by people who
were focused on the computer, and had a lot more education and
direction.

So even if they are very good languages, there is still more stuff
happening in the person's head before it get committed to code,
which means when you read the code you see something twice removed
from the thought process that created it.

Comments?
New Agree on the window into the mind of the other person.
The one I remember best was a project in C where I was a contractor. I had to take over for a guy and also build on the project to cover some new hardware. He was the company's top software engineering guy and was to go on to the next big thing the company was doing. His style was to do things quickly and then spend a lot of time debugging it. Obviously that means minimal comments in the code. He did not like to chase down compiler warnings, so he turned off warnings in the "make" scripts. He used minimal "function prototypes" because the proper ones gave him compiler errors he didn't want to resolve, etc. He knew enough C to get his stuff to work but had an "assembler orientation". I've done a lot of assembler work in my day and it was obvious. He had some assembler routines to be called by the C programs that were totally uncalled for if he knew just a bit more C.

I walked in on him in the lab one Monday morning debugging his code using a debugging tool he had never showed me. Unshaven for days and short of sleep, he was trying to resolve a severe customer problem that had come in late Friday. He was telling it looked like compiler had done something screwy with a particular statement. I looked at it and said "You know, there are a lot of operators strung together there without parentheses." "Are you sure you have the precedence rules straight in you mind?" He waved me off. Turns out that was the problem. On the plus side, he had saved a second by not typing parentheses during coding.

Flying by the seat of his pants.
Alex
New Very close to an experience of mine
I was a junior C coder, 6 months experience.

New job, low man.

I was given an MS-DOS interactive database program, hand coded in C. Screen, keyboard, btree indexes, record insertions, balancing, etc.

The guy wasn't that bad, or so I thought, but I had nothing to compare against.

He assumed incorreect order of operation, VERY simple one.

Index_Memory_Needed = CURRENT_INDEX_COUNT + 1 * Index_ITEM_SIZE

Dumb shit thought the + 1 happened first.

I then went around the office, quizzing people. I found about 1/2 of the people I asked had no idea how order of operations worked, even the "smart" ones.

I then found a lot of bugs like that.

Taught me to never assume any other programmer is the slightest bit competent. That code had been corrupting indexes for years before I was given it.
New some comments you dont want to see in code
# if that fat cunt comes near me today asking why it doesnt work I am going to fucking gut her like a moose

was one comment I found after a long term guy was let go and I was one of the few people that knew business basic. I immediately showed the controller and she got a hold of security
New Definitely.
This is *exactly* why I dislike working in bad code.

An old story:

I once had the job of re-implementing a program that loaded cryptographic keys in to EFTPOS terminals. The original program was dozens and dozens of pages of 132-column z-fold paper in FORTRAN from an old HP minicomputer that was being decomissioned. It was not modular. Loading such a key is basically a conversation and you have to tailor your responses according to a few possible states the device can report. Each send/receive sequence was a big block of code that did all the same work as every send/receive sequence. I was really not impressed with our EFT/ATM programmers after seeing that.

I developed a solution using a PC that had cryptographic hardware. Most of it was in C, but I also wrote a serial port driver in Assembly. Because of the nature of the actual key-loading, I also wrote a very simple language to describe the process (hand compiled into C macros :-). This enabled it to support *all* the different hardware, not just the one the original program did (there were other programs for the other hardware). The program also used things like function pointers and arrays of structures. Perfectly ordinary C-things, in other words.

The developer who got to maintain it encountered a bug with a terminal with new firmware: it's second-stage reset now took longer. *sigh* In trying to find the problem, he completely overlooked the finite state machine that was executing instructions and identified the problem as the wait-for-reply "statement". :-/ Clearly my efforts were way beyond anything he normally had to deal with.

More recently, developing an internet application in PHP, we hired some outsourced programmers for a few tasks. We were used to pushing what was possible in PHP. They were not. Their code came back as thousands of lines of code copied multiple times and modified slightly for each block. This was not acceptable: the rest of the codebase was fairly heavily modularised with several abstraction levels as we had demonstrably proven this gave us a leg-up in development and maintenance. We tried to get them to understand this. Several times. It was painful to see the ideas of "abstraction" and "modularity" simply fail to register in their minds.

We re-wrote their contribution to a tenth of the size. And it was faster and more versatile.

Wade.

"Ah -- I take it the doorbell doesn't work?"
New My example
Source system: MS Access database on a desktop

Target system: SQL Server on a server

Output: Reports in both PDF and Excel

The table structure on the Access database was nearly identical to that on the SQL Server database.

To move the data, they had built a VB application that did a "SELECT *" from each table and stuffed the results from each into a temporary variable. Then a bunch of cursors to walk the various variables and apply logic to group and subtotal the results. And the output of this whole process was a single flat file. Run time: ~30 minutes.

Then they copied the flat file to the server that SQL Server was on. Then a second VB app to load the flat file and parse out the data to stuff into the schema. Run time: ~30 minutes ... if nothing else was touching the server at the same time.

(Yes, this process was written by mainframe people. Flatfiles and walking your resultset applying logic are how you do things.)

Finally, a standalone VB app for each report, called by a VB interface that the users had to install ... with admin rights. Run time: ~4 minutes per report.

And it was producing bad results in an unpredictable manner.

After trying to debug the VB apps for three weeks, getting closer each time, I finally asked for a copy of the original Access DB, which they had refused to provide up til then. With the deadline already slipped, they were desperate enough to let me see it.

TWENTY MINUTES after they gave me the source data, I had written four views to aggregate the data, and an Access frontend to spit out the Excel reports. No round trip to the server required. Run time per report: Too short to measure by hand.

I used my (correct) reports to figure out that the source app -- before it fed into the Access database -- had sent duplicate records. Identified all the bad source data, and the resulting questionable output for manual review. All this within hours of getting the source.

And the business group that owned the app wanted to fix the current system rather than use mine, because it represented a smaller change.
--

Drew
New Mainframe programmers...
Or should I say, MVS/JES2/COBOL programmers, because it is that environment that strongly encourages temporary flatfiles, walking resultsets and programming-in-batch.

Back in the days of DOS and DOS-based LANs, we needed an application to "lock" a PC without actually logging out. Banyan didn't provide one. My boss discovered you could fake input to the DOS password change program from a QuickBASIC program without it showing on the screen. His "LanLock" program looked like he'd written it in COBOL and translated it... My version was quite quite different.

Wade.

"Ah -- I take it the doorbell doesn't work?"
     Programming language VS mind of coder - (crazy) - (6)
         Agree on the window into the mind of the other person. - (a6l6e6x) - (2)
             Very close to an experience of mine - (crazy)
             some comments you dont want to see in code - (boxley)
         Definitely. - (static) - (2)
             My example - (drook) - (1)
                 Mainframe programmers... - (static)

I am LRPD of Borg. Refreshing is useless. You will be addicted.
87 ms