Serving the Quantitative Finance Community

 
User avatar
renorm
Posts: 1
Joined: February 11th, 2010, 10:20 pm

Quants : C++ vs. C#

October 5th, 2010, 3:44 pm

If I were to make GUI for my C++ app, I would simply use QT. How easy it is for C# or Java app to use the browser as GUI?
 
User avatar
quantmeh
Posts: 0
Joined: April 6th, 2007, 1:39 pm

Quants : C++ vs. C#

October 5th, 2010, 5:25 pm

QuoteOriginally posted by: renormHow easy it is for C# or Java app to use the browser as GUI?I'm not a GUI guy in Java you'd use something like GWT to write server side part of browser GUI. the client side is handled by GWT itself.the GUIs which I wrote were very simple. I liked Web GUI for that precise reason: you couldn't do much with them back then. so my poor GUI writing capabilities were on the level of what's available in browser. these days you can do so much in the browser, that I no longer want to touch it. i dont even deal with server side of GUI, it's all separate layer with their own people dealing with it.
 
User avatar
Cuchulainn
Posts: 23029
Joined: July 16th, 2004, 7:38 am

Quants : C++ vs. C#

October 5th, 2010, 5:31 pm

QuoteOriginally posted by: quantmehQuoteOriginally posted by: renormHow easy it is for C# or Java app to use the browser as GUI?I'm not a GUI guy in Java you'd use something like GWT to write server side part of browser GUI. the client side is handled by GWT itself.the GUIs which I wrote were very simple. I liked Web GUI for that precise reason: you couldn't do much with them back then. so my poor GUI writing capabilities were on the level of what's available in browser. these days you can do so much in the browser, that I no longer want to touch it. i dont even deal with server side of GUI, it's all separate layer with their own people dealing with it.You guys are in the 90's. Have you seen the computer games kids play these days? BTW anyone know what happened to Autodesk Cyberspace SDK. My 386 has 2 Mb and the graphics card 16 Mb. Funny that VRML.
Last edited by Cuchulainn on October 4th, 2010, 10:00 pm, edited 1 time in total.
 
User avatar
quantmeh
Posts: 0
Joined: April 6th, 2007, 1:39 pm

Quants : C++ vs. C#

October 5th, 2010, 6:15 pm

QuoteOriginally posted by: CuchulainnYou guys are in the 90's. Have you seen the computer games kids play these days?iPhone fart machines?
 
User avatar
Cuchulainn
Posts: 23029
Joined: July 16th, 2004, 7:38 am

Quants : C++ vs. C#

October 5th, 2010, 7:05 pm

QuoteOriginally posted by: quantmehQuoteOriginally posted by: CuchulainnYou guys are in the 90's. Have you seen the computer games kids play these days?iPhone fart machines?I rest my case.
 
User avatar
Cuchulainn
Posts: 23029
Joined: July 16th, 2004, 7:38 am

Quants : C++ vs. C#

November 8th, 2010, 6:46 pm

Is this an acceptable way to program?Both C# and C++ to be considered.
Last edited by Cuchulainn on November 7th, 2010, 11:00 pm, edited 1 time in total.
 
User avatar
Hansi
Posts: 41
Joined: January 25th, 2010, 11:47 am

Quants : C++ vs. C#

November 8th, 2010, 9:40 pm

QuoteOriginally posted by: CuchulainnIs this an acceptable way to program?Both C# and C++ to be considered.Depends on how low you define your acceptability standards?
 
User avatar
renorm
Posts: 1
Joined: February 11th, 2010, 10:20 pm

Quants : C++ vs. C#

November 9th, 2010, 1:29 am

C++ fragment is legal. But I would do it differently.
 
User avatar
Cuchulainn
Posts: 23029
Joined: July 16th, 2004, 7:38 am

Quants : C++ vs. C#

November 9th, 2010, 6:33 am

I saw it in a C# library. I suspect it is a trck to avoid having to write void doit(ref x). Non-standard.
Last edited by Cuchulainn on November 8th, 2010, 11:00 pm, edited 1 time in total.
 
User avatar
Cuchulainn
Posts: 23029
Joined: July 16th, 2004, 7:38 am

Quants : C++ vs. C#

January 28th, 2011, 8:25 am

I did a straight port of some C++ pricing code to C# directly. The data structure were mainly matrices (I have the same ones in both languages). The port was easy and I got the same results.Regarding speed, C# was faster. I could do optimisation of course but the point is that we might expect C++ is always faster but really some decent tests should be done to prove or disprove claims. Has anyone any anecdotes on C++ versus C# speed?
Last edited by Cuchulainn on January 27th, 2011, 11:00 pm, edited 1 time in total.
 
User avatar
jikan
Posts: 0
Joined: April 9th, 2008, 10:07 am

Quants : C++ vs. C#

January 28th, 2011, 9:16 am

The common missconception is to think that just programming in C++ means faster executables. That simply is not true. Is much easier to write the fastest code in C than in C++. Writing very fast code in C++ is very difficult and it takes a very long time to master the craft. Don't compare your C++ to C# or Java. Compare it to C too.
 
User avatar
Cuchulainn
Posts: 23029
Joined: July 16th, 2004, 7:38 am

Quants : C++ vs. C#

January 28th, 2011, 9:45 am

QuoteOriginally posted by: jikanThe common missconception is to think that just programming in C++ means faster executables. That simply is not true. Is much easier to write the fastest code in C than in C++. Writing very fast code in C++ is very difficult and it takes a very long time to master the craft. Don't compare your C++ to C# or Java. Compare it to C too.Indeed.But given that most (??) quant developers use OOP in C# and C++ then the use of C would be less widespread. In this case I cannot compare it with C since the code is already OO. It's a trade-off between performance and maintainability. So, what is more important, machine or human performance?
Last edited by Cuchulainn on January 27th, 2011, 11:00 pm, edited 1 time in total.
 
User avatar
renorm
Posts: 1
Joined: February 11th, 2010, 10:20 pm

Quants : C++ vs. C#

January 28th, 2011, 10:46 am

@CuchulainnMatrix algebra is usually memory limited. Also, make sure that C++ code has debug checks disabled. MS compilers use security checks even in release mode. The same is true for UBLAS.Straightforward ALU or memory limed code won't run slower on C# or Java. The proper way to do numeral benchmarking is by comparing complete optimized modules. Compare MKL (Fortran/C), IPP (C/C++), Atlas (Fortran/C), Eigen (C++) or FFTW (C) vs the best C# implementation (is there any?).@jikan. C can't be faster than C++, since C++ includes C as its subset. All C++ compilers can compile C code as well. Apples to apples C++ is no faster or slower than C, since they are the apples from the same tree.
Last edited by renorm on January 27th, 2011, 11:00 pm, edited 1 time in total.
 
User avatar
jikan
Posts: 0
Joined: April 9th, 2008, 10:07 am

Quants : C++ vs. C#

January 28th, 2011, 10:51 am

No, C is not faster than C++ but what I meant is that it's easier to code faster code in C than C++ (well, except if you use C++ as a "better C", then it's just the same).
 
User avatar
renorm
Posts: 1
Joined: February 11th, 2010, 10:20 pm

Quants : C++ vs. C#

January 28th, 2011, 11:00 am

QuoteBut given that most (??) quant developers use OOP in C# and C++ then the use of C would be less widespread. In this case I cannot compare it with C since the code is already OO.There is no reason to use pure C these days, unless your code needs to run on systems where no C++ compiler is available. C++ can be used just like C. You get better type safety and better name scoping as bonus. Nothing will stop you from ditching STL and hand crafting your own stuff.