Gamingforce Interactive Forums
85239 35211

Go Back   Exploding Garrmondo Weiner Interactive Swiss Army Penis > Garrmondo Network > Help Desk
Register FAQ GFWiki Community Donate Arcade ChocoJournal Calendar

Notices

Welcome to the Exploding Garrmondo Weiner Interactive Swiss Army Penis.
GFF is a community of gaming and music enthusiasts. We have a team of dedicated moderators, constant member-organized activities, and plenty of custom features, including our unique journal system. If this is your first visit, be sure to check out the FAQ or our GFWiki. You will have to register before you can post. Membership is completely free (and gets rid of the pesky advertisement unit underneath this message).


C/C++
Reply
 
Thread Tools
Bigblah
Tails is incompetent!


Member 5

Level 45.31

Feb 2006


Reply With Quote
Old Mar 6, 2006, 11:11 PM Local time: Mar 7, 2006, 12:11 PM #26 of 58
Originally Posted by www.sega.co.jp
How much harder is it to program in assemly than it is in C/C++?
Check out the (very simple) multiplayer (via serial port) pacman game I had to write for a module last semester, and see for yourself.

http://www.bigblah.net/upload/wspg.asm

There's nowhere I can't reach.
Magic
Good Chocobo


Member 492

Level 15.73

Mar 2006


Reply With Quote
Old Mar 6, 2006, 11:24 PM #27 of 58
Originally Posted by Arainach
On C# - I'm no expert (I've just been learning it for a couple of weeks myself), but the entire point of C# is that it's strongly typed and prevents a lot of low-level activities that C and C++ allowed to that end. MS calls it a "security feature"; the rest of us call it "a pain in the ass".

Isn't the whole point of high-level languages that you let the compiler generate all the Assembly? What's the point of using low-level code in the middle of C/C++?

This thing is sticky, and I don't like it. I don't appreciate it.
BlueMikey
TREAT?!?


Member 12

Level 35.70

Feb 2006


Reply With Quote
Old Mar 6, 2006, 11:37 PM Local time: Mar 6, 2006, 09:37 PM #28 of 58
Optimization, it is an incredibly common thing to have C code call external functions written in asm.

How ya doing, buddy?
Cetra
oh shi-


Member 445

Level 24.23

Mar 2006


Reply With Quote
Old Mar 6, 2006, 11:50 PM Local time: Mar 6, 2006, 08:50 PM #29 of 58
Originally Posted by Magic
Isn't the whole point of high-level languages that you let the compiler generate all the Assembly? What's the point of using low-level code in the middle of C/C++?
Because even some of the best compilers do things you don't want it to. They do make mistakes fairly often and the only way to resolve the issue is to edit the generated assembly by hand.

I was speaking idiomatically.
Arainach
Sensors indicate an Ancient Civilization


Member 1200

Level 26.94

Mar 2006


Reply With Quote
Old Mar 7, 2006, 12:21 AM #30 of 58
Originally Posted by Magic
Isn't the whole point of high-level languages that you let the compiler generate all the Assembly? What's the point of using low-level code in the middle of C/C++?
By "low-level" I refer even to thing like Pointers - to even use the damned things you must compile your code with the "unsafe" option. A fundamental concept to be sure, and not all that low-level, but one that C# doesn't like.

http://www.c-sharpcorner.com/Code/20...UnsafeCode.asp

What kind of toxic man-thing is happening now?
Overkill
Syklis Green


Member 1892

Level 7.28

Mar 2006


Reply With Quote
Old Mar 7, 2006, 03:01 PM #31 of 58
Argh. I sorry. I didn't mean best API... Ew. That was a rather sad mistake. Er... Best IDE. This is why acronyms are evil. I like VS's interface, not the library. Sorry for the misunderstanding. :/

How ya doing, buddy?
Arainach
Sensors indicate an Ancient Civilization


Member 1200

Level 26.94

Mar 2006


Reply With Quote
Old Mar 7, 2006, 03:06 PM #32 of 58
The VS IDE is.... OK. Still can't touch vim+make in my book. Or Eclipse if you truly need an honest-to-god IDE.

What, you don't want my bikini-clad body?
BlueMikey
TREAT?!?


Member 12

Level 35.70

Feb 2006


Reply With Quote
Old Mar 7, 2006, 09:04 PM Local time: Mar 7, 2006, 07:04 PM #33 of 58
But vim+make isn't an IDE, so that doesn't really count.

Eclipse came out near the end of my college career, so I didn't really get into it, being set in my ways, but a few of my student teachers turned me on to it. Had I stuck with programming and Java, I would have made the switch to it eventually.

Jam it back in, in the dark.
and Brandy does her best to understand
DarthSavior
PUT YA GUNS ON


Member 188

Level 12.90

Mar 2006


Reply With Quote
Old Mar 8, 2006, 01:19 PM Local time: Mar 8, 2006, 08:19 AM #34 of 58
I've had some time with C and C++ last semester, and now dealing with assembly this semester. It's more of a bitch to do things that would be considered "simple" in C/C++ in assembly. What could take like 3-4 lines of code in C/C++ would take 2-3 times more (occassionally even more) code in assembly.

But then again, if you saw Blah's example, you'd now this by now.

Oh yeah, forgot to mention the original post. I've compiled C/C++ programs (although all were run in a DOS window) and they worked fine in Windows XP.

There's nowhere I can't reach.
vincent_ray21
Chinese Zodiac: ox. Zodiac: Leo.


Member 795

Level 2.38

Mar 2006


Reply With Quote
Old Mar 9, 2006, 09:29 PM Local time: Mar 10, 2006, 10:29 AM #35 of 58
Using assembly you can make a program run faster than using program written in C/C++. Especially local variables, which can be removed, by using only registers (which cannot be accessed in high level language).

Most basic functions in C/C++ are written in assembly for the purpose of speed like the function strcpy, strlen. Which are written in assembly (as of the libraries of VC++). In tracing the function, you will see assembly immediately.

There are some software that fit using assembly, like hardware communication. Which includes software driver, etc. and some program that are fit using high level like C/C++, business software since maintenance is also part of the cost of developing software.

This thing is sticky, and I don't like it. I don't appreciate it.
"The laws of gravity cannot be held responsible for people falling in love." -- Albert Einstein
Arainach
Sensors indicate an Ancient Civilization


Member 1200

Level 26.94

Mar 2006


Reply With Quote
Old Mar 9, 2006, 10:43 PM #36 of 58
Nowadays, when CPU time is cheap and coding time isn't, writing assembly is just plain stupid. Your code isn't portable, is more painful to debug and read, and the speed benefit is very negligible.

I am a dolphin, do you want me on your body?
BlueMikey
TREAT?!?


Member 12

Level 35.70

Feb 2006


Reply With Quote
Old Mar 10, 2006, 12:08 AM Local time: Mar 9, 2006, 10:08 PM #37 of 58
There are many applications where any improvement is worth it. Consider a program which is run billions of time every day versus the time it takes to code a function once.

I was speaking idiomatically.
and Brandy does her best to understand
vincent_ray21
Chinese Zodiac: ox. Zodiac: Leo.


Member 795

Level 2.38

Mar 2006


Reply With Quote
Old Mar 10, 2006, 02:16 AM Local time: Mar 10, 2006, 03:16 PM #38 of 58
Operating system and system software like anti-virus and firewall must be written in such low level so that they will execute much quicker.

As the computer grows faster, we users install and use more software. And programmers tend to use the potential of the faster computer (Game is a good example).(I think it’s proportional: more speed = more software = more memory usage .)

Even using such low-level or high level, if the algorithm of the software is slow, any implementation will not make it faster.

Most amazing jew boots
"The laws of gravity cannot be held responsible for people falling in love." -- Albert Einstein
Tek2000
NOT AVAILABLE


Member 1641

Level 10.58

Mar 2006


Reply With Quote
Old Mar 19, 2006, 09:19 PM #39 of 58
Originally Posted by Arainach
Nowadays, when CPU time is cheap and coding time isn't, writing assembly is just plain stupid. Your code isn't portable, is more painful to debug and read, and the speed benefit is very negligible.
Isn't it stupid when one pays about 2x the price of a processor for a faster model, then happily wastes CPU cycles because the software isn't properly optimized?
ASM, used wisely, is used to optimize concrete areas of an application, not to develop entire applications (that's just overkill, and one could end up reinventing the square wheel if not careful).
As for portability, it's ok when an application is portable between OSes, but most times you aren't going outta the x86 architecture so it's not much of a deal.

FELIPE NO

Last edited by Tek2000; Mar 19, 2006 at 09:24 PM.
Cetra
oh shi-


Member 445

Level 24.23

Mar 2006


Reply With Quote
Old Mar 19, 2006, 09:46 PM Local time: Mar 19, 2006, 06:46 PM #40 of 58
Originally Posted by BlueMikey
There are many applications where any improvement is worth it. Consider a program which is run billions of time every day versus the time it takes to code a function once.
Exactly. When you have a program where 1% of your code accounts for 50% of your runtime (which is VERY common) then why the hell would you not recode that 1% in Assembly?

What, you don't want my bikini-clad body?
PUG1911
I expected someone like you. What did you expect?


Member 2001

Level 17.98

Mar 2006


Reply With Quote
Old Mar 21, 2006, 12:01 AM #41 of 58
Originally Posted by Arainach
Nowadays, when CPU time is cheap and coding time isn't, writing assembly is just plain stupid. Your code isn't portable, is more painful to debug and read, and the speed benefit is very negligible.
And this is precisely why it takes 256MB of RAM and a 700+Mhz CPU to run a spreadsheet today. When spreadsheets did the same shit on a 486. The same reason why an itty-bitty VB database frontend takes 30MB of RAM to run a simple query.

Jam it back in, in the dark.
"The avalanche has already started. It is too late for the pebbles to vote."
Tek2000
NOT AVAILABLE


Member 1641

Level 10.58

Mar 2006


Reply With Quote
Old Mar 21, 2006, 07:02 PM #42 of 58
Usually, such high requirements aren't due to high language coding but because of inadequate data structures and/or bloatware.

There's nowhere I can't reach.
Arainach
Sensors indicate an Ancient Civilization


Member 1200

Level 26.94

Mar 2006


Reply With Quote
Old Mar 21, 2006, 09:28 PM #43 of 58
Originally Posted by PUG1911
And this is precisely why it takes 256MB of RAM and a 700+Mhz CPU to run a spreadsheet today. When spreadsheets did the same shit on a 486. The same reason why an itty-bitty VB database frontend takes 30MB of RAM to run a simple query.
First off, x86 hit your complaints on the head.

Second, who DOESN'T have 256MB of RAM and 700Mhz? I have 6 machines meeting those qualifications in my house (0 that don't), a stack of 550-700Mhz Pentium III chips sitting on my desk that I have nothing to do with, and a bag of 128MB PC100 and PC133 RAM sticks that I have nothing to do with. You can find better hardware at Goodwill.

And I guess "Third" would be stop using MS Office 2003. I've ran OpenOffice 2.0 on Pentium-75s with 128MB of RAM.

This thing is sticky, and I don't like it. I don't appreciate it.
Overkill
Syklis Green


Member 1892

Level 7.28

Mar 2006


Reply With Quote
Old Mar 21, 2006, 11:30 PM #44 of 58
Even though ASM is useful in cases, I'd much rather avoid it when possible. Just let the compiler do its job.

Personally, I dig Python a lot more than C/C++, and Python is an interpretted language, so it's even slower than C. But really, it makes up for the slowness with awesome. I'm sure some of you hate it because it doesn't have strict variable typing and indentation rules and whatnot, but I love it. The library, the simplicity, the forced convention of spacing, generator functions, lists, tuples, dictionaries, not having to use confusing templates... <3.

I am a dolphin, do you want me on your body?
vincent_ray21
Chinese Zodiac: ox. Zodiac: Leo.


Member 795

Level 2.38

Mar 2006


Reply With Quote
Old Mar 22, 2006, 03:37 AM Local time: Mar 22, 2006, 04:37 PM #45 of 58
Even I am using Java, which I considered the slowest language that I have used, since it is both compiled and interpretted.

More program especially business program doesn't need to run very efficient that it must be written in assembly. It's the logic and algorithm that count. Even you use assembly but the logic takes n * n to finish(I don't know how to write n square). It will be defeated by a logic that takes log n, n or even n * log n written in latest language.

Programmers tends to choose language which they can work/compatible with so that they can create software much faster.

The compilers are also being develop/upgrade so that it can be more efficient and have more options to give.

I was speaking idiomatically.
"The laws of gravity cannot be held responsible for people falling in love." -- Albert Einstein

Last edited by vincent_ray21; Mar 23, 2006 at 12:21 AM.
Arainach
Sensors indicate an Ancient Civilization


Member 1200

Level 26.94

Mar 2006


Reply With Quote
Old Mar 22, 2006, 09:28 AM #46 of 58
The main slowdown of Java is the horrendous VMs out there today. If someone could write a good, efficient VM, it'd become the complete industry standard overnight. But that giant level of overhead is what keeps other stuff like C++ and C# going. Heck, I haven't even bothered learning Java yet. I suppose eventually I should.

How ya doing, buddy?
Soluzar
De Arimasu!


Member 1222

Level 37.11

Mar 2006


Reply With Quote
Old Mar 22, 2006, 10:29 AM Local time: Mar 22, 2006, 04:29 PM #47 of 58
Originally Posted by Arainach
The main slowdown of Java is the horrendous VMs out there today. If someone could write a good, efficient VM, it'd become the complete industry standard overnight. But that giant level of overhead is what keeps other stuff like C++ and C# going. Heck, I haven't even bothered learning Java yet. I suppose eventually I should.
I'll believe that when I see it. Java is a proprietary dead end. It's C++ with all the good bits stripped out and replaced with junk.

FELIPE NO
libc
Wark!


Member 1530

Level 1.10

Mar 2006


Reply With Quote
Old Mar 22, 2006, 03:00 PM #48 of 58
Originally Posted by Bigblah
Check out the (very simple) multiplayer (via serial port) pacman game I had to write for a module last semester, and see for yourself.
=o

You, sir, have my respect.

Double Post:
Originally Posted by Soluzar
Java is a proprietary dead end.
There exists free (as in free-beer) ports, the most famous one being gcj, but I think it is still incomplete.

Java is pretty strong today, with a *lot* of business-critical applications. I'm not expecting it to disappear quickly.

(I say that, and I just hate Java)

However, you can be sure Microsoft will try to kill it with its C#

How ya doing, buddy?

Last edited by libc; Mar 22, 2006 at 03:03 PM. Reason: Automerged double post.
Tek2000
NOT AVAILABLE


Member 1641

Level 10.58

Mar 2006


Reply With Quote
Old Mar 22, 2006, 07:44 PM #49 of 58
Originally Posted by Arainach
I've ran OpenOffice 2.0 on Pentium-75s with 128MB of RAM.
OK. How many hours did it take to simply boot the application?.

Jam it back in, in the dark.
BlueMikey
TREAT?!?


Member 12

Level 35.70

Feb 2006


Reply With Quote
Old Mar 22, 2006, 09:21 PM Local time: Mar 22, 2006, 07:21 PM #50 of 58
Originally Posted by vincent_ray21
More program especially business program doesn't need to run very efficient that it must be written in assembly. It's the logic and algorithm that count. Even you use assembly but the logic takes n * n to finish(I don't know how to write n square). It will be defeated by a logic that takes log n, n or evenn * log n written in latest language
You're right that a good algorithm is the most important factor in a runtime, but you don't have to write a whole program in ASM. You can write small functions in ASM that your code in a higher-level language calls to get around compiler imperfections.

Originally Posted by Soluzar
I'll believe that when I see it. Java is a proprietary dead end. It's C++ with all the good bits stripped out and replaced with junk.
C++ has no good "bits". That's what people like about it, it is basically nothing, allowing users to do whatever they want with no protection whatsoever.

Java is very important, I think the 3rd most used language (outside of C and C++). Sun, as a caretaker, has gone to vast lengths to improve it, there is one single body to make changes to the language and they never make poor decisions. I think it is still the easiest language to learn (not just the language itself, but it is easy to learn concepts in), so it definitely has its educational purposes.

Most amazing jew boots
and Brandy does her best to understand
Reply


Exploding Garrmondo Weiner Interactive Swiss Army Penis > Garrmondo Network > Help Desk > C/C++

Forum Jump


All times are GMT -5. The time now is 05:07 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.