C# annoyed me today, so I took revenge.



  • Being forced to put static variables in class scope makes me a sad panda.


  • Discourse touched me in a no-no place

    I wonder if you can make a partial class in two different languages. Have most of your code be C#, and the method with the static variable be in C++.

    Off to the Evil Ideas thread!


  • mod

    As long as you use multiple projects, it may be doable. VS doesn't like mixed language projects.



  • so the first appearance of m_frame is evaluated before the assignment?

    Oh that's dangerous.

    Probably undefined behavior. Of course nothing in C# is undefined, because it's proprietary.



  • Assuming the commented-out code is what you replaced with the snippet immediately underneath it, I'm not seeing why o_Frame needs to be static. Why can't it just be an ordinary local variable inside TimerProc?



  • That awkward feeling when you start trying to politely explain to someone why they're an idiot only to suddenly realize that you're an idiot... 😓

    I shall leave this thread up as a memorial to my dumbassery.


  • BINNED

    @dookdook said:

    That awkward feeling when you start trying to politely explain to someone why they're an idiot only to suddenly realize that you're an idiot...

    You should get yourself one of these, they really do wonders for realizing such stuff before posting to a public forum:

    In case you didn't catch the reference:

    That said, it's not like I haven't done that before... 😄


  • Discourse touched me in a no-no place

    @abarker said:

    As long as you use multiple projects, it may be doable. VS doesn't like mixed language projects.

    I discovered that a while back. For no particular reason I tried to make an assembly out of both VB and C# classes. The only way I could find to do it involved using the command line to build separate netmodules and link 'em together.


  • Discourse touched me in a no-no place

    @abarker said:

    VS doesn't like mixed language projects.


  • mod

    Was I unclear? Mixed language solutions are ok. Mixed language projects are not permitted.



  • @Onyx said:

    Rubber duck debugging

    I explain it to my other personality. Is that okay?



  • @dookdook said:

    forced

    Hmmm..



  • @abarker said:

    Was I unclear? Mixed language solutions are ok. Mixed language projects are not permitted.

    That's not really any clearer to anyone who doesn't use VS. THIS ISN'T A REQUEST TO EXPLAIN IT TO ME. But I probably won't yell at you if you can't resist the urge to expound on VS's implementation details.


  • mod

    @boomzilla said:

    THIS ISN'T A REQUEST TO EXPLAIN IT TO ME.

    Fine, be that way.

    @boomzilla said:

    But I probably won't yell at you if you can't resist the urge to expound on VS's implementation details.

    So I'm good to go? Well then, here it is:

    VS considers a project to be a single group of code files that can be compiled together. Each project can be configured to be compiled into a DLL or an EXE. In the case of web projects, you end up with one or more DLLs which are linked to your aspx pages. Each project can only use one coding language, with the possible pedantic exception of web projects. Web projects generally apply the "one language" exception on a per folder basis. Even then, it may be argued that two languages are used because of the mixture of the preferred coding language for the logic and aspx for the structure.

    A solution, on the other hand, is a collection of projects. Solutions make it easy to group related projects together for more complicated programs. Unlike projects, solutions may contain projects that utilize different programming languages.



  • So it cannot build cross-language DLLs or EXEs but it can build a solution containing multiple EXEs and DLLs which are in a mix of languages.


  • Discourse touched me in a no-no place

    @abarker said:

    VS considers a project to be a single group of code files that can be compiled together.
    [...]
    A solution, on the other hand, is a collection of projects.
    [...]

    OK, I still feel a bit “WAT” but it's not aimed at you, but rather at the crazy way that VS works. The rest of the world doesn't organise itself that way, or use those words like that.



  • @dkf said:

    OK, I still feel a bit “WAT” but it's not aimed at you, but rather at the crazy way that VS works.

    Why?

    It seems perfectly sensible to me. What terminology would you prefer?


  • Discourse touched me in a no-no place

    @blakeyrat said:

    It seems perfectly sensible to me. What terminology would you prefer?

    I don't know. It just seems weird that there's this separation between languages, and that this in turn forces all sorts of complexity in the structure of how things are done.

    By contrast, I just have projects. They contain things in various languages (sometimes four or five in the same project) that get deployed in various ways to make the application work correctly when it is installed. (Unfortunately, the most complex projects are currently private. Oh well. They're doing things like pushing SQL at databases and JS at browsers and connecting the bits together across a cluster.) But that's using the word “project” differently to VS.

    I truly hate it when words are used to mean different things. It only promotes confusion as people say words and think they understand each other but don't really. Discovering and cleaning up such confusion is one the harder parts of my job…



  • I feel you. Here it's the word 'metric': It means subtly
    different things depending on who is saying it.



  • @dkf said:

    I don't know. It just seems weird that there's this separation between languages,

    The separation is languages is entirely incidental to the question I asked.

    Oh and BTW, what abarker said about web projects-- the language separation only apply to files that are compiled (by VS). There's no particular rules about where to put your HTML/CSS/JS files, they can go literally anywhere in any project.

    I'm wagering the limitation that you can have only one .net language-per-project is more related to wiring-up the Intellisense than anything. As someone posted, the .net compiler supports it with some finagling.

    @dkf said:

    By contrast, I just have projects. They contain things in various languages (sometimes four or five in the same project) that get deployed in various ways to make the application work correctly when it is installed.

    So you have no organizational level higher than a project? That's what a "solution" is in Visual Studio.

    For an example, a web service and an application that makes use of it might be two completely different projects, but (using VS) they could go into the same solution. This is handy, because you can set up your references in the application to the web service and VS knows what to build when you hit Run.

    @dkf said:

    (Unfortunately, the most complex projects are currently private. Oh well. They're doing things like pushing SQL at databases and JS at browsers and connecting the bits together across a cluster.) But that's using the word “project” differently to VS.

    I'm not 100% sure they are. The difference is that Visual Studio has a higher level of hierarchy.

    @dkf said:

    I truly hate it when words are used to mean different things.

    I think you need to actually use Visual Studio for an hour, because you got some weird-ass ideas in your skull.

    EDIT: also if "the rest of the world doesn't do it this way", then they certainly should, because it works very well.

    @dkf said:

    Discovering and cleaning up such confusion is one the harder parts of my job…

    If you don't use the term "solution" at all, then why is it a problem that Visual Studio defines it differently? (Also: differently than what? You're not using it!)


Log in to reply
 

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