Development Blah: Comments

All other topics around Descent and D2X-XL

Moderators: Frustikus, simX, Aus-RED-5

User avatar
karx11erx
D2X-XL Master
D2X-XL Master
Posts: 8112
Joined: Mon Sep 24, 2007 8:48 pm
Location: Wilferdingen, Germany
Contact:

Re: Development Blah: Comments

Postby karx11erx » Wed Aug 03, 2011 7:21 am

Me being proficient in C#.
Woodpecker
Posts: 129
Joined: Wed Oct 07, 2009 11:07 pm

Re: Development Blah: Comments

Postby Woodpecker » Sat Aug 20, 2011 5:25 am

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?
User avatar
karx11erx
D2X-XL Master
D2X-XL Master
Posts: 8112
Joined: Mon Sep 24, 2007 8:48 pm
Location: Wilferdingen, Germany
Contact:

Re: Development Blah: Comments

Postby karx11erx » Sat Aug 20, 2011 8:08 am

How would that help me in learning C#?
Sirius
Posts: 1990
Joined: Tue Sep 25, 2007 10:29 pm
Location: Bellevue, WA
Contact:

Re: Development Blah: Comments

Postby Sirius » Sat Aug 20, 2011 8:24 am

It's definitely possible - easier would vary on a case-by-case basis - but the goals of the project come first, obviously.
Woodpecker
Posts: 129
Joined: Wed Oct 07, 2009 11:07 pm

Re: Development Blah: Comments

Postby Woodpecker » Sun Aug 21, 2011 1:58 am

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:
User avatar
karx11erx
D2X-XL Master
D2X-XL Master
Posts: 8112
Joined: Mon Sep 24, 2007 8:48 pm
Location: Wilferdingen, Germany
Contact:

Re: Development Blah: Comments

Postby karx11erx » Sun Aug 21, 2011 7:38 am

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?
Woodpecker
Posts: 129
Joined: Wed Oct 07, 2009 11:07 pm

Re: Development Blah: Comments

Postby Woodpecker » Sun Aug 21, 2011 9:34 am

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. :)
User avatar
karx11erx
D2X-XL Master
D2X-XL Master
Posts: 8112
Joined: Mon Sep 24, 2007 8:48 pm
Location: Wilferdingen, Germany
Contact:

Re: Development Blah: Comments

Postby karx11erx » Sun Aug 21, 2011 11:53 am

No, I am complaining about C# not leaving me a more performant and simpler way to code. ;)
Sirius
Posts: 1990
Joined: Tue Sep 25, 2007 10:29 pm
Location: Bellevue, WA
Contact:

Re: Development Blah: Comments

Postby Sirius » Mon Aug 22, 2011 2:58 am

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.
User avatar
karx11erx
D2X-XL Master
D2X-XL Master
Posts: 8112
Joined: Mon Sep 24, 2007 8:48 pm
Location: Wilferdingen, Germany
Contact:

Re: Development Blah: Comments

Postby karx11erx » Mon Aug 22, 2011 8:56 am

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:
Ben K
Posts: 452
Joined: Sun Aug 24, 2008 7:21 am
Location: New Zealand
Contact:

Re: Development Blah: Comments

Postby Ben K » Mon Aug 22, 2011 9:08 am

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:).
User avatar
karx11erx
D2X-XL Master
D2X-XL Master
Posts: 8112
Joined: Mon Sep 24, 2007 8:48 pm
Location: Wilferdingen, Germany
Contact:

Re: Development Blah: Comments

Postby karx11erx » Mon Aug 22, 2011 9:18 am

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.
Sirius
Posts: 1990
Joined: Tue Sep 25, 2007 10:29 pm
Location: Bellevue, WA
Contact:

Re: Development Blah: Comments

Postby Sirius » Mon Aug 22, 2011 4:38 pm

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...
User avatar
karx11erx
D2X-XL Master
D2X-XL Master
Posts: 8112
Joined: Mon Sep 24, 2007 8:48 pm
Location: Wilferdingen, Germany
Contact:

Re: Development Blah: Comments

Postby karx11erx » Mon Aug 22, 2011 7:34 pm

Sirius wrote:If it calls for anything object-like (such as structs), out comes COM... yaaaaaay...

:lolol:
User avatar
Alter-Fox
Posts: 1132
Joined: Mon Mar 31, 2008 7:29 pm
Location: some other reality

Re: Development Blah: Comments

Postby Alter-Fox » Sat Aug 27, 2011 4:45 pm

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:
We live in a universe... It's distracting
=========================================================
beware of ounce

Return to “General Discussions”

Who is online

Users browsing this forum: No registered users and 7 guests