Confuse your colleagues


  • Banned

    @Tsaukpaetra said in Confuse your colleagues:

    @Carnage said in Confuse your colleagues:

    normal people, I think most

    Thanks again for the reminder of my abnormality.

    Aren't cartoon ponies prancing around the screen enough reminder?


  • Notification Spam Recipient

    @Gąska said in Confuse your colleagues:

    @Tsaukpaetra said in Confuse your colleagues:

    @Carnage said in Confuse your colleagues:

    normal people, I think most

    Thanks again for the reminder of my abnormality.

    Aren't cartoon ponies prancing around the screen enough reminder?

    They didn't survive the transition and I haven't had the drive to resurrect them yet.



  • Another small gem proudly produced by Kevin:

            const string scanSpeedForward = "6";
            const string scanSpeedReturn = "25";
            const string panoramaBottom = "0";
            const string panoramaLeft = "0";
            const string panoramaTop = "300";
            const string panoramaRight = "600";
    
            int scanDurationInSeconds = scanInfo.GetScanDurationInSeconds("xy.dll", "xy.zz", "Ab.dll", "Ab.cd", scanSpeedForward, scanSpeedReturn, panoramaBottom, panoramaLeft, panoramaTop, panoramaRight);
    

    And guess what that function then does?
    Here it is:

                double scanSpeedForward = double.Parse(_scanSpeedForward, CultureInfo.InvariantCulture);
                double scanSpeedReturn = double.Parse(_scanSpeedReturn, CultureInfo.InvariantCulture);
    

    Etc.
    Great! Let's use string parameters only. We do not need those other type.
    Wait? Why do we need types at all? MUMPS could do without them.


  • Banned

    @BernieTheBernie I'm more worried about the "xy.dll" and "Ab.dll". These look like there's something seriously, seriously wrong going on.



  • @Gąska said in Confuse your colleagues:

    @BernieTheBernie I'm more worried about the "xy.dll" and "Ab.dll". These look like there's something seriously, seriously wrong going on.

    Kevin does not understand how to use the Configuration Engine, so he sometimes takes snippets from some configuration file, and creates things on his own...

    And just seeing in the function where he re-invents the wheel:

            try
            {
                ...
                return ...;
            }
    #if DEBUG
            catch (Exception exception)
            {
                if (Logger.Instance != null)
                {
                    Logger.LogException(nameof(SomeFunction), exception);
                }
                return null;
            }
    #else
            catch (Exception)
            {
                return null;
            }
    #endif
    

    So: in case of DEBUG mode, he might even try to log the exception before returning null, but only if the Logger was set (the Configuration Engine will take care of that - i.e. if it was used at all), and in RELEASE mode, he just returns null.
    Why should anyone try to find out what went wrong, when he's using a RELEASE version?



  • Meanwhile Johnny, a different colleague, added a new project to the solution.
    It has a test coverage of - you guess it - exactly 0.0%.
    It does not do any logging, so in case something goes wrong, nobody will have a hint where to start the search for the bug.
    Code warnings automatically run on Jenkins jumped up by 5% (and that new project makes less than 1% of the code base).

    But let's come to a more interesting point. Johnny is the author of the DataGetDataData method in the previous version of our product. That name is real - I did not make it up or exaggerate it for the purpose of posting a WTF. Of course, he used quite similar naming here, too.

        private void ObservedDataPoint_DataValueChanged()
        {
            uint observedData = m_ObservedDataPoint.GetDataValue().Data;
    
    
        private void DataPointXY_DataValueChanged()
        {
            SomeStatus.XY = (int)m_DataPointXY.GetDataValue().Data;
        }
    

    Yeah, everything is data and value. What else could it be? Some nice interfaces:

    public interface IDataValue
        {
            bool Negative { get; set; }
            uint Data { get; set; }
        }
        public interface IDataPointOut
    {
        void SetDataValue(IDataValue _dataValue);
        void SetDataValue(uint _value);
    }
    public delegate void DataValueChangedDelegate();
    interface IDataPointIn
    {
        event DataValueChangedDelegate DataValueChanged;
    
        IDataValue GetDataValue();
    }
    

    Some when he had to invert the value of a byte. There's a WTF in C#, too: ~myByte returns an int instead of a byte. But you could just cast the result to a byte. What does Johnny do?

    byte invMask = (byte)((~m_DataMasks[i]) & 255);
    

    And similar with &:

    byte data = (byte)((byte) value & m_DataMasks[i]);
    

    🤢



  • @BernieTheBernie said in Confuse your colleagues:

    There's a WTF in C#, too: ~myByte returns an int instead of a byte.

    Great to hear that C# inherited that particular misfeature from C++

    ...
    ...

    😢



  • @ixvedeusi said in Confuse your colleagues:

    @BernieTheBernie said in Confuse your colleagues:

    There's a WTF in C#, too: ~myByte returns an int instead of a byte.

    Great to hear that C# inherited that particular misfeature from C++

    ...
    ...

    😢

    Yes, Microsoft works hard to make the change from C/C++ to C# easy. For any C/C++ developer, of course. You are guaranteed to be able to write decent shitty C code also with C#.



  • @levicki said in Confuse your colleagues:

    Who can be at 98.85% and above health and ability to work all the time?

    👋

    Nobody over 30

    👋



  • @Zerosquare said in Confuse your colleagues:

    "Not working" doesn't have to mean "idle". Besides the stuff @Applied-Mediocrity mentioned, you could also work on your own projects, learn new things, organize events and teach stuff to people as a volunteer, reconnect with friends you haven't seen in a long time... Not only would you stay busy, it could also have positive impact on others.

    Exactly. There's a good reason why, up until very recently in historical terms, virtually all significant inventions and scientific discoveries came from either the "idle rich" or from priests: these were the only people who had the time and energy to devote to the necessary experimentation rather than being perpetually trapped in providing for more immediate, concrete concerns.


Log in to reply