I have to say I'm sorry BoB, I guess I tend to write too generally, and tend to exagerate a bit too much when I write fast. And computers only understand two things, on and off, electrical current on or electrical current off(using binary math). The computer language is nothing more than a way for human beings to make things work without directly doing it in binary. The compiler takes the code, parses it, then writes a file of what the code would translate to in binary. And by saying C/C++ evovled to fill the gap, I mean it and languages came about to fill the gap between pure binary and human language. To make things more easy to do and to make programs shorter. For human beings and computers work in quite different ways.
Ohh and I should have said Java was ALMOST purely class based. And no it doesn't make it a bad language per say. But it's my personnal preferance to have a computer language to be as effecient as it can be. But now if you want a bad language...try visual basic *chuckles*.
What's Your Favorite Language?
-
RyuuNoSenshi
- Redshirt
- Posts: 56
- Joined: Fri Jul 04, 2003 2:37 am
- Location: Somewhere in subspace
- Contact:
That Java vs. C++ test results differs greatly from my experience with both. I have almost always found Java very slow.
C++ is my language of choice, though Scheme is quite nice too if you can learn to love it. MZScheme, to be specific. It has arbitrary precision. Too bad it's slow and pretty inflexible.
This arbitrary precision is actually my "current" programming challenge right now. What I want to be able to do is to have limitless precision in integers and floating point numbers (limited only by the memory available of course). I would want them to be able to perform all of the standard operations with one another. Once this was done, I would build a huge library of mathematics functions on top of them.
The two methods I thought of going about it were either to try to reproduce all the operations at a low level, or to try to get some dynamic memory allocation action going on. Since I know nothing about dynamic memory allocation, I tried to reproduce all the operations at the lowest level possible, but that entirely broke down for a general power formula and change of base, so I kind of gave up. If anyone here either knows anything about dynamic memory allocation or where I could go to learn about it, I would instantly restart the project, which would just be really cool.
C++ is my language of choice, though Scheme is quite nice too if you can learn to love it. MZScheme, to be specific. It has arbitrary precision. Too bad it's slow and pretty inflexible.
This arbitrary precision is actually my "current" programming challenge right now. What I want to be able to do is to have limitless precision in integers and floating point numbers (limited only by the memory available of course). I would want them to be able to perform all of the standard operations with one another. Once this was done, I would build a huge library of mathematics functions on top of them.
The two methods I thought of going about it were either to try to reproduce all the operations at a low level, or to try to get some dynamic memory allocation action going on. Since I know nothing about dynamic memory allocation, I tried to reproduce all the operations at the lowest level possible, but that entirely broke down for a general power formula and change of base, so I kind of gave up. If anyone here either knows anything about dynamic memory allocation or where I could go to learn about it, I would instantly restart the project, which would just be really cool.
Greg
Re: What's Your Favorite Language?
Stormpawe,
Properly written C++ code should not be any more unsafe than equivalent Java code. I find C++ to be a MUCH more expressive language than Java, as C++ offers powerful tools like templates, and to a certain extent, macros (when used properly!) to help you write code. You should read some of the stuff at http://www.cuj.com to really see how far C++ has come lately. Your brother would be better off learning C++ and how to properly release allocated resources than to just switch to Java and let it handle the deallocation automatically. Learning something about memory management makes you a better programmer.
Polarix,
Are you talking about dynamic memory allocation in C++? If so, look up new and delete =)
Properly written C++ code should not be any more unsafe than equivalent Java code. I find C++ to be a MUCH more expressive language than Java, as C++ offers powerful tools like templates, and to a certain extent, macros (when used properly!) to help you write code. You should read some of the stuff at http://www.cuj.com to really see how far C++ has come lately. Your brother would be better off learning C++ and how to properly release allocated resources than to just switch to Java and let it handle the deallocation automatically. Learning something about memory management makes you a better programmer.
Polarix,
Are you talking about dynamic memory allocation in C++? If so, look up new and delete =)
[quote="RyuuNoSenshi";p="131206"]Just because today's computers are faster, have more ram and disk space and are cheaper doesn't mean that you should write bloated, over sized, resource guzzling programs.[/quote]
I agree with this to an extent, but I would favor stability and reliability over clever code at this point. Whenever possible, obviously, one should write clean and crisp code, but NOT at the expense of reliability.
In a world dominated by software, such as the one we are moving towards, software MUST be rock solid. I define a great programmer as one who writes software that does not break. Everything else is secondary.
[quote="desertfox";p="140375"]Are you talking about dynamic memory allocation in C++? If so, look up new and delete =)[/quote]
Yes, I know about those... I guess I should be more specific. Is there any way to make an "int" that is actually as long as you want it to be? I know you can make long long long long ints, but can I specify a size in bytes? Might there be some way concerning malloc that could do this?
I agree with this to an extent, but I would favor stability and reliability over clever code at this point. Whenever possible, obviously, one should write clean and crisp code, but NOT at the expense of reliability.
In a world dominated by software, such as the one we are moving towards, software MUST be rock solid. I define a great programmer as one who writes software that does not break. Everything else is secondary.
[quote="desertfox";p="140375"]Are you talking about dynamic memory allocation in C++? If so, look up new and delete =)[/quote]
Yes, I know about those... I guess I should be more specific. Is there any way to make an "int" that is actually as long as you want it to be? I know you can make long long long long ints, but can I specify a size in bytes? Might there be some way concerning malloc that could do this?
Greg
- ChronoSword
- Redshirt
- Posts: 2441
- Joined: Sat Apr 12, 2003 8:44 am
- Gender: Male
- Location: Raleigh
> Yes, I know about those... I guess I should be more specific. Is there any way to make an "int" that is actually as long as you want it to be? I know you can make long long long long ints, but can I specify a size in bytes? Might there be some way concerning malloc that could do this?
Generally this is done through variable types provided in libraries that depend on the platform which you are compiliing under. For example SDL provides Uint16, Sint32, etc.
Generally this is done through variable types provided in libraries that depend on the platform which you are compiliing under. For example SDL provides Uint16, Sint32, etc.
Just because life sucks, it doesnt mean you have to care.
Re: What's Your Favorite Language?
Polarix,
What you're probably going to have to do is allocate a larger chunk of memory, say an array of X number of integers. Then, you'd probably have to handle the overflow manually when you add, subtract, etc. That's pretty much the only way I can think of if you essentially want to do an integer that can hold as large a number as you want. Now, for reals...that will be somewhat more complicated, as you're dealing with precision and not just size. I'm not entirely sure how I'd handle it.
good luck =)
What you're probably going to have to do is allocate a larger chunk of memory, say an array of X number of integers. Then, you'd probably have to handle the overflow manually when you add, subtract, etc. That's pretty much the only way I can think of if you essentially want to do an integer that can hold as large a number as you want. Now, for reals...that will be somewhat more complicated, as you're dealing with precision and not just size. I'm not entirely sure how I'd handle it.
good luck =)
Who is online
Users browsing this forum: No registered users and 1 guest