Pages: 1 [2]
|
 |
|
Author
|
Topic: pxib is wasting time (Read 15459 times)
|
Murgos
Terracotta Army
Posts: 7474
|
I haven't done anything with C#, but I assumed it was mostly like Java, where everything is really a pointer (with "." instead of "->" to follow them). What's this "no pointers outside managed code" business?
Yes, everything is passed by reference. Even type's are really objects, mostly. I.e there are Integers and integers. Integer is an object that encapsulates an integer and provides things like print() and etc... through the dot operator. Unlike Java though, if I want, to I can drop into unmanaged code and alloc() and free() and dereference to my hearts content.
|
"You have all recieved youre last warning. I am in the process of currently tracking all of youre ips and pinging your home adressess. you should not have commencemed a war with me" - Aaron Rayburn
|
|
|
Morat20
Terracotta Army
Posts: 18529
|
I haven't done anything with C#, but I assumed it was mostly like Java, where everything is really a pointer (with "." instead of "->" to follow them). What's this "no pointers outside managed code" business?
Yes, everything is passed by reference. Even type's are really objects, mostly. I.e there are Integers and integers. Integer is an object that encapsulates an integer and provides things like print() and etc... through the dot operator. Unlike Java though, if I want, to I can drop into unmanaged code and alloc() and free() and dereference to my hearts content. Historically -- and this was in C++ only, at any rate -- I've found that breaking out of the Object Oriented framework isn't worth it. Either you committ, 100% and design it from the ground up, or you don't. Not that there weren't occasional times, when for sheer speed we might have ditched that (but in that instance, we ended up writing a pure C bit to do it, and had to rewrite some basic C libraries to speed them up. We were really pushing the hardware and networks at that point). But I try not to mix them, because it ends up shafting me down the road. It's frustrating, or at least it was in C++, to have to step back and work out a way to handle something inside the OO framework when I had a perfectly viable and easy solution at hand, but it made for stronger code in the long run. At least, I thought it did.
|
|
|
|
Murgos
Terracotta Army
Posts: 7474
|
I wasn't advocating using a mis-mash of OO and procedural code. I was pointing out that you can use unmanaged code if you need to perform some tricky bit of referencing (most likely for a speed issue).
Don't let that the terms are Alloc and Free throw you (as opposed to new and delete in C++), it's what they are called in the C# object that handles them.
|
"You have all recieved youre last warning. I am in the process of currently tracking all of youre ips and pinging your home adressess. you should not have commencemed a war with me" - Aaron Rayburn
|
|
|
Morat20
Terracotta Army
Posts: 18529
|
I wasn't advocating using a mis-mash of OO and procedural code. I was pointing out that you can use unmanaged code if you need to perform some tricky bit of referencing (most likely for a speed issue).
Don't let that the terms are Alloc and Free throw you (as opposed to new and delete in C++), it's what they are called in the C# object that handles them.
I went out and looked it up. :) I'm glad the flexibility is there. I looked at rewriting what I had (I do have some serious speed issues with what I'm doing), but it looks like my bottleneck remains I/O -- I'm going to move off flat-files to a DB, I think. I didn't have the time to do it before, but it ought to help. Nothing I'm going to do is going to push this thing much lower than 8 hours for a full run. I might try threading it and running some of it in parallel, but it's about 95% pure iterative -- not much to gain there, and probably not worth the effort.
|
|
|
|
pxib
Terracotta Army
Posts: 4701
|
I now consider myself proficient at C# and have grokked object-oriented C by connecting it to my Lisp experience.
Thanks again for the advice, folks. I now move on to C++.
|
if at last you do succeed, never try again
|
|
|
|
Pages: 1 [2]
|
|
|
 |