This line made me smile



  • //     This code was generated by a tool.
    

    :)



  • @djork said:

    //     This code was generated by a tool.

    :)

    I have seen that before.  I whole-heartedly agreed with the comment.  It was followed by "Do not change it" or something.  Luckily, the tool that wrote the (tool that wrote the) code had left the company, and a better solution was found.



  • I have one on my site: 'Disclaimer: this page was generated by TXTtoHTML by Char'. Because I know it is bad html. All 1.311.439 bytes of it (29.369 lines), and I'm not going to rewrite it all.

    (The Real WTF is that I have a 1.25 MB page. I know)



  • Sounds like the .designer.cs files in Windows Forms applications made in C#.  Yes, Visual Studio generates these files.  It also tells you not to edit them because the designer WILL nuke your changes.  Nothing amazing, and not that funny when you have background knowledge.



  • @Kyanar said:

    Sounds like the .designer.cs files in Windows Forms applications made in C#.  Yes, Visual Studio generates these files.  It also tells you not to edit them because the designer WILL nuke your changes.  Nothing amazing, and not that funny when you have background knowledge.

    wow, what a killjoy



  • I know that the designer WILL nuke my changes. But the question here is WHY am I allowed to make some changes to those generated files?

     I think if a tool "generates" some code, then it should make sure that it will not "nuke" any human changes to the code. So the tool in question should place an aditional comment at the end of the file to make sure that noone was tampering with the code in question.

     

    So what I would "like" Visual studio to do is...

    //Warning this was generated. Do not change!

    [... CODE...]

    //Genarted Code Signature: 0Xdeadbeef

     



  • @Kyanar said:

    Sounds like the .designer.cs files in Windows Forms applications made in C#.  Yes, Visual Studio generates these files.  It also tells you not to edit them because the designer WILL nuke your changes.  Nothing amazing, and not that funny when you have background knowledge.

    Wow, way to be condescending. I actually do have background knowledge; enough, in fact, to know that in this case the message is from our own internal stuff, and not the standard Windows Forms generated code.

    I did a little research for you so that you'd know what to look for in the future:

    #region Windows Form Designer generated code
    /// 
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// 
    ...
    #endregion
    



  • @rdrunner said:

    I know that the designer WILL nuke my changes. But the question here is WHY am I allowed to make some changes to those generated files?

     I think if a tool "generates" some code, then it should make sure that it will not "nuke" any human changes to the code. So the tool in question should place an aditional comment at the end of the file to make sure that noone was tampering with the code in question.

     

    So what I would "like" Visual studio to do is...

    //Warning this was generated. Do not change!

    [... CODE...]

    //Genarted Code Signature: 0Xdeadbeef

     

    The correct course of action isn't to teach the tool to break on modified outputs, it's to teach the dev to change the inputs like they're supposed to. 


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.