C++ a wicked language
category: code [glöplog]
"the cool thing about c++ is that you can code a 64k intro with it and also code an intro-tool with 1.5MByte source with it. and even share the source between the two projects!"
...and even cooler, you can even do it with 2 people in parallel without permanently stepping on each other's feet :)
...and even cooler, you can even do it with 2 people in parallel without permanently stepping on each other's feet :)
Optimus: i suppose that when you say "C++" you think "Visual C++ with MFC and other wicked stuff". If so, then i can inform you that C++ is nothing more than -as the same says- an extended version of C. And C is not supposed to be as close to the machine as possible but as real as possible. C++ changes it a bit for the sake of easyness (f.e. references instead of pointers - they almost produce the same code, but the code is different), but however is the same in a way or another. C is a very easy language and C++ an extesion to this language. So C++ is an easy language with OOP abilities. OOP is just an idea and nothing more and every language implements it in different ways. You can do OOP even in pure C, you'll just have to implement it yourself. In C++ OOP is being done in "classes". Lastly i agree that if you want to learn C++ go get a good book about C++ (personally i learned C++ after learning C using help files - and still i don't know all things that C++ can do - i never needed them).
Nuclear: if -> has nothing to do with C++ then what is this:?
DDSurface->Lock(...)
Nuclear: if -> has nothing to do with C++ then what is this:?
DDSurface->Lock(...)
Why do you use DirectDraw BadSector? And Hi ChaosFr Kosmo is telling mad stuff..
You know the schizophrenic dude..
You know the schizophrenic dude..
BadSector: You obviously don't know a shit - MFC is a normal class library no-one forces you to use (and not a particularly great one, yeah, but that's hardly the topic here). VC++ has been a bit late on ISO C++ compliance, but that's fixed in the current release too, so there's really no reason to whine about anything. And in case you wonder, no, Visual C++ is not visual at all - it's simply the name of the whole product line.
Neither . nor -> are C++ specific, both were already existant in K&R C. "." is used to access structure members, like "mystruct.var=3", and -> is a shorthand for the far clumsier "(*mystructptr).val=3" in case you don't have a structure variable, but a pointer to one (the version using "->" is "mystructptr->val=3").
Neither . nor -> are C++ specific, both were already existant in K&R C. "." is used to access structure members, like "mystruct.var=3", and -> is a shorthand for the far clumsier "(*mystructptr).val=3" in case you don't have a structure variable, but a pointer to one (the version using "->" is "mystructptr->val=3").
btw since ryg mentioned compliance with the standard of C++, VC really sux when it comes to that part... especially template support is totally broken, Visual C++ .NET is a lot better than 6.0 but still broken. I wrote a template<class T, untigned int M, unsigned int N> class Matrix {..}; and I had to do a lot of conditional preprocessor shit to give it to VC the way it thinks templates should be... especially this function:
template <class T, unsigned int M1, unsigned int N1, unsigned int M2, unsigned int N2>
Matrix<T, M1, N2> operator *(const Matrix<T, M1, N1> &mat1, const Matrix<T, M2, N2> &mat2) {....}
did not compile no matter what trickery i tried in VC, GCC of course compiles the whole thing perfectly...
GCC is the only C++ standard compliant compiler that I have seen.
template <class T, unsigned int M1, unsigned int N1, unsigned int M2, unsigned int N2>
Matrix<T, M1, N2> operator *(const Matrix<T, M1, N1> &mat1, const Matrix<T, M2, N2> &mat2) {....}
did not compile no matter what trickery i tried in VC, GCC of course compiles the whole thing perfectly...
GCC is the only C++ standard compliant compiler that I have seen.
Wow! I might be really drunk or bad yesterday ;)
Imagine the feeling, logging in pouet today and finding out so many comments for me!
But seriously,. I had something in my mind. Perhaps it was mainly the reason that I was very frustrated that I have to stick myself in C++ and start again from the beginning. It will take me time to read books and get used in a new language. And then I pointed out my sadness against specific parts of C++, like it's complexity and multiparadigm (as someone said, it was what I was meaning).
But some of the things I wrote were some thoughts of mine, more easy to understand if I had the state to write them nicer ;P
Isn't needed that much since some people already explained some things I was thinking. I don't think I will write more at least now (even if I have the desire to point out some things I don't like) but anyways it is great that I got replies from many people which are interesting to me..
As for HLL bable, it was a joke of Antitec =)
Imagine the feeling, logging in pouet today and finding out so many comments for me!
But seriously,. I had something in my mind. Perhaps it was mainly the reason that I was very frustrated that I have to stick myself in C++ and start again from the beginning. It will take me time to read books and get used in a new language. And then I pointed out my sadness against specific parts of C++, like it's complexity and multiparadigm (as someone said, it was what I was meaning).
But some of the things I wrote were some thoughts of mine, more easy to understand if I had the state to write them nicer ;P
Isn't needed that much since some people already explained some things I was thinking. I don't think I will write more at least now (even if I have the desire to point out some things I don't like) but anyways it is great that I got replies from many people which are interesting to me..
As for HLL bable, it was a joke of Antitec =)
The term "abstraction" came out from a C64 democoding tutorial written by Puterman. It was really funny when I read at the first time but makes sense. HLL are abstractions, because you code things with them with pseudocommands, having nothing to do with the machine language of the PC. From the same person comes the funny quote: "If you have coded a programm displaying realtime graphics in a high level language, don't try to full anyone around that you have coded a demo. Demos are not coded in HLL!" =)))
Really,. I have read puterman's tutorial yesterday. 6510 seems amazingly small and elegant! And the memory mapped I/O too. I mean, there are so few commands in comparison to the Z80, which might be bad and there are also amazingly few opcodes, but you could flash the screen with two lines. To do that on CPC, you have to use OUT and having a table of color values, because some weird HEX values corresponding to the logical colors have to be used. And there have more to be done, for other raster effects and stuff I am reading now, cause the CPC has not IRQ line interrupts. Small and elegant programms are showing me how to control gfx on the C64. If I had to write a similar tutorial for CPC, it would be much harder to keep such small easy looking programms for newbies who want to learn. C64 assembly seems to rule!
Change of subject..
I would like now, because I remembered again what's the issue, to point out honestly what was my main frustration:
If I have to forget the machine and learn a new abstraction of a set of commands that others have thought for me, why should I eat my time learning such a new complex and big language like C++? Why this abstraction can't be something simplier and diferrent? Quickbasic fits to that as a syntax. And even it's compiler is so small, easy, helpfull and compiles fast in comparison with other heavy ones! But it's not the one I'd want now (exept if I want to code fun little things), because it's so old and memory restricted anymore.
Anyways imagine something simple, which doesn't have the old restrictions of quickbasic and can easilly give me the very few and important commands tat I need and then I can use these as I want to build everything. I guess I am more close to a simplistic compiler than a huge monster, and prefer to start coding after learning the language in a short time, than having to read a brick (C++ books are heavy and big like huge bricks, that's what I mean!) and learning, learning, learning but not starting coding my own stuff. Just explaining my style, perhaps I can make clear my frustration to you..
Perhaps that's the reason why I liked assembly. You take only very few time to learn some basic opcodes and then start writting your own things. Unlike huge languages, where you have to spend a lot of time reading before starting to code something that is actually yours. I don't know see that anything is better than the others, but perhaps now I made more clear even to myself why I have problems getting started with C++
However, I have seen that it would be not for me to code big things in pure asm on PC. What I need is the small simplistic compiler I mentioned, with perhaps an easy way to write inline assembly inside too. Perhaps, because I still don't really know what happens in the system when coding X86, even the fact that PCs are beasts anymore, makes it harder. An easy compiler, the one of my dreams!
I will have it in my mind, perhaps I will code one at the future. I might stick a bit my head in C++ because I have too sometimes, hopefully the fact that someone said here that Java is simplier and good to get a job made me happy. A friend gave me a book for Java and he read there it's more OOP specific and the book really teaches you what OOP is all about easilly and my friend could understand some things he didn't learned from the other C++ book! I might get started, but this book is again a big brick, ugh!!!
I don't know. Perhaps I should code my own compiler, suitable for my needs :)
I would like now, because I remembered again what's the issue, to point out honestly what was my main frustration:
If I have to forget the machine and learn a new abstraction of a set of commands that others have thought for me, why should I eat my time learning such a new complex and big language like C++? Why this abstraction can't be something simplier and diferrent? Quickbasic fits to that as a syntax. And even it's compiler is so small, easy, helpfull and compiles fast in comparison with other heavy ones! But it's not the one I'd want now (exept if I want to code fun little things), because it's so old and memory restricted anymore.
Anyways imagine something simple, which doesn't have the old restrictions of quickbasic and can easilly give me the very few and important commands tat I need and then I can use these as I want to build everything. I guess I am more close to a simplistic compiler than a huge monster, and prefer to start coding after learning the language in a short time, than having to read a brick (C++ books are heavy and big like huge bricks, that's what I mean!) and learning, learning, learning but not starting coding my own stuff. Just explaining my style, perhaps I can make clear my frustration to you..
Perhaps that's the reason why I liked assembly. You take only very few time to learn some basic opcodes and then start writting your own things. Unlike huge languages, where you have to spend a lot of time reading before starting to code something that is actually yours. I don't know see that anything is better than the others, but perhaps now I made more clear even to myself why I have problems getting started with C++
However, I have seen that it would be not for me to code big things in pure asm on PC. What I need is the small simplistic compiler I mentioned, with perhaps an easy way to write inline assembly inside too. Perhaps, because I still don't really know what happens in the system when coding X86, even the fact that PCs are beasts anymore, makes it harder. An easy compiler, the one of my dreams!
I will have it in my mind, perhaps I will code one at the future. I might stick a bit my head in C++ because I have too sometimes, hopefully the fact that someone said here that Java is simplier and good to get a job made me happy. A friend gave me a book for Java and he read there it's more OOP specific and the book really teaches you what OOP is all about easilly and my friend could understand some things he didn't learned from the other C++ book! I might get started, but this book is again a big brick, ugh!!!
I don't know. Perhaps I should code my own compiler, suitable for my needs :)
In fewer words, high level languages were build to help the programmer coding algorithms faster and easier. It is supposed to be the reason why I code most times on a compiler and not in pure assembly on the PC. But this reason is not reached with C++, because it made my life harder instead! It should be a more simple language and not a big confused thing like that, for that purpose..
5 posts in a row... damn!
Optimus: I've heard of an Basic solution called DarkBasic. I think it's faxenquatsch but a friend of mine who isn't able to do weird things with c++ or even assembler. Has showed good results (it suits a 3dengine). By the way I think it's lame to code 3D thingis this way but why not. I like c++ because it made me happy by fast code and sick structure logics.
And you can do everything with your computer for instance writing an operating system which works on most computers. The goal of c was to implement a fast language on different platforms and so does c++. Or have you ever heard (perhaps) of an delphi game on a ps2.. Look for darkbasic and you will (perhaps) be happy for some time. But if you want to do more sophisticated weird stuff I suggest C++ (or + Assembler). And so on and on and on....
And you can do everything with your computer for instance writing an operating system which works on most computers. The goal of c was to implement a fast language on different platforms and so does c++. Or have you ever heard (perhaps) of an delphi game on a ps2.. Look for darkbasic and you will (perhaps) be happy for some time. But if you want to do more sophisticated weird stuff I suggest C++ (or + Assembler). And so on and on and on....
The best thing about C++ is how a program of a few lines of code (a What is your name? Hello X! for example) suddenly turns into one of a few thousand! So much for 64k demos writen in C++, I think not! Now excude me I must add a couple'a hundred more lines to my header files. hmm...
Drifting way the fuck off topic, I found the use of the term 'wicked' a bit confusing at first. To me when someone states something 'is wicked,' this usually means it's 'awesome' or some similar vernacular.
Positioning/context is everything.
eg.
"Wicked witch." --> Evil witch.
"That witch is wicked." --> That witch is cool.
Get it? Got it. Good...
Positioning/context is everything.
eg.
"Wicked witch." --> Evil witch.
"That witch is wicked." --> That witch is cool.
Get it? Got it. Good...
Mad: It's not what I meaned, I never said that I need a compiler writting "make plasma on the top", "make wolfenstein engine on the middle", "make 3d gouraud torus on the bottom". I just wanted something easy in syntax, with few commands and no complex structures, which will give me a graphics buffer and then I will write my own effects/engine for that. It's sad to me that most people suggest C++ is the only way. It might either be or not but it's frustrating. Anyways,. I think that I should better think and find out the compiler more suitable for my needs instead of writting 5 messages in a row ;)
errr, that sounds like visual basic... (god forbid!)
"The best thing about C++ is how a program of a few lines of code (a What is your name? Hello X! for example) suddenly turns into one of a few thousand! So much for 64k demos writen in C++, I think not! Now excude me I must add a couple'a hundred more lines to my header files. hmm..."
All of our (farbrausch) 64ks are written in C++ (except some small blotches of inline ASM and the soft synth, which is 100% ASM "for historical reasons"). So are those by kolor, bypass, 3state, aardbei, or pretty much anyone you might ask.
There are even several Windows 4k intros written in pure C++.
Which all kinda proves that people who really have no clue about what they're talking should just STFU. I think I've never seen such a huge pile of bullshit in such a short thread.
All of our (farbrausch) 64ks are written in C++ (except some small blotches of inline ASM and the soft synth, which is 100% ASM "for historical reasons"). So are those by kolor, bypass, 3state, aardbei, or pretty much anyone you might ask.
There are even several Windows 4k intros written in pure C++.
Which all kinda proves that people who really have no clue about what they're talking should just STFU. I think I've never seen such a huge pile of bullshit in such a short thread.
Optimus: Don't know a propper solution but on Dos side if you don't code assembler mode13 will be a good starting position. Vesa isn't so easy to begin with. What about c without ++ and some assembler inlines to configure these modies. Dunno if it works with visual c (mode13?).. If visual c don't accepts int 0x10 then try watcom C instead.. You will see that c is (and i mean pure c) a nice and easy to use HL. And if you want you can migrate to c++ at any time.
#define is fine...
thom: About the word "wicked": This is very interesting to me and I would like to explain a bit..
I also had a problem to understand what people were meaning with this word. I know that it was used from people with two diferrent opposite meanings! But I really don't rememer which one of them I have learned first but at the end I adapted the "bad" meaning. So,. I guess the "awesome" meaning is the one I learned first. Btw,. the way I had to write these lines is very funny to me, because at the beginning I had big trouble deciding what to do, before using the "" in order to diverse, or else people would think that I am talking about one bad and one awesome meaning of the word, but without defining them :)
First of all, I opened a dictionary and it told me that wicked means bad. But really, there are more interesting things to tell you, like the fact that there is more than the "bad" meaning and also the possible reason why "wicked" might be used as "awesome" (at least in some of the examples I have seen it).
Actually, the most interesting thing is that wicked is not just meaning "bad". It's more for me. It's a special form of "bad" actually! This surname claims that the object is so strangely bad, as it shouldn't be like this. Or, something confusingly bad. It's just a feeling that comes to me when I use this word to describe a very bad situation that shouldn't be like this. It's more bad than you think! And to put it in a simple equation, I could say that "Wicked = Confused + Bad". I am using it for problems that are so evil, because someone is inside them but don't know what the hell is going on! A person having psychological problems, his self/brain is closed in a wicked loop. A very bad situtation between some people cannot communicate with each other, wicked problems of human beeing and such stuff. When I know that something is going wrong with my life, but everything is so confused in my mind, this is wicked! At least, that's the meaning I adopted and it perfectly fits the very bad feeling I have about specific things. Perhaps because my life is a mess, I am always confused with myself and living wicked situations. It perfectlly describes my feelings. And I never use it to describe a person, there is no "strangely/weirdly bad" persons, only bad situations out of understanding..
About the other meaning. I have actually read someone saying "wicked!" about an amazing demo. I think it was a C64 one, feauturing effects that couldn't be, they just couldn't be possible! Here, the meaning of "confused", "badly confused" might have played it's role. Like, that the effect was just so impossible for the C64, that the person couldn't beleive it just can be done, but in a strangely weird feeling. It's kinda psychologicall actually, when people using wicked for something good that just can't exist in reality, it just can't be! Like it would be too bad or against what they know, to exist. But not meaning that it is evil of course. Sometimes I think, wicked is something badly confused and not confusing bad, that I should reverse the words. An impossible 3d engine on an old rare machine which is an unbeleivable beast for example. You might be happy that it is actually real and playable, yet you might be confused about how and if it should work, from the other side one part of yourself might be feeling weirdly bad (bad for strange unknown reasons, since you shouldn't and you know that!) because this engine shouldn't exist, it destroys what you knew about reality and the computer itself,. and from the third side you would feel even more bad knowing that you will never achieve coding something like that, your other self surprisingly hating the programmer. I felt that first when watching some new generation engines (either UT2003 or some Dreamcast games) which gave me a bittersweet engine. Because I was watching something very good for my eyes and brain, but at the same time felt frustrated and wondered what I am doing here as a coder and if I can ever reach these programmers. A bittersweet feeling, both good and bad at the same time. I guess that's a weirdish bad thing! Don't knowing whether you like something or not..
The second paragraph might be confusing (wicked :) to you and you might think I am joking and writting psychojargon, but no I am not kidding here. (Even if my other self laughs a bit but see's my first self with some kind of wicked sympathy and understanding, at least that's what my first self beleives..) But remember the first big paragraph with the "bad" (and even more than that!) meaning and the fact that that's what the dictionary says. However, since many people have adopted the other meaning, we should be aware of how this word is used in both ways inside our culture..
I.P.S. And btw,. the photo in your Ojuice profile was really funny! :)
I.P.P.S. I.P.S. stands for irrelevant post script
I.P.P.P.S. No,. I am not on weed. I just enjoy writting sometimes. And there are some interesting to me things inside these texts, even if in this way it won't get out as something more than just a joke or a wicked Optimus ;P
I also had a problem to understand what people were meaning with this word. I know that it was used from people with two diferrent opposite meanings! But I really don't rememer which one of them I have learned first but at the end I adapted the "bad" meaning. So,. I guess the "awesome" meaning is the one I learned first. Btw,. the way I had to write these lines is very funny to me, because at the beginning I had big trouble deciding what to do, before using the "" in order to diverse, or else people would think that I am talking about one bad and one awesome meaning of the word, but without defining them :)
First of all, I opened a dictionary and it told me that wicked means bad. But really, there are more interesting things to tell you, like the fact that there is more than the "bad" meaning and also the possible reason why "wicked" might be used as "awesome" (at least in some of the examples I have seen it).
Actually, the most interesting thing is that wicked is not just meaning "bad". It's more for me. It's a special form of "bad" actually! This surname claims that the object is so strangely bad, as it shouldn't be like this. Or, something confusingly bad. It's just a feeling that comes to me when I use this word to describe a very bad situation that shouldn't be like this. It's more bad than you think! And to put it in a simple equation, I could say that "Wicked = Confused + Bad". I am using it for problems that are so evil, because someone is inside them but don't know what the hell is going on! A person having psychological problems, his self/brain is closed in a wicked loop. A very bad situtation between some people cannot communicate with each other, wicked problems of human beeing and such stuff. When I know that something is going wrong with my life, but everything is so confused in my mind, this is wicked! At least, that's the meaning I adopted and it perfectly fits the very bad feeling I have about specific things. Perhaps because my life is a mess, I am always confused with myself and living wicked situations. It perfectlly describes my feelings. And I never use it to describe a person, there is no "strangely/weirdly bad" persons, only bad situations out of understanding..
About the other meaning. I have actually read someone saying "wicked!" about an amazing demo. I think it was a C64 one, feauturing effects that couldn't be, they just couldn't be possible! Here, the meaning of "confused", "badly confused" might have played it's role. Like, that the effect was just so impossible for the C64, that the person couldn't beleive it just can be done, but in a strangely weird feeling. It's kinda psychologicall actually, when people using wicked for something good that just can't exist in reality, it just can't be! Like it would be too bad or against what they know, to exist. But not meaning that it is evil of course. Sometimes I think, wicked is something badly confused and not confusing bad, that I should reverse the words. An impossible 3d engine on an old rare machine which is an unbeleivable beast for example. You might be happy that it is actually real and playable, yet you might be confused about how and if it should work, from the other side one part of yourself might be feeling weirdly bad (bad for strange unknown reasons, since you shouldn't and you know that!) because this engine shouldn't exist, it destroys what you knew about reality and the computer itself,. and from the third side you would feel even more bad knowing that you will never achieve coding something like that, your other self surprisingly hating the programmer. I felt that first when watching some new generation engines (either UT2003 or some Dreamcast games) which gave me a bittersweet engine. Because I was watching something very good for my eyes and brain, but at the same time felt frustrated and wondered what I am doing here as a coder and if I can ever reach these programmers. A bittersweet feeling, both good and bad at the same time. I guess that's a weirdish bad thing! Don't knowing whether you like something or not..
The second paragraph might be confusing (wicked :) to you and you might think I am joking and writting psychojargon, but no I am not kidding here. (Even if my other self laughs a bit but see's my first self with some kind of wicked sympathy and understanding, at least that's what my first self beleives..) But remember the first big paragraph with the "bad" (and even more than that!) meaning and the fact that that's what the dictionary says. However, since many people have adopted the other meaning, we should be aware of how this word is used in both ways inside our culture..
I.P.S. And btw,. the photo in your Ojuice profile was really funny! :)
I.P.P.S. I.P.S. stands for irrelevant post script
I.P.P.P.S. No,. I am not on weed. I just enjoy writting sometimes. And there are some interesting to me things inside these texts, even if in this way it won't get out as something more than just a joke or a wicked Optimus ;P
wow.
So,. perhaps an even more unique use of the word "wicked", would be to describe the condition when something is both good, bad and confused. I mean,.. the bittersweet feeling..
Optimus: have you considered posting in .zip format? Text compresses quite nicely :-P
So, the final question is... "wicked" is a multiparadigm?