Computer Science Canada Capabilities of C++ |
Author: | BigBear [ Tue Feb 19, 2008 9:33 pm ] |
Post subject: | Capabilities of C++ |
Whenever I ask or read something like "Can Turing do this?" it seems the common answer is no you would need a language like C ++. SO I am just wondering what C ++ can actually do? 1 - Can it control the resolution when in full screen mode 2 - Can it change the mouse icon during game play 3 - Can C ++ control the speed of the game (it seems the same program runs differently on faster/slower machines 4 - Do actually only need to specify a boolean statement when you have a new variable (humor) 5 - Does it have similar but useful syntax to Turing's GUI? Just curios about this futuristic multi-capable third generation programming language. |
Author: | md [ Tue Feb 19, 2008 9:38 pm ] |
Post subject: | RE:Capabilities of C++ |
1. No. 2. No. 3. No. 4. No. 5. No. You're confusing programing techniques and library functions with language features. |
Author: | BigBear [ Tue Feb 19, 2008 9:44 pm ] |
Post subject: | Re: Capabilities of C++ |
O really, that sucks. Well thanks anyway. Wait are you saying it is possible in any language??? You just must know how to do it or it can be done in C ++ but it isn't a command? |
Author: | Clayton [ Tue Feb 19, 2008 9:49 pm ] |
Post subject: | RE:Capabilities of C++ |
First of all, if you're thinking like I think you are, things like View.Update(), Pic.Draw(), Draw.FillBox(), and other things of that ilk are not commands. They are procedures or functions that are contained within modules. This seems to be a very common thing where anybody coding in Turing seems to assume that everything is a command. In order to even begin to comprehend learning a language such as C++ (for example), you need to be dead sure of what is a command, and what isn't. |
Author: | BigBear [ Tue Feb 19, 2008 9:52 pm ] |
Post subject: | Re: Capabilities of C++ |
Well you are right I don't really know the difference between them. But I was just wondering if it those things were possible. |
Author: | md [ Tue Feb 19, 2008 9:54 pm ] |
Post subject: | RE:Capabilities of C++ |
You can do all of the above in any turing complete language, assuming you can access the appropriate hardware/software interfaces. Turing is limited in that it does not have interfaces to some software libraries and prevents your from easily adding them. However, most of the things in your list are not limited by a lack of software support. Mostly it's a limit of your own code/ability to solve (trial) problems. Also, the "Turing GUI" is not Turing the language. A language is simply something you can write programs in. the GUI is a tool that allows you to write code and run it from one convenient interface. |
Author: | BigBear [ Tue Feb 19, 2008 10:04 pm ] | ||
Post subject: | Re: Capabilities of C++ | ||
md wrote: Turing is limited in that it does not have interfaces to some software libraries and prevents your from easily adding them. However, most of the things in your list are not limited by a lack of software support. Mostly it's a limit of your own code/ability to solve (trial) problems. I don't think Turing can change the cursor or resolution or speed of the computer while executing a program. And I am 100 % sure Turing will not let you use this boolean statement
But doesn't C ++ allow you to only write the variable when you change it but turing make you writ it every time? |
Author: | rdrake [ Tue Feb 19, 2008 11:19 pm ] | ||||
Post subject: | Re: Capabilities of C++ | ||||
BigBear @ Tue Feb 19, 2008 10:04 pm wrote: md wrote: Turing is limited in that it does not have interfaces to some software libraries and prevents your from easily adding them. However, most of the things in your list are not limited by a lack of software support. Mostly it's a limit of your own code/ability to solve (trial) problems. I don't think Turing can change the cursor or resolution or speed of the computer while executing a program. And I am 100 % sure Turing will not let you use this boolean statement
But doesn't C ++ allow you to only write the variable when you change it but turing make you writ it every time?
|
Author: | Tony [ Tue Feb 19, 2008 11:46 pm ] | ||
Post subject: | RE:Capabilities of C++ | ||
sure there's a way
Well... close enough Anyway, things like resolution are hardware concepts that are commonly controlled on the OS level. There's certain API exposed and libraries that exist to control the hardware, but that is language independent (in a way that you just need to communicate with a certain level of abstraction) |
Author: | md [ Wed Feb 20, 2008 12:23 am ] |
Post subject: | RE:Capabilities of C++ |
BigBear, you seem to be confusing language features with functions/APIs. Things like procedures, records, and classes are language features. Things like outputting text or doing graphics work are functions which are part of separate APIs. APIs can be accessed by any language so long as you have the right interface; turing does not have the proper interfaces for almost every conceivably useful API and library in existance, and there is no easy way of adding them. This is more a fault of the compiler then the language however. |
Author: | Nick [ Wed Feb 20, 2008 1:15 am ] |
Post subject: | RE:Capabilities of C++ |
heres a pretty good rule of thumb: in languages like C++ whre things need to be imported, anything that does not need to be imported is a command and anything that does is a procedure, function, or class |
Author: | OneOffDriveByPoster [ Wed Feb 20, 2008 10:09 am ] |
Post subject: | Re: RE:Capabilities of C++ |
momop @ Wed Feb 20, 2008 1:15 am wrote: heres a pretty good rule of thumb:
Or a macro, object or type, etc. I would argue that standard libraries (defined with the language) are part of a language though. It is a design choice whether to have added functionality built into the core language or provided with standard libraries.in languages like C++ whre things need to be imported, anything that does not need to be imported is a command and anything that does is a procedure, function, or class |
Author: | Tony [ Wed Feb 20, 2008 10:34 am ] |
Post subject: | RE:Capabilities of C++ |
besides, some libraries for a language could be written in another language. Some of Ruby is done in C. |
Author: | Zampano [ Wed Feb 20, 2008 11:06 am ] |
Post subject: | Re: Capabilities of C++ |
Here's a question: Does the Turing compiler include all the modules atuomatically at the beginning of the compiling process or does it include a specific module when it sees the user trying to access a component of that module within the program (by recognizing the keywords)? |
Author: | Tony [ Wed Feb 20, 2008 11:22 am ] |
Post subject: | RE:Capabilities of C++ |
I don't know for sure, but considering the 600kb executables, I'm gonna guess that Turing's compiler doesn't do much optimization. |
Author: | ericfourfour [ Wed Feb 20, 2008 3:26 pm ] |
Post subject: | RE:Capabilities of C++ |
I'm pretty sure a compiled Turing program is the source code from your program and the interpreter packed into one exe. Since the Turing modules are automatically imported in your program, they get included as well. |
Author: | Clayton [ Wed Feb 20, 2008 9:14 pm ] | ||
Post subject: | Re: RE:Capabilities of C++ | ||
Tony @ Wed Feb 20, 2008 11:22 am wrote: I don't know for sure, but considering the 600kb executables, I'm gonna guess that Turing's compiler doesn't do much optimization.
The compiler simply lumps all of the pre-defined modules into your executable. This is why you don't have to have
in your code, they are imported by default, and as such apparently need to be all included in the executable whether you use them or not |