- Joined
- May 23, 2011
- Messages
- 1,607
- Reaction score
- 588
Golang is a terrible language to write software in.Should've opted for Golang, fool
3rd time, what's next?
4th time.
Java > Python > C++
3 times.
For me its:
C++ > Java > Python
When properly written, C++ will outperform both languages. But then again, every problem or application has its own best solution. Only reason I would write something in Python is for like a web api or some other web stuff that requires calls. No big programs. If I need high performance I would go with C/C++.
Your contrived benchmarks don't mean much; if Python can be used by companies like Dropbox and Instagram, what makes your habbo emulator so special?
Also, Quackster, if you were using modern python techniques it would probably be more pleasant to use.
Quackster:
Is your source code anywhere publicly available? I would love to see all the memory leaks you're creating! (No jk, just want to give some feedback)
Also, why Visual C++??? I mean out of everything you could've picked you pick THAT.
PS: Avoid this-> all together in C++. Except when you're having ambiousity (Or however you write it) or have to pass a pointer to a function. Its cluttering and the majority of the C++ community avoids this as much as possible. Use naming conventions.
Also you have atleast 2 memory leaks in your Request class.
Also you read a short but return it as an int. Int is platform depended and may not always be equally sized as a short. (My suggestion don't use int at all but use long (Or even better use int<bitsize>_t eg int32_t)
I don't think you have to cast the chars to unsigned char in readShort. (1: They keep their bit pattern anyways, 2: you already read from an char*)
I wish you luck, because you will need it.
Don't know.
Java > Python > C++
3 times.
After 3 comes 4.
Right, but this is the second time I've changed languages, third time I've started over. How is that hard to understand?
Source isn't available, yet.
I'm using Visual Studio because that was the first thing I had. Moving to CLion later if I can figure out how to fix a problem where stopping the debug doesn't actually close the process.
There's nothing wrong with Visual Studio, so don't push your opinion on to me.
No.
No. I don't. I tested this over and over again and I don't.
Shouldn't be a problem because I'm converting shorts to integers, not the other way around.
I do, otherwise the outcomes are different.
You're the one who needs luck around here, you seem to assume that I didn't put things the way I did for a reason.
According to The General "Memory leak 2" return a smart pointer instead of a raw one. And maybe delete the "full_message" in the deconstructor?
After all good luck with your C++ server!
What..? I didn't mention C++, or Java. You need to learn basic literacy.Because the reason they picked python for it is because they can easily without too much hassle make it distributed. Something which is also possible in C++ but is a bit more difficult to implement and maintain.
Its also the reason why a lot of these services (reddit, paypal, google) moved from Java to Python. The JMS is just slower and it was easier to move to Python.
Btw checkout Boost.Asio. It's awesome and it supports cross-platform networking.
*tik tik tik tik* ... (when will it go boem?)
Clion and Visual C++? Goodluck with that because CLion uses CMake and visual C++ has its own buildtools.
Memory leak 1 is in your constructor, you take a char* but you will never delete it.
Memory leak 2 is in your read string method. You return a char* but you will never delete it. If you call new you have to delete it at some point.
I noticed my links were messed up, here you go fam:You must be registered to see links
If I wanted to use C++ I'll use C++, there's no "should've". Sorry.:
Fixed.
Did you even read what I said? Dude.. c'mon I said I'm moving to CLion and Cgywin32 if I can figure out an issue I'm having where if I cancel the debug, the actual process isn't closed.
Actually, since that array was never created with "new" it's been automatically memory allocated, instead of being dynamically allocated (like pointers are) so when the object goes out of the scope, it will be deleted automatically.
Using std::string now without any "new" keyword, so once it goes out of the scope it will be automatically freed.:
You did not mention Cygwin, which is only a set of linux like tools for windows and provides a linux like API. Also Cygwin isn't really needed, MingW should suffice. (As you only need the GCC compiler).
I don't think you've got any clue what you're doing and probably just following some tutorials on the internet....
Also CLion uses CMake so you need that too.