What's Your Favorite Language?

Q&A, advice, reviews, and news about the computers, phones, TVs, stereos, and pretty much anything else that can't be easily whittled out of a stick or chipped out of stone.
RyuuNoSenshi
Redshirt
Posts: 56
Joined: Fri Jul 04, 2003 2:37 am
Location: Somewhere in subspace
Contact:

Post by RyuuNoSenshi » Fri Aug 22, 2003 4:16 am

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*.
Me: Alright I'll stand here...try to crush me with the...*the Warthog lands on top of me*
Matt: Done and done.
Me: Ahh! My Corpse is stuck in the tire!

Polarix
Redshirt
Posts: 29
Joined: Sat Jun 28, 2003 4:30 am
Location: CA
Contact:

Post by Polarix » Fri Aug 22, 2003 6:30 am

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.
Greg

desertfox
Redshirt
Posts: 69
Joined: Thu Aug 07, 2003 12:41 pm
Location: Pittsburgh, PA

Re: What's Your Favorite Language?

Post by desertfox » Fri Aug 22, 2003 2:46 pm

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 =)

Polarix
Redshirt
Posts: 29
Joined: Sat Jun 28, 2003 4:30 am
Location: CA
Contact:

Post by Polarix » Sat Aug 23, 2003 1:43 am

[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?
Greg

User avatar
ChronoSword
Redshirt
Posts: 2441
Joined: Sat Apr 12, 2003 8:44 am
Gender: Male
Location: Raleigh

Post by ChronoSword » Sat Aug 23, 2003 2:18 am

Java is my language of choice, of course, that is all I know.

Bruce
Redshirt
Posts: 295
Joined: Tue Feb 18, 2003 12:41 pm
Location: Melbourne
Contact:

Post by Bruce » Sat Aug 23, 2003 8:58 am

> 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.
Just because life sucks, it doesnt mean you have to care.

desertfox
Redshirt
Posts: 69
Joined: Thu Aug 07, 2003 12:41 pm
Location: Pittsburgh, PA

Re: What's Your Favorite Language?

Post by desertfox » Sat Aug 23, 2003 4:46 pm

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 =)

Locked

Who is online

Users browsing this forum: No registered users and 1 guest