Win a copy of Grokking Bitcoin this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

Egoless programming  RSS feed

 
Ranch Hand
Posts: 99
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello to everyone!

We had recently a discussion that made me think a lot about learning attitude. Campbell mentioned that this forum might be the right place to post that.

The thread in question :
https://coderanch.com/t/706597/java/find-error-program-repeat-loop#3314420

So I honestly did not know egoless programming was a thing. When I google it I get the "10 rules of" and other general clickbait.

I reckon it's a very interesting topic. School is very competitive, some assignments are measured in running time and we often compare time even when we don't need to. Sometimes it gives a little spur but often it just freeze us in an role (like if you are established as "good", you don't want to ask questions that would make you feel and look stupid).

So more egoless programming would be for everyone's benefit.
How do you apply that? How is it helping you concretely?
 
lowercase baba
Posts: 12737
51
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Deja Quavern wrote:some assignments are measured in running time...


Gross...

running time is almost always a terrible metric. I'd rather have a program that runs in .5 seconds and is easy to read, understand, and debug, than have a program that runs in .1 seconds but uses "clever" tricks that makes the code impossible to understand.

setting that aside...good programmers DO ask questions.  lots of questions.  it's always worse to assume something, work for weeks, and have it wrong, than ask a simple question up front and get everything right.  Unfortunately, this seems to be something you only learn with age/experience.
 
Marshal
Posts: 64115
215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

fred rosenberger wrote:. . . a program that runs in .5 seconds and is easy to read . . . than have a program that runs in .1 seconds but . . . .

Are you going to notice the difference? If you are on the end of a website and it takes 1″ to send something to the server and 1″ to get something back, you aren't going to notice that difference of 0.4″. Least of all if you have just spent one minute filling in a form.
 
D.J. Quavern
Ranch Hand
Posts: 99
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okey. So how do you ask questions that does not make you look stupid?

 
Campbell Ritchie
Marshal
Posts: 64115
215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I haven't seen your code yet. Go through it slowly and explain it so simply that even I can understand it.

One possibility.
 
Saloon Keeper
Posts: 20643
122
Android Eclipse IDE Java Linux Redhat Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or, as I said once to a person who was excessively proud of using horrible code to gain a questionable performance advantage: You can't save nanoseconds in a jar for use later.
 
Campbell Ritchie
Marshal
Posts: 64115
215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You doubtless remember the days when C programmers would cram everything onto one line to save memory and you ended up with horrors like an entire for loop squeezed onto one line and no body, only a semicolon. And they used to think that was good efficient code
 
D.J. Quavern
Ranch Hand
Posts: 99
Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are all buying time to avoid telling that egoless programming does not exist, is that it ?
 
Campbell Ritchie
Marshal
Posts: 64115
215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is the egoless programmer who doesn't exist.
 
Campbell Ritchie
Marshal
Posts: 64115
215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The idea of being egoless is to dissociate yourself from your work. If you make a mistake in programming, it doesn't make you a bad person or anything like that. Nor does writing flawless programs make you a better person. It is a case of dissociating the two.

At least I think it is.
 
fred rosenberger
lowercase baba
Posts: 12737
51
Chrome Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Deja Quavern wrote:Okey. So how do you ask questions that does not make you look stupid?


I used to be a math teacher.  NO question makes you look stupid.  

NOT asking questions makes you look stupid, when a day/week/month later you discover you did something wrong.  If you don't understand something, there is nothing wrong with asking for clarification.  The presenter didn't do their job of conveying the information to everyone. Each student learns differently, and what works for one doesn't necessarily work for all.  

I had many lessons where I'd explain the material.  I was SURE it was something everyone would "get".  then a hand would go up, asking a question.  I'd have to re-explain it differently for them.  sometimes i'd have to do this 3-4 times. That doesn't mean the students were stupid...they just saw and learned things differently.

 
D.J. Quavern
Ranch Hand
Posts: 99
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

fred rosenberger wrote:
I used to be a math teacher.  NO question makes you look stupid.  



Hi Fred!

The question is not to look stupid in front of your teacher, but in front of your "friends". You know what I mean...
 
Tim Holloway
Saloon Keeper
Posts: 20643
122
Android Eclipse IDE Java Linux Redhat Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The curse of ego is when you refuse to admit that you were imperfect and thus refuse to improve.

The flip side of that is accusative teams (a/k/a "peer review"), where the game is to tear down someone's ego. Cynic that I am, I fear that's mostly about management getting fellow staff to gang up on you in order to keep you from expecting decent pay and working conditions.
 
fred rosenberger
lowercase baba
Posts: 12737
51
Chrome Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
odds are pretty good at least one of your "friends" has the same question.
 
Tim Holloway
Saloon Keeper
Posts: 20643
122
Android Eclipse IDE Java Linux Redhat Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

fred rosenberger wrote:odds are pretty good at least one of your "friends" has the same question.

But will still laugh at you when you ask it.
 
Campbell Ritchie
Marshal
Posts: 64115
215
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

fred rosenberger wrote:. . .  a question.  I'd have to re-explain it differently for them. . . .

Happens all the time here; you explain something again and again, then somebody else explains it differently and the penny drops just like that.
 
D.J. Quavern
Ranch Hand
Posts: 99
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Holloway wrote:The curse of ego is when you refuse to admit that you were imperfect and thus refuse to improve.

The flip side of that is accusative teams (a/k/a "peer review"), where the game is to tear down someone's ego. Cynic that I am, I fear that's mostly about management getting fellow staff to gang up on you in order to keep you from expecting decent pay and working conditions.


Haha, no, I know I suck. I am a student, so I'm here to learn.

So maybe the secret is to learn to ignore when people think you are dumb? Or (I don't know the English world for laughing, but not openly) small-laugh at you?
 
Campbell Ritchie
Marshal
Posts: 64115
215
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Deja Quavern wrote:. . . I know I suck.

No you don't.

. . . (I don't know the English . . . small-laugh at you?

Smile, giggle, titter, smirk, snigger, sneer?
 
D.J. Quavern
Ranch Hand
Posts: 99
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:

Deja Quavern wrote:. . . I know I suck.

No you don't.



You don't know me but thank you <3

 . . . (I don't know the English . . . small-laugh at you?

Smile, giggle, titter, smirk, snigger, sneer?




I guess I meant sneer, it's not good spirited. (by good spirited I mean something that is innocent!)



(Edited: I removed the quote and added some interpretation of a word.)
 
Rancher
Posts: 810
19
C++ Java MySQL Database Netbeans IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In all of my career I have developed solutions using as fundamental of code as possible, for me this is ego-less programming.  I have a coding style that I expect new programmers to be able to understand as soon as they set foot into my shop.

I have worked my entire career to promote others to adopt this type of style, where it is plane, simple, and understandable, that is not to say, that elegance is not sought, but rather, understandability, completeness, and maintainability is promoted at all levels.  Programmers are discouraged from obfuscating their code by using "tricky" or complex coding.  This is a far different philosophy than I encountered when I first entered the market out of college, back in the day, often a programmer would make code complex, dirty, or spaghetti like that nobody wanted to maintain it.  The programmer perpetrating this onto an enterprise would do so as "job security".  Nobody wanted to look at their awful code.  This is a catch 22, since nobody wants to read that programmer's code, that programmer is in a dead end job, maintaining every piece of garbage they spewed out into their surroundings.

To make code that anyone can understand does require you to put away your ego and accept a roll more as a tool maker for the greater good.  It has paid off for me in many advancements, projects, and pay raises.  Not to mention that since everyone can read my code, I am free to take on new projects and not have to worry if Joe over in the other group that I just left can handle maintaining my code while I go on to bigger and better things.
 
Les Morgan
Rancher
Posts: 810
19
C++ Java MySQL Database Netbeans IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just another comment as my brain starts to turn some of the old rusty wheels...

Several years ago, back int he day when Sun ran Java, there was a discussion on what one of the contributors called "stupid code".  Stupid Code is a venture down that ego-less path, you acknowledge that the JIT Compiler used in Java is probably going to be way better at optimizing code than you ever will be.  Think about it: Java is translated into byte code, so your job as a programmer using Java is not to write "the coolest code ever", but rather, to write the most classically simple code understood by the compiler, so it can make it the fastest thing on the planet.  Who really is to say that the optimization path your are running down is really an optimization path?  Ultimately it is what the JIT compiler does with your source that makes the real difference.  If the JIT compiler cannot optimize your code, your "optimized" code is probably not really optimized.

We no longer live in the world where we have the C compiler and to get it to run faster we do an "asm" block and put in assembler codes that we know to be the absolute fastest way to do something.  Now we write our source and submit it to the JIT Compiler hoping the byte code in that JAR has been understandable enough for Java to make good with it.
 
Campbell Ritchie
Marshal
Posts: 64115
215
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Les Morgan wrote:. . . there was a discussion on what one of the contributors called "stupid code". . . . .

That was Brian Goetz. Let's see if I can find the discussion. Yes, this is it.
 
D.J. Quavern
Ranch Hand
Posts: 99
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Too bad that "cool code" is the way at school...
 
Campbell Ritchie
Marshal
Posts: 64115
215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please explain more; are you telling us they are teaching you poor quality code?
 
D.J. Quavern
Ranch Hand
Posts: 99
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
haha I am not in a position to judge the quality of our teaching. I think the teaching is really good.
I just know that we are encouraged to write compact and stylish, not clear enough that a beginner can read. Even though we are beginners.
 
Campbell Ritchie
Marshal
Posts: 64115
215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Deja Quavern wrote:. . .  we are encouraged to write compact and stylish . . . .

Compact and stylish code should be easy for everybody to read, assuming, “stylish,” means, “elegant,” and. “following the recommended style.” So that sounds like a good thing
 
D.J. Quavern
Ranch Hand
Posts: 99
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:

Deja Quavern wrote:. . .  we are encouraged to write compact and stylish . . . .

Compact and stylish code should be easy for everybody to read, assuming, “stylish,” means, “elegant,” and. “following the recommended style.” So that sounds like a good thing



Yep... I'll judge my teachers when I'm done with my education
Besides different teachers and teachers assistant have different styles, and some write in an impossible-to-understand way.
 
Ranch Hand
Posts: 91
Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hello Deja,

If egoless programming caught your attention then you might find the following
book (not new but still relevant) interesting, in particular Part VII (Software Craftsmanship)

https://www.amazon.com/Code-Complete-Practical-Handbook-Construction/dp/0735619670
 
Pay attention! Tiny ad!
Create Edit Print & Convert PDF Using Free API with Java
https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!