Page 1 of 2

(MSVC ? JavaSchool ? yatts ?) - forked out

Posted: Thu Jan 05, 2006 2:55 am
by Solar
Sorry for not being able to withstand the (flame-?) bait...
kataklinger wrote: I don't want to think about MM, pointers, stack... if I'm working on some business application or something like that.
Agreed. But you should have understood MM, pointers, and stacks if you're working on some business application.

The problem is that too many people these days jump to the "easy" languages right away and screw up things at a high level because they never properly learned the basics.

http://www.joelonsoftware.com/articles/ThePerilsofJavaSchools.html

Re:MSVC Kernel Framework

Posted: Thu Jan 05, 2006 4:36 pm
by Dex4u
@Solar, This is a typical example of, Do as i say, not as i do.
You have posted to a link, that is nothing more than a, "if you do not code in C you must be some how inferior" ::) .

Re:MSVC Kernel Framework

Posted: Thu Jan 05, 2006 4:54 pm
by Kemp
Actually, that link is very true. Our University switched over to a pure Java syllabus and the quality of the students dropped dramatically. There are a lot of third-years who don't know how to count in binary or why it is ever useful (including not grasping logic stuff) and who have never heard of pointers and such-like. The lecturers have been trying to get the course changed to something useful and they finally succeeded, it's now a combo of Python and C as of this year. I've had a look over the syllabus and it is so much better.

Java has its place, but using it as the only teaching language... *shudder*

Re:MSVC Kernel Framework

Posted: Thu Jan 05, 2006 6:12 pm
by kataklinger
Well my university (the first and the only private university of techincal science in Serbia) is mostly Java oriented, and I don't mind (read: I don't care ;))... But on the first year of studies there's a C as well as Java, but there's no C++ later on at all (???).

@Solar: Text is good. I would agree with that guy on most parts, altought I know some very good pure Java & C# programmers.

Re:MSVC Kernel Framework

Posted: Thu Jan 05, 2006 7:07 pm
by Kemp
Well C++ isn't neccessarily the next logical step from C, it's not an upgrade to the language as such. Think of it more as a different language that just happens to accept C code as valid.

Re:MSVC Kernel Framework

Posted: Thu Jan 05, 2006 7:41 pm
by Kevin McGuire
Each language has its own strength and weakness. A few are more portable, mabye one has the best portability. A couple give you more control over or closer to the atomic level, or even intergrate other languages that are closer. Some support mixing with others. A few languages allow two or more languages to mix.

ASM is considered more difficult that C/C++, and so it shall deserve more credit for writting something in pure ASM. It however has no relation to exactly how smart someone is, instead -- that resides along the lines of inovation, invention, and creation of X.

As for learning, it resides along the lines of if the language has any relation to a another language. Can another language better youre understanding of one language? If so then they should teach the language that does. Does it cost more money to teach the other language. Does society start to be divided into the best, average, and worst taught, and has it already?

If students want to major in Java, thats fine - but it should be a better system of credentials. The employer should be able to tell what someone knows during the interview not afterward. If a student only wants to know how to write accounting programs, no big deal! Thats what they want. The student should be informed of other studies, but other than that there should be no force to what you have to learn to have a "programming" or "developer" title since Java is a language used to instruct a computer what to do. That is a developer, a software developer, a hardware developer.

If someone likes ASM vs C, thats great. It helps to know ASM, when working with C. I don't know how much. Thats takes scientific evidence - statistics - math. All that matters is the same thing that matters to a company:

SPEED - Development Time
ENERGY - Brain Power
-----------------------------------------------------
SPEED * ENERGY = PRODUCTION
If you use C, which gives more speed and less energy?
If you use ASM, which gives more energy and less speed?
If you use JAVA, witch gives more speed and less energy?

(SPEED - (CAPABILITIES / GOAL)) *
(ENERGY - (CAPABILITIES / GOAL)
= PRODUCTION
ASM, has more capabilities in relation to the goal?
C, has more the same capabilities in relation to the same goal?
JAVA, has less capabilities in relation to the same goal?

As the capabilities decrease more is required from speed and energy. How about error prone? How about setup time? How about portability? How about development tool cost? How about optimization? How about run-time optimization depending on the enviroment?
@Solar: Text is good. I would agree with that guy on most parts, altought I know some very good pure Java & C# programmers
Mabye they learned C or ASM first? Mabye they didnt?
Shouldn't the languages discussion be in its own thread? The only thread I've seen recently that has stayed on topic is the Processor Design one, lol.
Nope, this ones fine. More people might see my link, and mabye I can go to sleep knowing someone found it useful. :D

Re:MSVC Kernel Framework

Posted: Thu Jan 05, 2006 8:12 pm
by kataklinger
We all agreed, except Dex4u an we ar still talking about it :P

@Kemp: Yes, C++ is not neccessarily next logical step, but it shouldn't be left out.

@kmcguire: No, they don't know very much about ASM & C/C++

@Dex4u:
Text doesn't say: If you don't code in C you are inferior!
It says: If you don't _know_how_to_ code C you are inferior. ;)

Re:MSVC Kernel Framework

Posted: Fri Jan 06, 2006 5:47 am
by Kemp
Kataklinger : Very true, we're trying to convince each other of something we already believe ;D (Your post before last if this makes no sense)

I prefer C++ to C for general programming. Most of my projects are on the complex side and some object orientation is a godsend, though I'm not a fan of OO for the sake of OO, if it doesn't help the project I don't use it.

Re:MSVC Kernel Framework

Posted: Fri Jan 06, 2006 6:09 am
by RetainSoftware
@kmcguire
If someone likes ASM vs C, thats great. It helps to know ASM, when working with C. I don't know how much. Thats takes scientific evidence - statistics - math. All that matters is the same thing that matters to a company:
Knowing assembly helps to (re)write C-code which generates faster code. This can be done by doing an 'objdump' of a compiled piece of C-code for example. If you then also study how C-compilers work then you can even further optimised or better code. But when knowing all the ASM and compiler stuff the better/faster C-code comes automatically.

In the end knowing more then 1 language IMHO is better then just 1 because you can use the benefits of each language where it required. portabilty/maintainablility/speed/lead time etc.

Re:(MSVC ? JavaSchool ? yatts ?) - forked out

Posted: Fri Jan 06, 2006 6:36 am
by Pype.Clicker
if i may add my 2 words ... As soon as things more complex are involved, knowing _how_ things occurs behind the curtains help making things better.

I mean you may code in Java, or even code only in Java, but if you don't know what's going on during garbage collection ... or what's involved when you do "hello" + world, you'll probably experience bad surprises at some time ...

If you code in C and try to blissfully ignore what assembler is all about, you'll probably never figure out why

Code: Select all

int main() {
   float matrix[10000][10000];
 
   printf("running");
}
triggers a "segmentation fault, core dumped" on your teacher's system.

(MSVC ? Java Schools ? yatts ?) forked out

Posted: Fri Jan 06, 2006 8:04 am
by Solar
RetainSoft wrote: @kmcguire
If someone likes ASM vs C, thats great. It helps to know ASM, when working with C. I don't know how much. Thats takes scientific evidence - statistics - math.
Knowing assembly helps to (re)write C-code which generates faster code. This can be done by doing an 'objdump' of a compiled piece of C-code for example. If you then also study how C-compilers work then you can even further optimised or better code.
Basically true, as long as you keep in mind that:

1) Today's compiler backends are usually much better at keeping modern CPU pipelines fed than you are, so don't try to outsmart the compiler backend with hand-"optimized" assembler - that will turn out to be actually slower in the majority of cases.

2) Don't ever think you know where the bottleneck is and jump into wild optimization sessions. Prove where the bottleneck is - that's what profilers are for.

And @ Dex4U:
This is a typical example of, Do as i say, not as i do.

You have posted to a link, that is nothing more than a, "if you do not code in C you must be some how inferior" .
It is much more. You claimed that C programmers are inferor to all others. I provided a link that says that knowledge and skill in C, while not making you somehow superior to your peers, does teach you a thing or two about programming. Java types should know about pointers. Assembler types should know about structured programming and modularization. Both can be learned elsewhere or without ever touching a different language, but most of the time it isn't. And the guys can still code Java and Assembler for all I'm concerned, but they should know (or, quite honestly, hope they never work in my team).

Re:(MSVC ? Java Schools ? yatts ?) forked out

Posted: Fri Jan 06, 2006 8:25 am
by Candy
1) Today's compiler backends are usually much better at keeping modern CPU pipelines fed than you are, so don't try to outsmart the compiler backend with hand-"optimized" assembler - that will turn out to be actually slower in the majority of cases.
I tried to optimize a bit of mmx code I wrote with some prefetch statements that I didn't add before. Out of the dozens of tests I did, around 5 were faster than the original. A few ended up slower than the non-MMX code the compiler created out of similar C code and a few gave an improvement of around 10%, up to 20% for the best one. Yes, that's an improvement. Yes, if that's in your critical path, you'll speed up the program by 25%. And yes, if it isn't, you won't notice and spend hours on it without speedup.

Re:(MSVC ? JavaSchool ? yatts ?) - forked out

Posted: Fri Jan 06, 2006 8:40 am
by Solar
Sounds like about as much speedup as by using the Intel compiler instead of GCC. ;D

Agreed, the vector-unit backends are still playing catch-up. But when you tinkered with MMX, you'll agree that squeezing extra performance out of a modern opcode set is a far cry from what we did on a 6502 or 68000... ;-)

Re:(MSVC ? JavaSchool ? yatts ?) - forked out

Posted: Fri Jan 06, 2006 9:36 am
by Candy
Solar wrote: Sounds like about as much speedup as by using the Intel compiler instead of GCC. ;D
Not entirely. That was the speedup from my start code without prefetches to my fastest code, which was about 4x as fast as the gcc code.
Agreed, the vector-unit backends are still playing catch-up. But when you tinkered with MMX, you'll agree that squeezing extra performance out of a modern opcode set is a far cry from what we did on a 6502 or 68000... ;-)
Well... performance squeezing is a little more impossible nowadays, there are just too many bits to optimize. Given a program or function with a few critical paths that slow it all down, it's pretty damn the same. Messing with a few cycles or subcycles of difference to get that last bit of speed.

Admitted, it's not as critical as back then, I'm not going to fight for a quarter cycle per 1000 ops, which you would do back then. We just got more ops per second nowadays...


My only fear with all optimization is that, since the average usage of processor units on an old athlon is around 1.2 and on an old p4 is around 1.0, what would happen if you could crack that up to twice that, which they both can handle? I'm kind of afraid that you'd toast it.

Re:(MSVC ? JavaSchool ? yatts ?) - forked out

Posted: Fri Jan 06, 2006 11:31 am
by Dex4u
@Solar, On the contrary i think C programmers are very cleaver people, they must be to understand that encrypted language called C, but if a asm programmer wrote, what was in that article, but saying that C programmer need to get down to instruction level to really understand whats going on, you would call asm programmers arrogant.

I have nothing against the language C, other than the way C programmers, look down on other languages, this goes over most peoples heads, if by pointing it out when your do it, i just may make you ( as in C programmers ) think.