Seen over the shoulder of a co-worker ...



  • An EE doing some Java programming. I have no idea what he's working on.

      .
      .
      } else {
        column++;
        column++;
        column++;
        column++;
        column++;
        column++;
        column++;
        column++;
        column++;
        column++;
      }
      .
      .
      .
    


  • @zelmak said:

    An EE doing some Java programming. I have no idea what he's working on.

      .
    .
    } else {
    column++;
    column++;
    column++;
    column++;
    column++;
    column++;
    column++;
    column++;
    column++;
    column++;
    }
    .
    .
    .
    EE's often know nothing about programming. Be glad he didn't try to stick a soldering iron in there.



  •  I've met someone like that before and he shouldn't have been allowed to touch an IDE without some serious training. Seriously who thinks it's a good idea to let these people code anyway? I mean you don't see me designing machinery.



  • @D-Coder said:

    @zelmak said:

    An EE doing some Java programming. I have no idea what he's working on.

      .
    .
    } else {
    column++;
    column++;
    column++;
    column++;
    column++;
    column++;
    column++;
    column++;
    column++;
    column++;
    }
    .
    .
    .
    EE's often know nothing about programming. Be glad he didn't try to stick a soldering iron in there.

    Yeah, he should have at least used a loop, as it's easier to maintain:

    } else {
        for(int i = 0; i < 10; i++) {
            column++;
        }
    }


  • TRWTF is that he cuddled his braces.



  • He obviously was getting paid per line of code.



  • @Anketam said:

    He obviously was getting paid per line of code.

    He's a government employee ... he gets paid for showing up and breathing.


  • Trolleybus Mechanic

    @zelmak said:

    @Anketam said:

    He obviously was getting paid per line of code.

    He's a government employee ... he gets paid for showing up and[b]/or[/b] breathing.

     

    Made a small adjustment to your post, mildly altering the intended context for the purposes of amusement (with the exact level of amusement highly dependent on external variables, mainly related to the individual reader of the post)

     



  • @zelmak said:

    He's a government employee ... he gets paid for showing up and breathing.
    Ah, now it makes sense.



  • @Lorne Kates said:

    @zelmak said:

    @Anketam said:

    He obviously was getting paid per line of code.

    He's a government employee ... he gets paid for showing up and/or breathing.

     

    Made a small adjustment to your post, mildly altering the intended context for the purposes of amusement (with the exact level of amusement highly dependent on external variables, mainly related to the individual reader of the post)

     

    My version is even funnier.



  •  Ah! EE's! I meet one who while on our 2nd year in college, didn't know how to turn on a PC... Until this day I want to believe he was joking. 



  • @Speakerphone Dude said:

    @Lorne Kates said:

    @zelmak said:

    @Anketam said:

    He obviously was getting paid per line of code.

    He's a government employee ... he gets paid for showing up and/or breathing.

     

    Made a small adjustment to your post, mildly altering the intended context for the purposes of amusement (with the exact level of amusement highly dependent on external variables, mainly related to the individual reader of the post)

     

    My version is even funnier.

    That's not true! They have to show up at least 30% of the time... Unless they use their sick-days for that remaining 30%, in which case your statement is 100% accurate.

    Why am I working in the private industry again?



  • @C-Octothorpe said:

    Why am I working in the private industry again?

    According to the next President:

    @Mitt Romney said:

    Isn’t it fitting that so many of those who have contempt for the private sector will soon find themselves back in it?



  • @Speakerphone Dude said:

    @C-Octothorpe said:
    Why am I working in the private industry again?

    According to the next President:

    @Mitt Romney said:

    Isn’t it fitting that so many of those who have contempt for the private sector will soon find themselves back in it?
    The day I work for the private sector is the day I die, which ironically would make me a shoe-in...



  • @Lorne Kates said:

    @zelmak said:

    @Anketam said:

    He obviously was getting paid per line of code.

    He's a government employee ... he gets paid for showing up and/or breathing.

     

    Made a small adjustment to your post, mildly altering the intended context for the purposes of amusement (with the exact level of amusement highly dependent on external variables, mainly related to the individual reader of the post)

     

    Never has a "FTFY" been so absolutely ruined with over-explanation.



  • @C-Octothorpe said:

    @Speakerphone Dude said:
    @C-Octothorpe said:
    Why am I working in the private industry again?

    According to the next President:

    @Mitt Romney said:

    Isn’t it fitting that so many of those who have contempt for the private sector will soon find themselves back in it?
    The day I work for the private sector is the day I die, which ironically would make me a shoe-in...

    Yes, yes, death. But first: private sector.



  • @morbiuswilters said:

    @C-Octothorpe said:
    @Speakerphone Dude said:
    @C-Octothorpe said:
    Why am I working in the private industry again?

    According to the next President:

    @Mitt Romney said:

    Isn’t it fitting that so many of those who have contempt for the private sector will soon find themselves back in it?
    The day I work for the private sector is the day I die, which ironically would make me a shoe-in...

    Yes, yes, death. But first: private sector.

    You had to rub it in, didn't you?



  • @Speakerphone Dude said:

    According to the next President:

    @Mitt Romney said:

    Isn’t it fitting that so many of those who have contempt for the private sector will soon find themselves back in it graduate school?

    FTFY.



  • @C-Octothorpe said:

    You had to rub it in, didn't you?

    I stole that joke from P.J O'Rourke (I think). He was in some third-world shithole and (paraphrasing): "The signs everywhere said 'Communism or Death!' But from the looks of things the government had replied 'Yes, yes, death. But first: Communism!'"



  • @Speakerphone Dude said:

    According to the next President:

    @RON PAUL said:

    Isn’t it fitting that so many of those who have contempt for gold will soon find themselves hoarding it in their synagogues?

    RPTFY.



  • @pkmnfrk said:

    Yeah, he should have at least used a loop, as it's easier to maintain:

    } else {
        for(int i = 0; i < 10; i++) {
            column++;
        }
    }

    Your code is woefully inefficient. This is much better:

    } else {
    
    for(int i = 1; i &lt;= 4; i++) {
        column += i;
    }
    

    }

     Please don't take clock cycles for granted. In certain parts of Africa, they have to share 100 clock cycles between an entire village.

     



  • @Severity One said:

    @pkmnfrk said:

    Yeah, he should have at least used a loop, as it's easier to maintain:

    } else {
        for(int i = 0; i < 10; i++) {
            column++;
        }
    }

    Your code is woefully inefficient. This is much better:

    } else {
    
    for(int i = 1; i &lt;= 4; i++) {
        column += i;
    }
    

    }

     Please don't take clock cycles for granted. In certain parts of Africa, they have to share 100 clock cycles between an entire village.

     

    You're still wasting cycles, since the compiler won't optimise for the case of i = 1. Plus, each add needs to get the value of i from memory. Here's a better version with the loop unrolled and optimised

    } else {
        column++;
        column += 2;
        column += 3;
        column += 4;
    }

    Modern processors have an inc instruction, so column++ is a single fast instruction, rather than a clumsy add-with-constant



  •  That looks so inelegant. Don't you have any professional pride?



  • @Speakerphone Dude said:

    @C-Octothorpe said:
    Why am I working in the private industry again?

    According to the next President:

    @Mitt Romney said:

    Isn’t it fitting that so many of those who have contempt for the private sector will soon find themselves back in it?

    Ironically, I am about as fiscally conservative as it is possible to be; yet I would never want to switch to working in the private sector. :-/ 



  • There were one too many increments...so.... 
      .
    

    } else {
    column++;
    column++;
    column++;
    column++;
    column++;
    column++;
    column++;
    column++;
    column++;
    --column;
    column++;

      }
    .
    .
    .



  • @morbiuswilters said:

    Never has a "FTFY" been so absolutely ruined with over-explanation.
     

    It's almost as if you're too dumb to realize that the verbose, overwrought expansion of "FTFY" WAS THE JOKE.

    Wait, no, it's exactly like that.

     


  • Considered Harmful

    @Mo6eB said:

    You're still wasting cycles, since the compiler won't optimise for the case of i = 1. Plus, each add needs to get the value of i from memory. Here's a better version with the loop unrolled and optimised

    } else {
        column++;
        column += 2;
        column += 3;
        column += 4;
    }

    Modern processors have an inc instruction, so column++ is a single fast instruction, rather than a clumsy add-with-constant

    Tsk, tsk; using postfix ++ when prefix ++ is so much more efficient. What if column is a class with overloaded operators?



  • @Zylon said:

    @morbiuswilters said:

    Never has a "FTFY" been so absolutely ruined with over-explanation.
     

    It's almost as if you're too dumb to realize that the verbose, overwrought expansion of "FTFY" WAS THE JOKE.

    Wait, no, it's exactly like that.

     

    It's almost as if you're too dumb to realize that I was putting Lorne Kates on.



  • using System;
    using System.Collections.Generic;
    
    public interface IAddNumber<T> {
    	T Add(T a);
    }
    
    public class AddNumberFactory<T> {
    	private static AddNumberFactory<T> inst;
    
    	private IDictionary<T, IAddNumber<T>> addNumberCache;
    
    	private AddNumberFactory() {
    		addNumberCache = new Dictionary<T, IAddNumber<T>>();
    	}
    
    	public IAddNumber<T> MakeAddNumberInstance(T incrementBy) {
    		if (!addNumberCache.ContainsKey(incrementBy)) {
    			addNumberCache[incrementBy] = new AddNumberInst(incrementBy);
    		}
    
    		return addNumberCache[incrementBy];
    	}
    
    	public static AddNumberFactory<T> Inst {
    		get {
    			if (inst == null) {
    				inst = new AddNumberFactory<T>();
    			}
    			return inst;
    		}
    	}
    
    	private class AddNumberInst : IAddNumber<T> {
    		private T incrementBy;
    
    		public AddNumberInst(T incrementBy) {
    			this.incrementBy = incrementBy;
    		}
    
    		public T Add(T a) {
    			dynamic lhs = a;
    			dynamic rhs = incrementBy;
    
    			return (T)(lhs + rhs);
    		}
    	}
    }
    
    public static class Program {
    	public static void Main(string[] args) {
    		int column = 0; //need to increase this by 10
    
    		//we can omit one of the <int>s here because of type inferrence! yay!
    		IAddNumber<int> addNumber = AddNumberFactory<int>.Inst.MakeAddNumberInstance(1);
    		column = addNumber.Add(column);
    
    		addNumber = AddNumberFactory<int>.Inst.MakeAddNumberInstance(2);
    		column = addNumber.Add(column);
    
    		addNumber = AddNumberFactory<int>.Inst.MakeAddNumberInstance(3);
    		column = addNumber.Add(column);
    
    		addNumber = AddNumberFactory<int>.Inst.MakeAddNumberInstance(4);
    		column = addNumber.Add(column);
    
    		Console.WriteLine(column); // 10
    
    		Console.ReadKey(true);
    	}
    }
    


  • @morbiuswilters said:

    @Zylon said:

    @morbiuswilters said:

    Never has a "FTFY" been so absolutely ruined with over-explanation.
     

    It's almost as if you're too dumb to realize that the verbose, overwrought expansion of "FTFY" WAS THE JOKE.

    Wait, no, it's exactly like that.

    It's almost as if you're too dumb to realize that I was putting Lorne Kates on.

     

    Ah, the classic "I'm not stupid I was pretending to be stupid STUPID!" defense.

    Nice try, but sorry, no, you're not fooling anyone.

     



  • @Zylon said:

    @morbiuswilters said:

    @Zylon said:

    @morbiuswilters said:

    Never has a "FTFY" been so absolutely ruined with over-explanation.
     

    It's almost as if you're too dumb to realize that the verbose, overwrought expansion of "FTFY" WAS THE JOKE.

    Wait, no, it's exactly like that.

    It's almost as if you're too dumb to realize that I was putting Lorne Kates on.

     

    Ah, the classic "I'm not stupid I was pretending to be stupid STUPID!" defense.

    Nice try, but sorry, no, you're not fooling anyone.

     

    Right, because even though I correctly identified the joke as a "FTFY", the obvious conclusion isn't "Oh, he's ragging on Lorne Kates", no it's "LOL HE TOTALLY MISSED THAT THAT WAS A LONG-WINDED WAY OF SAYING 'FTFY'!!!"

    Look, I know your hug box has been broken for a few days, but that's no reason to take your profound developmental disabilities out on the Internet. Maybe you can bring yourself to orgasm again by re-reading the phone book.


  • BINNED

    Are you sure that's enterprisey enough? Maybe you should add some XML or JSON.



  • @PedanticCurmudgeon said:

    Are you sure that's enterprisey enough? Maybe you should add some XML or JSON.

    I realized after I posted it that I neglected to add the "CombineNumberFactoryFactory" that lets you customize which operation you need to do. I'll post a new revision tomorrow. Maybe with XML.



  • @pkmnfrk said:

    I realized after I posted it that I neglected to add the "CombineNumberFactoryFactory" that lets you customize which operation you need to do. I'll post a new revision tomorrow. Maybe with XML.

    Don't you people have jobs?



  • @morbiuswilters said:

    @pkmnfrk said:
    I realized after I posted it that I neglected to add the "CombineNumberFactoryFactory" that lets you customize which operation you need to do. I'll post a new revision tomorrow. Maybe with XML.

    Don't you people have jobs?

    They get paid to come here and post cliched, unfunny jokes.

    They're all getting raises this year, for obvious reasons.



  • @PedanticCurmudgeon said:

    Are you sure that's enterprisey enough? Maybe you should add some XML or JSON.

    In an enterprise-grade solution both technologies are relevant:

    • XML for the canonical object model, the messaging schemas and the middle-tier content integration templating mechanism
    • JSON for the interactive client data delivery, the services aggregation layer and the geo-targeted cache repositories

    What is really missing in this list is of course BPEL because in most enterprise systems whenever you can leverage a SCA-compliant technology it is a no-brainer to implement a business-driven solution that closes the gap between the customer and the capability-enabling infrastructure.

    And let's not forget the key technology that has been the backbone of enterprise information systems for the last 15 years: Excel VBA.



  • @joe.edwards said:

    Tsk, tsk; using postfix ++ when prefix ++ is so much more efficient. What if column is a class with overloaded operators?

    Well, if you're using an unoptimizable pile of unneeded extensions which only bloat memory and reduce execution speed, i.e. C++, there's really no helping you any more. Of course now somebody would chime in and give some convoluted example which uses an inscrutable hairy ball of templates to redefine the postfix ++ operator for non-native types to work as the prefix ++ when the return value is being discarded. I would argue that this only proves my case.



  • @Speakerphone Dude said:

    What is really missing in this list is of course BPEL because in most enterprise systems whenever you can leverage a SCA-compliant technology it is a no-brainer to implement a business-driven solution that closes the gap between the customer and the capability-enabling infrastructure.

    You are my new favorite performance artist. With one sentence of cutting satire you perfectly illustrate why our industry is so incurably fucked.



  • @Mo6eB said:

    @joe.edwards said:

    Tsk, tsk; using postfix ++ when prefix ++ is so much more efficient. What if column is a class with overloaded operators?

    Well, if you're using an unoptimizable pile of unneeded extensions which only bloat memory and reduce execution speed, i.e. C++, there's really no helping you any more. Of course now somebody would chime in and give some convoluted example which uses an inscrutable hairy ball of templates to redefine the postfix ++ operator for non-native types to work as the prefix ++ when the return value is being discarded. I would argue that this only proves my case.

    Um, for native types, most compilers do this anyway..we have come a long way since the days of the PDP-11 where the existance of a specific machine instruction made all of the difference in the world for pre-fix vs. post fix on things linke inegral types (not to mention the improvements in compiler design).



  • @pkmnfrk said:

    Yeah, he should have at least used a loop, as it's easier to maintain:

    } else {
        for(int i = 0; i < 10; i++) {
            column++;
        }
    }

     

    No, the obvious solution is

     

    } else {
    
    do {
        column++;
    } while (column &lt; column + 10);
    

    }

     


  • Trolleybus Mechanic

    @blakeyrat said:

    @morbiuswilters said:
    @pkmnfrk said:
    I realized after I posted it that I neglected to add the "CombineNumberFactoryFactory" that lets you customize which operation you need to do. I'll post a new revision tomorrow. Maybe with XML.

    Don't you people have jobs?

    They get paid to come here and post cliched, unfunny jokes.

    They're all getting raises this year, for obvious reasons.

     

    My bonus is entirely dependent on that one blood vessle just to the right of Blakey's temple.

    Every white-hot poker migraine is cash in the bank for me!

     



  • @markfiend said:

    No, the obvious solution is
    } else {
    do {
    column++;
    } while (column < column + 10);
    }
    I think you mean
    } else {
    do {
    ++column;
    } while (column < column + 10);
    }



  • @Lorne Kates said:

    @blakeyrat said:
    They get paid to come here and post cliched, unfunny jokes.

    They're all getting raises this year, for obvious reasons.

    My bonus is entirely dependent on that one blood vessle just to the right of Blakey's temple.

    Does that mean you loose the chance at more bonuses if you go far enough to cause something fatal?



  • @Lorne Kates said:

    My bonus is entirely dependent on that one blood vessle just to the right of Blakey's temple.

    Every white-hot poker migraine is cash in the bank for me!

    My right or your right?



  • @morbiuswilters said:

    @pkmnfrk said:
    I realized after I posted it that I neglected to add the "CombineNumberFactoryFactory" that lets you customize which operation you need to do. I'll post a new revision tomorrow. Maybe with XML.

    Don't you people have jobs?

    Maybe they work in the public sector.


Log in to reply