View previous topic :: View next topic |
Author |
Message |
Delphi Coder How do I cheat? Reputation: 0
Joined: 04 Feb 2015 Posts: 2
|
Posted: Sun Feb 08, 2015 10:32 am Post subject: |
|
|
Learn Delphi.. . Its a beast and pretty easy
|
|
Back to top |
|
|
atom0s Moderator Reputation: 198
Joined: 25 Jan 2006 Posts: 8517 Location: 127.0.0.1
|
Posted: Sun Feb 08, 2015 10:14 pm Post subject: |
|
|
Freiza wrote: | But python is good and is better designed than C++. |
This made me laugh fairly well, lol.
_________________
- Retired. |
|
Back to top |
|
|
zm0d Master Cheater Reputation: 7
Joined: 06 Nov 2013 Posts: 423
|
Posted: Mon Feb 09, 2015 4:00 am Post subject: |
|
|
Freiza wrote: | But python is good and is better designed than C++. |
This one was great!
|
|
Back to top |
|
|
SteveAndrew Master Cheater Reputation: 30
Joined: 02 Sep 2012 Posts: 323
|
Posted: Mon Feb 09, 2015 6:07 am Post subject: |
|
|
Freiza wrote: | But python is good and is better designed than C++. |
But, but... I don't think it's fair to even attempt to compare them like that. One is interpreted and the other compiled. One has to be interpreted then converted to compatible machine code, the other already is machine code (after being compiled).
It's still inevitable that you have to end up with machine code, so wouldn't you rather already be there? Or instead you'll be late to the party Still converting those lines of text strenuously...
I mean it's like 100x faster, using 1/3 of the memory, and maybe a little bit more source code but so what? I mean 100x as fast or near it is making a pretty bold statement
http://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=gpp&lang2=python3
_________________
|
|
Back to top |
|
|
zm0d Master Cheater Reputation: 7
Joined: 06 Nov 2013 Posts: 423
|
Posted: Mon Feb 09, 2015 6:17 am Post subject: |
|
|
SteveAndrew wrote: | Or instead you'll be late to the party |
Sometimes this ain't bad. You know, them girlz are already drunk and looking for someone who knows how injections work. Then I start to explain it to her, but after my first few sentences she gets up and goes... I dont know. I explained everything correct. #foreveralone
|
|
Back to top |
|
|
atom0s Moderator Reputation: 198
Joined: 25 Jan 2006 Posts: 8517 Location: 127.0.0.1
|
Posted: Tue Feb 10, 2015 11:54 pm Post subject: |
|
|
The argument of 'more code' is fairly laughable. Comparing language features saying 1 has 'x' and the other doesn't can go both ways. Python does not come stock with a lot of things, instead of you have to install all kinds of modules to get a lot of different functionality that comes stock in C/C++. C++ is similar in needing to reference external libraries. Comparing a language and saying it's better because it has 1 thing built in the other doesn't is fairly fail argument. It just turns into a fan-boy crying cause someone else doesn't agree.
Like Steve mentioned, C/C++ is already compiled down to machine code, while Python is interpreted. It is automatically going to be slower just because of that one simple fact. On top of that, the memory foot print, again as Steven mentioned, for Python is rather large, where as for a C/C++ app depending on what is used can be virtually nothing.
As for the suggestion that Numpy makes Python fast, it is nothing more then another python library sitting on top of the interpreter. Regardless of how fast the library is, it is only as fast as the language. Ask any professional Python developer, they will tell you it is not a fast language and it is most definitely not meant for anything high-end like a game engine. This does not mean its impossible, it is just impractical.
I don't hate Python, but I totally disagree for using it in this purpose.
_________________
- Retired. |
|
Back to top |
|
|
Freiza Grandmaster Cheater Reputation: 22
Joined: 28 Jun 2010 Posts: 662
|
Posted: Wed Feb 11, 2015 6:39 am Post subject: |
|
|
SteveAndrew wrote: | Freiza wrote: | But python is good and is better designed than C++. |
But, but... I don't think it's fair to even attempt to compare them like that. One is interpreted and the other compiled. One has to be interpreted then converted to compatible machine code, the other already is machine code (after being compiled).
It's still inevitable that you have to end up with machine code, so wouldn't you rather already be there? Or instead you'll be late to the party Still converting those lines of text strenuously...
I mean it's like 100x faster, using 1/3 of the memory, and maybe a little bit more source code but so what? I mean 100x as fast or near it is making a pretty bold statement
http://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=gpp&lang2=python3 |
Yes I know, indeed C++ is faster than any variant of python. Here is a speed comparison (Copied from internet)
PHP 5.3.8 : 24.073 [s]
Python 2.6.5 : 11.9 [s]
Node.js 0.8.1 x64 : 2.325 [s]
Java 1.7 / optimized opts : 1.116 [s]
Python 2.7.2 / PyPy 1.9 (bin x32): 0.830 [s]
C++ / VS2010 : 0.418 [s]
Free Pascal 2.6.0 x64 : 0.388 [s]
0.418 < 0.830
But I don't see any significant issue here. Btw, Rpython is much faster than pypy.
I am learning RPC in C++ using MIDL and it scared shit out of me.
Again, Com is designed for c++ but I find using com with python much easier. Same is with Qt and pyqt.
I can find no good libraries for excel in C++ though excel was made in c++.
And (0.418, 0.830) vs (1 week of python, Years of C++ training)
My point here is that C++ is fast but its learning curve is much much steeper than python.
And python has reflection which c++ doesn't have.
C++ grammar is made of around 770 pages of specification while python is much smaller.
Quote: |
The argument of 'more code' is fairly laughable. |
No it is not. Less code == more readability and hence more maintainability.
If you want to write code, write it in C++. But if you want to read your code write it in python. Just check list comprehensions in python and you will see what I mean.
_________________
Last edited by Freiza on Wed Feb 11, 2015 7:48 am; edited 2 times in total |
|
Back to top |
|
|
zm0d Master Cheater Reputation: 7
Joined: 06 Nov 2013 Posts: 423
|
Posted: Wed Feb 11, 2015 7:01 am Post subject: |
|
|
Freiza wrote: | If you want to write code, write it in C++. But if you want to read your code write it in python.
|
That's subjective. One who's very experienced in C++ can read code also easier.
Well, of course less code is more readable and more easy to maintenance, but it also limits your power. Since this discussion started from the point of game developing, C/C++ is unbeaten. If you might develop some software application, where performance is not important, you'd probably stick to dotNet, Java or Python, since the maintenance here is way easier and to shoot yourself in the leg is a more likely a challenge, instead of something that simply happens cause of mishandling memory.
Todays computers getting faster and faster and languages like C# tend to have a great future in game devoloping, though it's slow compared to C. The hardware is getting good enough to compensate that performance difference.
|
|
Back to top |
|
|
Freiza Grandmaster Cheater Reputation: 22
Joined: 28 Jun 2010 Posts: 662
|
Posted: Wed Feb 11, 2015 7:10 am Post subject: |
|
|
zm0d wrote: | Freiza wrote: | If you want to write code, write it in C++. But if you want to read your code write it in python.
|
That's subjective. One who's very experienced in C++ can read code also easier.
Well, of course less code is more readable and more easy to maintenance, but it also limits your power. Since this discussion started from the point of game developing, C/C++ is unbeaten. If you might develop some software application, where performance is not important, you'd probably stick to dotNet, Java or Python, since the maintenance here is way easier and to shoot yourself in the leg is a more likely a challenge, instead of something that simply happens cause of mishandling memory.
Todays computers getting faster and faster and languages like C# tend to have a great future in game devoloping, though it's slow compared to C. The hardware is getting good enough to compensate that performance difference. |
You are correct.
But this thread started as someone mighty as you and wiccaan suggesting a newbie like me to choose C++ for game development. Game development is pretty hard (If you are not using drag and draw type of engines). I feel first you should learn the mechanics of game programming and game mathematics. It will be very very easy if you start with python first and then optimize the required modules in C++.
I feel that OP is relatively new to programming and wants to learn game programming (If this is the correct case) then I suggest him to learn easy language and dive into quirks of game programming and then optimize it.
This is my suggestion. But I feel it is being taken as debate. And I don't want you all to think this thread as a debate, I am still learning a lot from all of you.
_________________
|
|
Back to top |
|
|
zm0d Master Cheater Reputation: 7
Joined: 06 Nov 2013 Posts: 423
|
Posted: Wed Feb 11, 2015 7:15 am Post subject: |
|
|
Freiza wrote: | This is my suggestion. |
And that's good. Learning C/C++ as a beginner can really be hard and demotivating over time. Other languages might help here really much to get a general understanding.
Freiza wrote: | I am still learning a lot from all of you |
Me too. And it will never stop. Being ready to learn something is the key to success.
|
|
Back to top |
|
|
SteveAndrew Master Cheater Reputation: 30
Joined: 02 Sep 2012 Posts: 323
|
Posted: Thu Feb 12, 2015 12:42 pm Post subject: |
|
|
zm0d wrote: | SteveAndrew wrote: | Or instead you'll be late to the party |
Sometimes this ain't bad. You know, them girlz are already drunk and looking for someone who knows how injections work. Then I start to explain it to her, but after my first few sentences she gets up and goes... I dont know. I explained everything correct. #foreveralone |
LOL! I can't believe that didn't work! Next time set a break point and single step instead, on second thought make sure you step over because you want to skip over those calls (to her 'guy friend' of course ^_^). If that doesn't work you can always try a break and trace and see where things went wrong
Freiza wrote: |
I can find no good libraries for excel in C++ though excel was made in c++. |
I guess you didn't find LibXL when you looked for one?
http://libxl.com/
Code: |
#include "libxl.h"
using namespace libxl;
int main()
{
Book* book = xlCreateBook(); // xlCreateXMLBook() for xlsx
if(book)
{
Sheet* sheet = book->addSheet(L"Sheet1");
if(sheet)
{
sheet->writeStr(2, 1, L"Hello, World !");
sheet->writeNum(3, 1, 1000);
}
book->save(L"example.xls");
book->release();
}
return 0;
}
|
I used it for my old boss, when I had to extract data from excel files and use that data in an application... It made it simple, I really did not want to write my own excel library! lol I saved a good amount of time there. Not that I couldn't of done it, but I would've ran into bugs and issues that I'd of had to sort out(it is a proprietary microsoft format after all), whereas the ready to go library, those guys who made it already went through that
Quote: |
The argument of 'more code' is fairly laughable. |
Freiza wrote: |
No it is not. Less code == more readability and hence more maintainability.
If you want to write code, write it in C++. But if you want to read your code write it in python. Just check list comprehensions in python and you will see what I mean. |
Well I think what he was saying was it isn't necessarily more code, depending on how you write your code. That was just a little test that website did. My C++ code is usually pretty short and tidy.
I'll also disagree on the readability... I can read C++ code better than python code and probably better than any kind of code. That's only of course because I know C/C++ and I don't really know python, though I have played with it a tiny bit before!
P.S. did you like my little 64-bit assembler number adder?
Now I'll re-write it in 8-bit 6502 Assembler (The NES's CPU) LOLOLOLOLOL Just kidding!!!! lol
_________________
|
|
Back to top |
|
|
mgr.inz.Player I post too much Reputation: 218
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Thu Feb 12, 2015 3:02 pm Post subject: |
|
|
I wrote numbers multiplier in Commodore 64 Basic V2, 15 years ago.
Everything on strings. Multiplying two 15-digit numbers took 10 seconds.
You want it? lol
_________________
|
|
Back to top |
|
|
Freiza Grandmaster Cheater Reputation: 22
Joined: 28 Jun 2010 Posts: 662
|
Posted: Thu Feb 12, 2015 8:21 pm Post subject: |
|
|
SteveAndrew wrote: |
I guess you didn't find LibXL when you looked for one?
http://libxl.com/
|
Doesn't have charting features. You have to use com or make a dll then use VBA to draw a chart.
_________________
|
|
Back to top |
|
|
|