The worst code i've ever seen....
-
Huh, I don't know Java. But I don't think it's that bad. C# isn't too fast, too. But there are pretty much features in C# now I don't want to miss like (automatic) properties, WPF, LINQ, extension functions,...
elektrowolf wrote:
C# isn't too fast, too
Uh, ***trying not to sound rude***, how inefficiently do you code?
-
Dude, I am not sure you are familiar with value and reference types at all; it has nothing to do with ICloneable... As a GUI developer I may speak of the following advantages of Java Swing over .NET 2.0: Java is completely detached from the underlying OS - .NET is using Interop primarily; 99% of the controls are wrappers of their Win32 equivalents; you need to know Win32 API in order to create commercial controls. Let me mention that things are different in WPF - there is actual bridge which separates OS from the GUI. But still, WPF consumes lot of memory and is not the platform a company, which cares about performance, would choose on... That is my personal opinion of course.
Thanks, Georgi
Georgi Atanasov wrote:
That is my personal opinion of course.
And which is why you can get away being so wrong ;P On a little more serious note...
Georgi Atanasov wrote:
Java is completely detached from the underlying OS
So? If it works then why not?
Georgi Atanasov wrote:
99% of the controls are wrappers of their Win32 equivalents; you need to know Win32 API in order to create commercial controls
I'm not sure i'd agree; I've created a Office Fleunt Ribbon control library using nothing more than WPF, which i'm happily using in a commercial grade application, with no problems (http://www.codeproject.com/KB/WPF/ribboncontrol.aspx[^], see also CIRIP).
Georgi Atanasov wrote:
WPF consumes lot of memory
It's a new technology, and so not full optimised yet; hey if you want to moan about something *new* then why not have a go about the lack of an open and save dialog. I'm sure exactly the same was said of MFC, Swing, etc.
Georgi Atanasov wrote:
is not the platform a company, which cares about performance, would choose on...
There are companies using it, admitadly few currently but growing by the day. Yes, performance is shocking until you learn how to use it properly and then it's more than fast enough. Companies in my eyes don't care about performance, they care about cost to produce something that does the job, and from my experience WPF reduces development time (after over 4-5 years of Windows Forms (and Java Swing for that matter) and only <6 months WPF programming).
-
I think is the main difference between value and reference types is, that if you write
x = y
and y is a value type, x contains a copy of y, while when y is a reference type, x contains a reference to y. To copy y, y is required to ICloneable. Is that false?perhaps a better example might be x = y y.a_property = some_value if (x.a_property == y.a_property) then referance type else value type
-
Chris Maunder wrote:
...and all the java crowd say the same thing about .NET. Move on, nothing to see
But of course, they are wrong and we are right. Why? Well, because we are, well.... us.
Deja View - the feeling that you've seen this post before.
Pete O'Hanlon wrote:
Chris Maunder wrote: ...and all the java crowd say the same thing about .NET.
***to the tune of big ben*** Wrong wrong wrong wrong..... wrong wrong wrong wrong...... wrong.... wrong... wrong....
-
perhaps a better example might be x = y y.a_property = some_value if (x.a_property == y.a_property) then referance type else value type
OK, but basically it's the same. So what did I understand wrong? It does have something to do with ICloneable, or not?
-
elektrowolf wrote:
C# isn't too fast, too
Uh, ***trying not to sound rude***, how inefficiently do you code?
.. I mean compared to C++. I don't think it's too slow, I've never had problems with C#'s performance, but for some algorithms you need C++.
-
.. I mean compared to C++. I don't think it's too slow, I've never had problems with C#'s performance, but for some algorithms you need C++.
elektrowolf wrote:
but for some algorithms you need C++.
like what? Yes, i'd agree there is a slight performance decrease compaired to c++ but it's neglible.
-
OK, but basically it's the same. So what did I understand wrong? It does have something to do with ICloneable, or not?
referance and values types have very little to do with ICloneable... values types a guess are effectively implementors of ICloneable as x = y produces essentially a clone of x
-
referance and values types have very little to do with ICloneable... values types a guess are effectively implementors of ICloneable as x = y produces essentially a clone of x
It is obvious that you are not familiar (to be honest your guesses amused me pretty much :)) with Value and Reference types - you may try the following article (the first found one after search). http://www.codeproject.com/KB/dotnet/Primitive_Ref_ValueTypes.aspx[^] If I may advise you - you need read more about the basics of .NET such as Common Language Runtime (CLR), IL, value and reference types, etc. And do not be that arrogant:
Derek Bartram wrote:
Uh, ***trying not to sound rude***, how inefficiently do you code?
. Having in mind that you even dare to compare the performance of native C++ against .NET and after examining some code from your "Famous" Ribbon library I am not completely sure that you are an efficiency master...
Thanks, Georgi
modified on Sunday, April 13, 2008 4:52 PM
-
.net slower than java or java slower than .net.... I can justify java slower than .net with about 10 minutes of coding (and 30mins of java tools downloads). Please don't ask me too though, really don't want the hassel of downloading java stuff.
HI Can you show me some written proof(Link to the articles, journal's, books etc) that C# is better than Java or vice versa. You can not comment on anything unless there is any written evidence for it. I am waiting for the proof... :) ta
modified on Sunday, April 13, 2008 8:42 PM
-
Dude, I am not sure you are familiar with value and reference types at all; it has nothing to do with ICloneable... As a GUI developer I may speak of the following advantages of Java Swing over .NET 2.0: Java is completely detached from the underlying OS - .NET is using Interop primarily; 99% of the controls are wrappers of their Win32 equivalents; you need to know Win32 API in order to create commercial controls. Let me mention that things are different in WPF - there is actual bridge which separates OS from the GUI. But still, WPF consumes lot of memory and is not the platform a company, which cares about performance, would choose on... That is my personal opinion of course.
Thanks, Georgi
OK, basically, they have nothing to do with ICloneable. But if you want to create a copy of a reference type, this type needs to implement ICloneable, whilst in C++, reference types can be both referenced and copied by default and you can define a copy constructor to change the copying process. I think this is solved much better in C++.
-
Pete O'Hanlon wrote:
Chris Maunder wrote: ...and all the java crowd say the same thing about .NET.
***to the tune of big ben*** Wrong wrong wrong wrong..... wrong wrong wrong wrong...... wrong.... wrong... wrong....
I hope you realise that my post was meant to be ironic.
Deja View - the feeling that you've seen this post before.
-
At NJIT they teach java now. Luckily, when i had to take those programming classes, it was all c++. I have reason to be happy actually... it allowed me to more or less understand the class-less C language... which, when i got to my microprocessor class where we did alot of 68k assemebly... that i was able to see the logical connection from which the C language is derived... because Assembly is just a lower level obvioussly-class-less C where you program with just functions, ...well they call em subroutines... but ya... When i was in high-school i had a class that did both java and c++... it was in that class that my hatred of Java indirectly started... You see we used the free compiler and wrote all our code in notepad. But anyone that ever programmed in c# in visual studio knows... that the Ide is what really makes coding fun... all that intelli-sense and code designer and the form designer and the addins... Ohh the addins! :P... anyways... Debugging in notepad is a bitch... you gotta count the lines... Overall that's why c++ was more fun (cause we had that old visual studio... called vs6 or something... but the debugger was a godsend... double click the error and it goes to the line with the error... wow... and the error messages actually made sense over what devcpp gave you (which i used for my homework at that time... untill i learned about something called kazaa :D) Anyways when i was a sophmore or something i was like... i gotta learn a language that's fun and fast... for personal projects... i was thinking visual basic might be a good idea... i already knew that java was a complete pos that was slow and the forms looked like complete dog crap...well that was visual studio 2003 installed and i saw in the loading screen the icon for J# and C#... well first i thought... well i know some java, maybe i'd give it another try in J#... then i looked at a blank Form project and at the using statements and crap... and was like... ya maybe i'll just use visual basic.net.... And then i tried c#... at first i was completely utterly confused mind you... but the syntax i think was just nice... when i create my first object like with the "new" keyword and how all int objects could be easily and painlessly ".ToString"'d... well that was when i was in love :P Wow i still remember the first time i learned of the property syntax... before that i was like... how the hell do you "communicate with a class".... Or when i was writting a silly program to be as a companion to a game called "Raven Shield" that would work wi
FocusedWolf wrote:
At NJIT they teach java now.
Which is why, having been accepted to both, I plan to go to Rensselaer Polytechnic. I've been using C++ since I was ten years old and I don't want to give it up for four years!
-
.net slower than java or java slower than .net.... I can justify java slower than .net with about 10 minutes of coding (and 30mins of java tools downloads). Please don't ask me too though, really don't want the hassel of downloading java stuff.
And in 45 seconds I can prove to you that native C++ with ASM optimizations will run rings around them both.
-
It is obvious that you are not familiar (to be honest your guesses amused me pretty much :)) with Value and Reference types - you may try the following article (the first found one after search). http://www.codeproject.com/KB/dotnet/Primitive_Ref_ValueTypes.aspx[^] If I may advise you - you need read more about the basics of .NET such as Common Language Runtime (CLR), IL, value and reference types, etc. And do not be that arrogant:
Derek Bartram wrote:
Uh, ***trying not to sound rude***, how inefficiently do you code?
. Having in mind that you even dare to compare the performance of native C++ against .NET and after examining some code from your "Famous" Ribbon library I am not completely sure that you are an efficiency master...
Thanks, Georgi
modified on Sunday, April 13, 2008 4:52 PM
Georgi Atanasov wrote:
It is obvious that you are not familiar (to be honest your guesses amused me pretty much ) with Value and Reference types
I've just read the article and can't see anything wrong with my earlier post specifically; perhaps you could be more specific please. Thank you for the link however as it does clarify a few implementation details of how value and type referances work; however those details didn't relate to the orriginal question.
Georgi Atanasov wrote:
need read more about the basics of .NET such as Common Language Runtime
As a developer of .NET for 5-6 years I've never had a problem yet, and amongst my peer group I am considered a good programmer, so perhaps I question this.
Georgi Atanasov wrote:
And do not be that arrogant:
I wasn't being arrogant, in fact I was deliberatly trying not to be; however writing efficient code and algorithms is challenging (and I would happily admit i'm no expert, however subjectively I would say I'm pretty good). Efficiency of coding often impacts performance more than code, and as someone from an innitial Java background there was were many things I used to do 'wrong' in .net initially when I transfered languages that did have an impact on performance. I appologise if offence was taken.
Georgi Atanasov wrote:
Having in mind that you even dare to compare the performance of native C++ against .NET
Firstly doing a comparison of high level libraries such as my Ribbon Control Library is generally not a suitable test as too many implementation issues are often prevalent. A number of years ago (and this has been repeated by a number of my colegues) we developed a series of rather primative tests to analyse the performance of a few main basic language functions (data read, addition, subtration, multiplication, division, list sorting etc), and for Java vs. C# .NET the .NET language out performed Java by a significant degree and more importantly consistantly. While I havn't perform a similar test myself I have heard of colegues performing the test upon .NET and native C++ and the difference is not that significant (although granted C++ did outperform consistently).
Georgi Atanasov wrote:
after examining some code from your "Famous" Ribbon library I am not c
-
OK, basically, they have nothing to do with ICloneable. But if you want to create a copy of a reference type, this type needs to implement ICloneable, whilst in C++, reference types can be both referenced and copied by default and you can define a copy constructor to change the copying process. I think this is solved much better in C++.
elektrowolf wrote:
you can define a copy constructor to change the copying process
Isn't that then just an implementation or rather synatic difference then.
elektrowolf wrote:
copied by default
While certainly clever (and a function by the sounds of it I would like in .net), it sounds like it has the potential to be rather dangerous. Consider; object a contains b contains c part of dataset d cloning a potentially may be cloning d as well?
-
I hope you realise that my post was meant to be ironic.
Deja View - the feeling that you've seen this post before.
Pete O'Hanlon wrote:
I hope you realise that my post was meant to be ironic.
lol, the perils of plain text. Perhaps someone should make a way of displaying text with the empesis being more obvious. At least there is a silver lining; we both agree :)
-
elektrowolf wrote:
you can define a copy constructor to change the copying process
Isn't that then just an implementation or rather synatic difference then.
elektrowolf wrote:
copied by default
While certainly clever (and a function by the sounds of it I would like in .net), it sounds like it has the potential to be rather dangerous. Consider; object a contains b contains c part of dataset d cloning a potentially may be cloning d as well?
Derek Bartram wrote:
Isn't that then just an implementation or rather synatic difference then.
Yeah, it's an implementation, I think.
Derek Bartram wrote:
cloning a potentially may be cloning d as well?
Yeah, for this you have the copy constructors. Then you can only reference the DataSet in the clone. But of course it's dangerous if you forget this..
-
Georgi Atanasov wrote:
It is obvious that you are not familiar (to be honest your guesses amused me pretty much ) with Value and Reference types
I've just read the article and can't see anything wrong with my earlier post specifically; perhaps you could be more specific please. Thank you for the link however as it does clarify a few implementation details of how value and type referances work; however those details didn't relate to the orriginal question.
Georgi Atanasov wrote:
need read more about the basics of .NET such as Common Language Runtime
As a developer of .NET for 5-6 years I've never had a problem yet, and amongst my peer group I am considered a good programmer, so perhaps I question this.
Georgi Atanasov wrote:
And do not be that arrogant:
I wasn't being arrogant, in fact I was deliberatly trying not to be; however writing efficient code and algorithms is challenging (and I would happily admit i'm no expert, however subjectively I would say I'm pretty good). Efficiency of coding often impacts performance more than code, and as someone from an innitial Java background there was were many things I used to do 'wrong' in .net initially when I transfered languages that did have an impact on performance. I appologise if offence was taken.
Georgi Atanasov wrote:
Having in mind that you even dare to compare the performance of native C++ against .NET
Firstly doing a comparison of high level libraries such as my Ribbon Control Library is generally not a suitable test as too many implementation issues are often prevalent. A number of years ago (and this has been repeated by a number of my colegues) we developed a series of rather primative tests to analyse the performance of a few main basic language functions (data read, addition, subtration, multiplication, division, list sorting etc), and for Java vs. C# .NET the .NET language out performed Java by a significant degree and more importantly consistantly. While I havn't perform a similar test myself I have heard of colegues performing the test upon .NET and native C++ and the difference is not that significant (although granted C++ did outperform consistently).
Georgi Atanasov wrote:
after examining some code from your "Famous" Ribbon library I am not c
Derek, I am glad that you have noticed the arrogance - it was intentional - take my apologies. I just wanted to show you that it is not good to show such attitude when talking with other people. I got somehow angry to one how says Java is the worst code ever. Think about this - why in your opinion SAP have chosen Java? And do you know that Java world is larger than the .NET one and that there are more billions in the Java market? As I mentioned in an earlier post I code in .NET also but nevertheless Java has its own advantages - it is actually PLATFORM INDEPENDENT, does not have Interop calls in the class library, only in its runtime, etc. I think you miss some of my statements - TILL WPF (things are different there) every Windows Forms Control is a Win32 Handle wrapper, with lots of Interop underneath. OK, about the Value and Reference types - these are the two basic types in .NET. Value types are special objects, which reside on the Stack and are accessed by copying their values (of course you may always pass a value type by ref). Reference (or instance) types on the other hand are objects, which reside on the managed heap, reserved by the CLR, and are accessed by reference. These objects are target of the Garbage Collector. There are other differences which are not in this scope. So, they have NOTHING to do with ICloneable, value types are not ICloneable implementors. This interface is used when an exact copy of a Reference type is required and it is each type's task to implement the "Clone". Thank you for taking the time to talk with me :)
Thanks, Georgi
-
Derek, I am glad that you have noticed the arrogance - it was intentional - take my apologies. I just wanted to show you that it is not good to show such attitude when talking with other people. I got somehow angry to one how says Java is the worst code ever. Think about this - why in your opinion SAP have chosen Java? And do you know that Java world is larger than the .NET one and that there are more billions in the Java market? As I mentioned in an earlier post I code in .NET also but nevertheless Java has its own advantages - it is actually PLATFORM INDEPENDENT, does not have Interop calls in the class library, only in its runtime, etc. I think you miss some of my statements - TILL WPF (things are different there) every Windows Forms Control is a Win32 Handle wrapper, with lots of Interop underneath. OK, about the Value and Reference types - these are the two basic types in .NET. Value types are special objects, which reside on the Stack and are accessed by copying their values (of course you may always pass a value type by ref). Reference (or instance) types on the other hand are objects, which reside on the managed heap, reserved by the CLR, and are accessed by reference. These objects are target of the Garbage Collector. There are other differences which are not in this scope. So, they have NOTHING to do with ICloneable, value types are not ICloneable implementors. This interface is used when an exact copy of a Reference type is required and it is each type's task to implement the "Clone". Thank you for taking the time to talk with me :)
Thanks, Georgi
Georgi Atanasov wrote:
it is not good to show such attitude when talking with other people.
I'd agree certainly, however my original statement wasn't intended in perhaps the way it was percieved.
Georgi Atanasov wrote:
one how says Java is the worst code ever
I never said that (I hope), that would be Haskell perhaps. However as a programming language that claims to produce software for all purposes (essentially) then compaired to .NET it does have significant performance and memory limitations that to my mind at least make it all but crippled.
Georgi Atanasov wrote:
Java world is larger than the .NET one
I have heard that quoted before, and I wouldn't be as bold as too disagree, however I would say that just because it's used more doesn't make it good. Ask a linux advocate and they would use a similar argument perhaps.
Georgi Atanasov wrote:
it is actually PLATFORM INDEPENDENT
I don't dispute that Java some benefits, however I would argue that things like platform independance is very low on my list of priorities.
Georgi Atanasov wrote:
does not have Interop calls in the class library
If it doesn't make the language more complicated to use or of lower performance where is the advantage of not doing that?
Georgi Atanasov wrote:
I think you miss some of my statements
I was pretty careful to read your posts (and have double checked them before posting this), however while you are technically right in the aspects of java benefits you state, I question however they are of any significance to the average progremmer or perhaps even to industry. If a language is simple to use, works well, and performs well, does it really matter the underlying implementation issues?
Georgi Atanasov wrote:
OK, about the Value and Reference types - these are the two basic types in .NET. Value types are special objects, which reside on the Stack and are accessed by copying their values (of course you may always pass a value type by ref). Reference (or instance) types on the other hand are objects, which reside on the managed heap, reserved by the CLR, and are accessed by reference. These objects are target of the