The online racing simulator
.NET library
2
(44 posts, started )
Quote from Vain :...

Hmm, okay, I instantly disliked Java but on the contrary instantly fell in love with C#. I started out with C++, but having to do everything myself got very boring very fast. For me, C++ seems to be for people who either really need that last bit of performance (in games programming f.e.) or who simply think it's cool to write unreadable code . For application and web development (what I do) it would be a waste of time (wait, can you even do web stuff with C++ ).
Quote from AndroidXP :Hmm, okay, I instantly disliked Java but on the contrary instantly fell in love with C#.

Same here.

Quote from AndroidXP :
(wait, can you even do web stuff with C++ :confused.

Sure you can. CGI for example can be binary executable.
My personal favourite was assembly language. Haven't used it for a long time now though .

@Tanuva: If you don't like MS (hardly anyone does really), you can use Mono or DotGNU.
Quote from MonkOnHotTinRoof :Same here.



Sure you can. CGI for example can be binary executable.
My personal favourite was assembly language. Haven't used it for a long time now though .

@Tanuva: If you don't like MS (hardly anyone does really), you can use Mono or DotGNU.

You used ASM for web cgi? Do you have no fear?
Quote from Tanuva :Okay, then I gonna try them.

@Adroid XP: I can imagine a reason: It's microsoft-made

Hm if its Managed C++ using .NET you should be able to add the library as a "Reference" like the .NET Assemblies in the GAC (System, System.Data, System.Windows.Form, ...). Just "Browse" for it in the add dialog.

Quote from Vain :I dislike C# and java, but like Cpp.

Its not a suprise to me, that C++ programmers dislike C# without giving any good reasons... no, its usually because they don't know any good practice on C#, the languages seem very similar but differ in many points significantly. So most of the time people dislike it because they don't know s.it about it and things don't work as expected for them. Thanks for paying attention :P
What the heck.. I wasn't going to jump into the language arguments, but they are so much fun What follows is off topic and just my reasoning for using the languages I like to use.

I like C# and java, but both as languages, not as religions. Coming from LISP, C++ always gave me headaches with its syntax. If i have to do my own memory management in an OO language, I try to use Objective C instead, however fringe it is now. That said, writing code in a modern framework without a GUI with an object browser would drive me back to C any day, rolling my own terse code. Verbosity in frameworks is only good if the computer takes over the book keeping of what exists and how to call it.

I haven't had a need for the speed of C or C++ in ages. If perl and php are fast enough for webapps, then the java's speed is not an issue. Java isn't slow. Building giant black-box EJB, n-tier systems is slow and would be in any language.

C# is nice and fast (comparatively) and with managed DirectX, i can do full 3D programming without having to switch to a lower level. I'm not saying LFS could be done as efficiently in Managed DirectX.. maybe it could, probably it can't... But so far I've not had the need for that kind of performance in any of my jobs or hobbies.
Quote from sdether :
C# is nice and fast (comparatively) and with managed DirectX, i can do full 3D programming without having to switch to a lower level. I'm not saying LFS could be done as efficiently in Managed DirectX.. maybe it could, probably it can't... But so far I've not had the need for that kind of performance in any of my jobs or hobbies.

Sdether,

Took a look at the .NET library, looks really good and quite solid although I haven't done an in-depth look at it; but glad I checked here first before I started to bring my old InSim.NET up to .NET 2.0. Just from a quick-hit standpoint, I'd be a bit concerned about the foreaching through the InvocationList and calling BeginInvoke on it. Otherwise at least quick glancing most of my objections are cosmetic (i.e. the #s in the regions are a bit much, and I always use the underscore prefix to differeniate member variables from local variables, etc.)

Oh, a trick with Log4Net is do the following:

private static readonly ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

That way you can just macro the line and plop it at the top of any of your classes easily.

Have you run it through fxCop yet? If not, I highly recommend it.

Gah, you would use the viral GPL license. Its probably fine for a project such as this where there are is absolutely no real excuse for not sharing the source of applications that make use of the framework. However, there *are* far better open source licenses out there.

As far as Managed DirectX, no one should be fooled into thinking that it is anything more than a managed wrapper to the DirectX COM objects since its not (quite check using Reflector shows this to be the case). This *may* change to some degree with DirectX10 (interesting to note that WPF will wrap some DirectX10 functionality, and actually does wrap some DirectX9 functionality in the beta in a more 'managed' fashion, but also limits your ability to use all of the DirectX functionality).

The performance penalities from writing something like LFS in C# come from the bridge between the .NET IL objects and the DirectX COM objects and the .NET virtual machine. There is available from MS with VS2005 generators that will take .NET assemblies and generate machine code executables from them so that generally takes away the .NET virtual machine penalities. As most C/C++ developers know, there are plenty of optimizations you can do with pointers and thats one thing that the managed environment doesn't and won't have, so those optimizations just won't be there unless you really get down into the IL.

I forget the name of the game, but there was a retail RTS released recently that was written all in .NET and using the managed DirectX wrapper.
Quote from sdether :Building giant black-box EJB, n-tier systems is slow and would be in any language.

Yes, actually architecting and developing large n-tier systems is a time consuming process no matter what technology you use but performance on the other hand is very good if the hardware has been spec'd out correctly based on predicted loads, etc. But all sorta off topic.
Quote from Hollywood :Yes, actually architecting and developing large n-tier systems is a time consuming process no matter what technology you use but performance on the other hand is very good if the hardware has been spec'd out correctly based on predicted loads, etc. But all sorta off topic.

I agree.. It's just 99% of the "enterprise" systems I've dealt with were built as a magic bullet to let developers write EJBs without knowing anything about the system and without enforcing proper architecture on the whole system, which ended up with amazing resource hogs that were never planned for and sysadmins constantly having to reboot the jvm because it wasn't tuned right for the new component that was just deployed.
Quote from Hollywood :
Took a look at the .NET library, looks really good and quite solid although I haven't done an in-depth look at it; but glad I checked here first before I started to bring my old InSim.NET up to .NET 2.0.

I actually have my stuff in 2.0 and have been backporting it to 1.1 for release, since i didn't want to force people to go 2.0 quite yet.

Quote from Hollywood :Just from a quick-hit standpoint, I'd be a bit concerned about the foreaching through the InvocationList and calling BeginInvoke on it. Otherwise at least quick glancing most of my objections are cosmetic (i.e. the #s in the regions are a bit much, and I always use the underscore prefix to differeniate member variables from local variables, etc.)

The reason i use the InvocationList and BeginInvoke is to allow asyncronous event handling. I think i set it up so you can choose via config whether you want that behavior, but basically i didn't want some process receiving events to be able to block the reader thread from receiving more data. And i don't want event handler exceptions to kill the event sending.

Quote from Hollywood :
Oh, a trick with Log4Net is do the following:

private static readonly ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

That way you can just macro the line and plop it at the top of any of your classes easily.

yeah, found that trick a couple of months after i started the insim project and never went back to clean it up

Quote from Hollywood :
Have you run it through fxCop yet? If not, I highly recommend it.

Honestly, I've been afraid of what it would bitch at me about

Quote from Hollywood :
Gah, you would use the viral GPL license. Its probably fine for a project such as this where there are is absolutely no real excuse for not sharing the source of applications that make use of the framework. However, there *are* far better open source licenses out there.

Basically, i use the GPL to put things out there. Doesn't mean I am not open to other licenses if someone wanted one. It's just if someone wants to use it and not deal with me, then they get the GPL.

Quote from Hollywood :
As far as Managed DirectX, no one should be fooled into thinking that it is anything more than a managed wrapper to the DirectX COM objects since its not (quite check using Reflector shows this to be the case). This *may* change to some degree with DirectX10 (interesting to note that WPF will wrap some DirectX10 functionality, and actually does wrap some DirectX9 functionality in the beta in a more 'managed' fashion, but also limits your ability to use all of the DirectX functionality).

Yeah, i was switching things over to MDX 2.0 to get all the lovely generic stuff, and then they did the XNA announcement and pulled the rug from underneath me. So until the plans for XNA firm up i'm stuck with the slower MDX 1.0 stuff which has some issues under .NET 2.0, but for my uses, it's plenty fast.
#35 - Vain
I started the discussion on "I like C# vs I don't like C#" here so I'd like to end it:
I refer to C# and java as "get the job done"-languages. A program in java can look simple, can be easy to write and there are great developer-enviroments that help you to get code that works quickly.
But I like C++ for other reasons. I learned programming with C++ and behind every line of code I see pointers and memory-addresses. I get enormeous joy from using a pointers like dart-arrows and producing code that is about as unreadable as the debuggeroutput of self modifying assemblercode. In a library I made for myself and a friend I once wrote the comment behind a dangerous line of code that pretty much hits it on the head:
/* The user is propably about to shoot himself in the foot - well, I won't stop him! */
That's what I like about Cpp.

Vain
So I was right, afterall
I ... ya know, this should go into the off topic programming thread ... see ya there.
Quote from sdether :The reason i use the InvocationList and BeginInvoke is to allow asyncronous event handling. I think i set it up so you can choose via config whether you want that behavior, but basically i didn't want some process receiving events to be able to block the reader thread from receiving more data. And i don't want event handler exceptions to kill the event sending.

Right, I realize that and you actually have to especially if using Windows Forms.

However, I was just making a comment that it was a tad concerning with the invoking in a foreach loop which does casting to the Delegate and then you do casting to the actual delegate. Also, I believe (at least for 1.1) I recall that foreach was actually slower than a for. So you might want to switch to a for loop that casts to the actual delegate, that way there is only one casting going on.

Quote from sdether :yeah, found that trick a couple of months after i started the insim project and never went back to clean it up

Yeah... lots of little tricks to log4net. Do like it though, sure better than the Microsoft "logging". :/

Quote from sdether :Basically, i use the GPL to put things out there. Doesn't mean I am not open to other licenses if someone wanted one. It's just if someone wants to use it and not deal with me, then they get the GPL.

No problem. Like I said, GPL works ok for this type of project where there really isn't a compelling reason to not keep projects that utilize your framework open. I've been writing a bunch of non-related frameworks that I've been thinking about putting to open source and I've been completely turned off by the GPL, LGPL and the FSF. Especially because of the viral nature of the GPL.

Quote from sdether :Yeah, i was switching things over to MDX 2.0 to get all the lovely generic stuff, and then they did the XNA announcement and pulled the rug from underneath me. So until the plans for XNA firm up i'm stuck with the slower MDX 1.0 stuff which has some issues under .NET 2.0, but for my uses, it's plenty fast.

Yeah, pretty much. I actually am using the Irrlicht engine with their .NET wrapper; saves me the hassle of dealing with all the MDX/XNA, etc. plans and basically comes out to be the same thing as MDX plus some. Ogre and its .NET wrapper would do the same thing.

As far as this non-sensical "discussion" about C#/.NET platform. Its just another tool. Use it or don't, but really discussions about what language is better are really rather pointless in the end. Personally I've written applications in everything from C/C++ to Forth to Fortran to Pascal to VB to Java and others. It matters little other than whats available to do a certain job based on the requirements and environments of the job.

And no, just because C#, and any .NET managed language implementation, and Java (and actually any languages written to compile to the JVM) or even VB, Pascal, etc. don't expose pointers does not mean that its "easy" to write a quality application or even a framework such as what sdether and Messiah, respectively, put together.
Quote from Hollywood :Yeah... lots of little tricks to log4net. Do like it though, sure better than the Microsoft "logging". :/

Sweet Jesus.. i know, i shouldn't keep this back and forth going--sounds like it could go on for a while--but, at my other gig, we initially tried the Logging Application Block from MS. Hey, the system we were building was supposed to be a proper MS enterprise application and all. I finally just pulled rank, instituted log4net and, really, everybody's been a lot happier and productive.
Quote from Messiah :Hm if its Managed C++ using .NET you should be able to add the library as a "Reference" like the .NET Assemblies in the GAC (System, System.Data, System.Windows.Form, ...). Just "Browse" for it in the add dialog.

Yep, thats what I've got until now - seems like I just have to learn a fat bunch of cpp until I get it to work
me is going to learn C# right now...
i think this is a language for the future, so go on, sdether, and finish this .net
lib hehehe
CrazyICE,

I'm trying, i'm trying Seriously, I hope to have the new version with single lib InSim, OutSim and OutGauge finished in a matter of days. It's just other tasks keep intruding.
Quote from Hollywood :I've been writing a bunch of non-related frameworks that I've been thinking about putting to open source and I've been completely turned off by the GPL, LGPL and the FSF. Especially because of the viral nature of the GPL.

Sounds like you want the MIT or Apache licenses (sorry if you've already mentioned this)..
Quote from sdether :CrazyICE,

I'm trying, i'm trying Seriously, I hope to have the new version with single lib InSim, OutSim and OutGauge finished in a matter of days. It's just other tasks keep intruding.

don't panic
i know that problem very well
2

.NET library
(44 posts, started )
FGED GREDG RDFGDR GSFDG