Where did George, the master programmer, go?

  • Thread starter Thread starter DEvens
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around the implications of programming practices, particularly the tendency of some programmers to use complex or arcane features of programming languages instead of simpler, more maintainable approaches. Participants share anecdotes and reflections on coding styles, job security, and the balance between cleverness and maintainability in code.

Discussion Character

  • Exploratory
  • Debate/contested
  • Technical explanation

Main Points Raised

  • Some participants suggest that using every feature of a programming language can lead to being pushed out of a job or promoted, as it complicates code unnecessarily.
  • Others argue that overly complex coding can create maintenance challenges and that simpler approaches are often more effective.
  • A few participants share personal experiences with coding practices that were initially clever but ultimately led to difficulties in understanding and maintaining the code.
  • There are references to humor in programming culture, highlighting the fine line between clever and overly complicated code.
  • Some participants discuss the importance of standardization in coding practices and the potential drawbacks of individual coding styles.
  • Examples of unusual coding techniques are presented, with mixed opinions on their maintainability and clarity.

Areas of Agreement / Disagreement

Participants express a range of views on the use of complex coding techniques, with no clear consensus on whether such practices are beneficial or detrimental. Some agree on the challenges of maintainability, while others defend the creativity involved in using advanced features.

Contextual Notes

Participants note that the discussion is influenced by personal experiences and the varying standards of coding practices across different environments. There is acknowledgment of the challenges faced when transitioning code between different programming languages and the impact of individual coding styles on team dynamics.

DEvens
Homework Helper
Education Advisor
Gold Member
Messages
1,248
Reaction score
509
TL;DR
A story about a new-guy coder who is sorry he didn't get to meet his predecessor
Someplace I read this story. But I can't recall where. Anybody?

This guy, Fred, starts a new coding job. And he is working industriously and enjoying himself. But he keeps seeing the name of the coder whose code he is maintaining. And that guy is not in the office. So he asks his co-workers about the missing guy. Oh, that's George. He does not work here any more. George was amazing. He made it a point to use every single feature of the programming language in every single program he wrote. He was amazing in his knowledge of the fine details and nuanced rules of the inner workings of the language. But... He does not work here anymore. Fred was very sorry to have missed the chance to meet this guy.

The implication of the story is, if you try to use every feature of a programming language, even if you do it correctly with full detailed knowledge, chances are that pretty soon you won't work there any more. Does anybody remember this story?
 
Technology news on Phys.org
I think it means he moved on to Google.

When folks go out of their way to use arcane features of a programming language over using the simpler and easier to maintain features then the team will eventually push him/her out or get them promoted to a new job.

It reminds me of a judoka I once knew who would throw someone but in mid toss would switch up the move and drop them a different way from the standard throw.

His explanation was he didn't want the opponent to know how they would be thrown and so recover from it. I believed it for a while until I realized that you are making things needlessly complicated and slower than normal meaning the opponent would likely recover faster.

Over the years, I've run across folks who make things needlessly complicated in their code and have had to rewrite portions of it to make it more maintainable. In one case, I would have liked to meet the programmer because many of his java constructs were truly inspired while quite clever created roadblocks in extending his code for things he didn't originally intend and that where "keep it simple stupid" (KISS) comes in.

CAVEAT: I'm sure programmers after me are thinking my code was needlessly complicated. Basically we write our code like a beautiful sand mandala and shortly thereafter a slight wind will blow it away.

The nice thing about someone changing your code is that now you don't have a duty to maintain it and that can be the nicest feeling of all.

One last tidbit 1982 Real Programmer humor:

https://web.mit.edu/humor/Computers/real.programmers

and of course no post would be complete without:

https://thedailywtf.com/
 
Last edited:
  • Like
Likes   Reactions: cobalt124, FactChecker and Ibix
  • Like
Likes   Reactions: Keith_McClary
jedishrfu said:
I think it means he moved on to Google.
Hahaha!
When folks go out of their way to use arcane features of a programming language over using the simpler and easier to maintain features then the team will eventually push him/her out or get them promoted to a new job.
I find that to be true also for people who use features that are new. I was constantly annoyed by people who turned a simple program into something that was defining a new language. If they were developing a major language like the next Java, I could tolerate it, but a single-use, simple program should not require one to learn an entire new set of operations, functions, and keywords.
It reminds me of a judoka I once knew who would throw someone but in mid toss would switch up the move and drop them a different way from the standard throw.
And one should not treat other programmers as opponents who you need to surprise.
 
  • Like
Likes   Reactions: Klystron and Vanadium 50
jedishrfu said:
tidbit
On purpose, right ? . 😜
.
 
FactChecker said:
And one should not treat other programmers as opponents who you need to surprise.

Comment 1: Who says? Have you never heard of job security?
Comment 2: Syntax error. Whom.

When I see code like that, I am reminded of Spinal Tap's "There's a fine line between clever and stupid".
 
  • Like
Likes   Reactions: Klystron, FactChecker and jedishrfu
Vanadium 50 said:
Comment 2: Syntax error. Whom.
Knock knock!
Who's there?
To.
To who?
No, it's "to whom".
 
  • Like
  • Haha
Likes   Reactions: jtbell, Klystron, FactChecker and 2 others
For whom the bell nulls!
 
  • Haha
Likes   Reactions: Klystron
At a mainframe software house at which I worked in the '80s, some of the coders liked to use their own macros. The bosses (at that place the bosses could code) objected, citing standardization. Eventually the functional benefits of the individually-prepared macros were subsumed, as well as was ipso facto proven to be practicable, into the macros that had been deemed to merit inclusion in the in-house common library, and everyone was no more unhappy than was to-each tolerable (no-one quit over the matter). One programmer quipped (not originally) that one of the nice things about standards is that there are so many of them to choose from.
 
  • Like
Likes   Reactions: jedishrfu
  • #10
All of the direct product code I am producing now must follow MISRA standards. These are fairly restrictive. For example, there is no automatic casting allowed. It must be explicit and you can't cast the result of an expression. So you end up creating a lot of "extra" lines of code.

Was George really using the "volatile" keyword in every project he worked on? Obviously, someone who is aching to use all of the programming features all the time or to use his most recently discovered arcane technique anywhere he can is not coding to requirements.

I have seen the C++ template used for creating bizarrely cryptic and effectively unmaintainable code. But from my experience, you won't commonly create more reliable software by restricting what language features are allowed.

Here's an example of an unusual coding technique:
Code:
  char cLowHexDigit = "0123456789ABCDEF"[n&0xF];
Perhaps you have never seen that construction before. But it's certainly maintainable. I would expect most programmers who have not already run into to that to react with "Oh, you can do that?".

It is especially important for novice programmers to work with other programmers - even if those others are also novices. And part of the reason is that each programmer in a group will discover techniques on their own and share them with the group during design sessions, code reviews, and casual technical discussions. It is part of becoming fully fluent in a language.
 
  • Like
Likes   Reactions: FactChecker
  • #11
.Scott said:
Here's an example of an unusual coding technique:
Code:
  char cLowHexDigit = "0123456789ABCDEF"[n&0xF];
Perhaps you have never seen that construction before. But it's certainly maintainable. I would expect most programmers who have not already run into to that to react with "Oh, you can do that?".
Even more unusual is this example:
C:
int val;
int arr[] = { 1, 2, 3, 4 };
val = 3[arr];
When this code executes, val will be set to 4. I don't recommend doing this, however.
 
  • Like
Likes   Reactions: jedishrfu
  • #12
jedishrfu said:
The nice thing about someone changing your code is that now you don't have a duty to maintain it and that can be the nicest feeling of all.

I contributed a resource-assignment algorithm to a larger project that for awhile nobody could understand. It was developed and maintained in Matlab, with some C coding underneath for speed, and it had a lot of Matlab trickery. I could barely understand parts of it myself. In my defense, it was originally an R & D project that got repurposed for wider applicability. I was the only intended user. (There's a lesson in there somewhere).

But that setup created huge maintenance issues aside from the difficulty of other programmers to understand what I was doing. (It is not easy as it turns out to support a project based on Matlab Runtime. There are all kinds of incompatibility issues between releases).

Anyway, I recoded it in the language being used for the rest of the project, C#, and along the way commented and cleaned up the algorithm. My proudest moments where when the other programmers were able to find bugs I'd missed, and make improvements in the algorithm as well. By the time I left that job that monster had truly been handed on to the next generation of developers.

jedishrfu said:
One last tidbit 1982 Real Programmer humor:

https://web.mit.edu/humor/Computers/real.programmers

and of course no post would be complete without:

https://thedailywtf.com/

From the Real Programmer document:
Real Programmers can write five-page-long DO loops without getting confused.

This essay seems dated because it is FORTRAN based, but a lot of it is still relevant.

The software engineering leads on the C# project mentioned above hated using "breaks" for early exit from loops. I adhered to the required style, but I never quite saw how the result, introducing nested loops that were 20-deep, was an improvement in readability. There were indeed loops that spanned five pages.
 
  • #13
Mark44 said:
Even more unusual is this example:
C:
int val;
int arr[] = { 1, 2, 3, 4 };
val = 3[arr];
When this code executes, val will be set to 4. I don't recommend doing this, however.

I've not seen this one before and had to try it myself. Looks like a kind of pointer symmetry ie
C:
val = arr[3];    // arr[3] --> *arr + *3 --> *arr + 3

val = 3[arr];    // 3[arr] --> *3 + *arr --> 3 + *arr
 
  • #14
jedishrfu said:
I've not seen this one before and had to try it myself. Looks like a kind of pointer symmetry ie
C:
val = arr[3];    // arr[3] --> *arr + *3 --> *arr + 3

val = 3[arr];    // 3[arr] --> *3 + *arr --> 3 + *arr
It relies on the fact that pointer addition is commutative.

BTW, your comments aren't valid C. *3 isn't valid, since the operand of * must be a pointer.
Also, *arr + 3 would result in 3 plus the value of the element at index 0, not the element at index 3.

arr is the address of the first element of the array.
arr + 3 is the address of the element at index 3 in the array, as would also be 3 + arr.
*(arr + 3) or *(3 + arr) both represent the value at the address of the index 3 element.
So arr[3] == *(arr + 3) == *(3 + arr) == 3[arr]

In C/C++ it's valid to add an integral value to a pointer, but the result of the addition is "scaled by the type of object pointed to." IOW, adding 1 to a pointer could result in an address 1 byte higher in memory, 2 bytes higher, 4 bytes higher, and so on, depending on the base type of the pointer.
 
  • Like
Likes   Reactions: sysprog
  • #15
Yes i know that star 3 wasnt valid i struggled with how to label the memory of location of 3 vs 3 itself and decided on that notation.
 

Similar threads

Replies
6
Views
4K
Replies
29
Views
6K
  • · Replies 11 ·
Replies
11
Views
4K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • Sticky
  • · Replies 13 ·
Replies
13
Views
8K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 44 ·
2
Replies
44
Views
6K