Page 5 of 37

Re: Development Blah: Comments

Posted: Wed Aug 03, 2011 7:21 am
by karx11erx
Me being proficient in C#.

Re: Development Blah: Comments

Posted: Sat Aug 20, 2011 5:25 am
by Woodpecker
Forgive my naive question, but would it be easier or even possible to leave the more complicated bits of DLE-XP's code in C++? I'm not a programmer, but I've read that some professional software has parts of its code in various languages depending on which is the best fit for that section of code's requirements. So the parts of DLE-XP which would require long-winded ports would be left as C++ and the rest ported, then a programme written to hold them all together?

Re: Development Blah: Comments

Posted: Sat Aug 20, 2011 8:08 am
by karx11erx
How would that help me in learning C#?

Re: Development Blah: Comments

Posted: Sat Aug 20, 2011 8:24 am
by Sirius
It's definitely possible - easier would vary on a case-by-case basis - but the goals of the project come first, obviously.

Re: Development Blah: Comments

Posted: Sun Aug 21, 2011 1:58 am
by Woodpecker
karx11erx wrote:How would that help me in learning C#?

You mentioned that you were having to create long, tedious, and inefficient workarounds, which you didn't enjoy coding, in order to port certain parts of DLE-XP into C#. I offered a short and simple solution. I understand the interest in learning the finer points of C#, but why would you do that at the expense of the code? Until now you've worked very hard to make the code as short and concise as possible. It seems a waste of time to throw that all away. :clue:

Re: Development Blah: Comments

Posted: Sun Aug 21, 2011 7:38 am
by karx11erx
How does leaving certain code in C++ help me in understanding that in C# I have to build such work arounds, and how to do it? Do you think that in the industry you will always be able or allowed to use unmanaged code (i.e. C++) in a managed code (e.g. C#) project?

You could have figured that yourself, couldn't you?

Re: Development Blah: Comments

Posted: Sun Aug 21, 2011 9:34 am
by Woodpecker
karx11erx wrote:How does leaving certain code in C++ help me in understanding that in C# I have to build such work arounds, and how to do it? Do you think that in the industry you will always be able or allowed to use unmanaged code (i.e. C++) in a managed code (e.g. C#) project?

You could have figured that yourself, couldn't you?

No of course I don't think that, and yes I did figure it out for myself. I don't have a problem with you learning how to do those workarounds. My concern was simply that you were complaining about having to do long and tedious workarounds when they weren't necessarily required. I was trying to be helpful, that's all. :)

Re: Development Blah: Comments

Posted: Sun Aug 21, 2011 11:53 am
by karx11erx
No, I am complaining about C# not leaving me a more performant and simpler way to code. ;)

Re: Development Blah: Comments

Posted: Mon Aug 22, 2011 2:58 am
by Sirius
It's a managed language, like Java, which means it's going to be dumbed down in places - so yeah, there will be catches like that. I've yet to hear of a language that gives you the best of both worlds unfortunately.

Re: Development Blah: Comments

Posted: Mon Aug 22, 2011 8:56 am
by karx11erx
It's not just that it's managed. Why the heck do I e.g. have to allocate each object separately on the heap? If I allocate an array of objects in C++ (class X [] a = new class X [100]), I am already having 100 instances of objects of class X - in C# I only have allocated an array of pointers that way. That makes many operations on the array slow and causes a tremendous overhead on the heap and in the memory management. Now think of an application not having a few hundred, but thousands or millions of objects.

I cannot even directly read an array of shorts from an array - the reading functions all return byte[], and I cannot cast between array types. If you want unions, you actually have to have more knowledge about struct layouts and data type sizes than in C++, because you need to manually specify the union member offsets using some hair raising syntax. How is that more advanced and safer than having the compiler do this?

Etc. etc. :rant:

Re: Development Blah: Comments

Posted: Mon Aug 22, 2011 9:08 am
by Ben K
C# seems to be designed for people who have mainly been taught Java (such as me) and have never heard of a segmentation fault (not so much me :mrgreen:).

Re: Development Blah: Comments

Posted: Mon Aug 22, 2011 9:18 am
by karx11erx
It's for the big mass of programmers who aren't really capable of disciplined, structured, precise programming and have no knowledge about how a computer and an OS work. It's for those people who otherwise would inevitably create big heaps of unreadable, jumbled spaghetti code. It's for those people who should have never been allowed to write a program at all.

imvho. :twisted:

Of course I am exaggerating, but there's something to what I wrote. C# has its uses - but not everywhere.

Re: Development Blah: Comments

Posted: Mon Aug 22, 2011 4:38 pm
by Sirius
Ah, that. Unlike in C/C++, where you can do things like that - or trivially allocate an array of zeroed structs - or other things like that... you have to loop through and create them all. They can be deallocated easily at least, but initialization is extra code and I bet it's slower as well.

And I vaguely recall running into some issue where ... yeah, I think it actually was to do with short ints - it didn't seem to handle them quite properly due to some missing function for that specific data type. I remember having to do some silly bit-shifting stuff to work around it as well.

The very, very most ass-pain I've had with C# would have been trying to p/invoke Win32 APIs that took complicated structures (or arrays of structures) involving a few pointers and the like. It takes forever to figure out how to get things to work because the documentation on the subject isn't exactly comprehensive - ultimately I still had to do a lot of guessing. (Of course the error codes don't help - the best you tend to get is "invalid parameter". Well thanks, who'd have thought?) As a result if I'm going to do interop interfaces I stick with simple, easily marshalled data types. If it calls for anything object-like (such as structs), out comes COM... yaaaaaay...

Re: Development Blah: Comments

Posted: Mon Aug 22, 2011 7:34 pm
by karx11erx
Sirius wrote:If it calls for anything object-like (such as structs), out comes COM... yaaaaaay...

:lolol:

Re: Development Blah: Comments

Posted: Sat Aug 27, 2011 4:45 pm
by Alter-Fox
karx11erx wrote:It's for the big mass of programmers who aren't really capable of disciplined, structured, precise programming and have no knowledge about how a computer and an OS work. It's for those people who otherwise would inevitably create big heaps of unreadable, jumbled spaghetti code. It's for those people who should have never been allowed to write a program at all.


Ah... so then it's for Parallax Software. :lol: