Blitzmax to "C" - How difficult?

Miscellaneous Forums/General Discussion/Blitzmax to "C" - How difficult?

I may be porting some code from Blitzmax to C, I've never coded in C so I'm wondering what hurdles I may face? Thanks.

Memory leaks and crashing :-)

Well, structurally its a bit similar (but so are most) but syntactically its chalk and cheese.
(and what brucey said, you have to clean up after yourself a lot)

What i would do is make a list of all the blitzmax commands you have used and recreate them with wrapper functions. It will be tough if you are new to C, i am slowly trying to do something similar fot b3d -> irrlicht in c++ and its fairly tough going.

And while you're at it, convert BlitzMax code to ObjectiveC so we can run on iPhones ;-D

I'm looking at going from writing 2D games in blitz3D to using the allegro library with C++, the commands all seem to have alternatives in C++ so it should be a simple process. And the idea of using wrapper functions to allow you to write using blitz-like code is a good one.

Learn the language first. As you have never coded in C, you will get stuck at some point for sure.

I just downloaded Visual C++ Express.

Might even install it one day, too.

One thing to read up pretty soon is SmartPointers to get BM like memory management and a large world of less memory leaks

I'm using C++ express and I really love it. Light, useful and effective.

Any suggestions on what to follow or where to look on getting started with the whole C/C++/C# thing?

Had Express burnt to a disk a long while ago (2005, may as well replace the disk with a 2008 edition) and never got around to figuring it out, mainly because I had no idea on where I should get my feet wet and figure crap out.

I'm installed C++ Express now.

I've come to the conclusion that you really need a good "idiots guide" type of book. A lot of the online tutorials I found don't make any attempt to explain what anything does; its just "type this, this and this, and run it".

I think it would be easier to port BlitzMax to C#, or to managed C++. Converting managed code to unmanaged code is near impossible to do in a clean and memory-leak free mode.

Ah yet another I'm going to learn C thread. Just go do it already, then make a thread about it :P

I started learning C++ a couple months ago, I understand most of it now... And it has made learning other languages very easy for me... I picked up PHP in less than a week.

Once you get the idea of programming, all the programming languages are easy to understand. Before Blitz3D, C++ was a nightmare for me. That's the reason I left it. Now it's a lot more clear.

For my studies I'm using "C++ Primer Plus" and "Beginning C++ Game Programming". Both are great, in-dept but not complex books.

You don't have to delve into deep pointer and memory magic to use C/C++. But if you don't there's almost no reason to use it instead of Blitz. It's not a law of physics that C code is faster than Blitz - you have to make it faster.

Many programming books at Wikibooks are actually quite good. You might want to look at the ones for C and C++ if you want to learn the language. If you know BlitzMax they are not that difficult to understand. It's just a matter of learning the syntax and some good conventions.

wow... I forgot to mention I also know PHP and to my surprise C++ and PHP have a similar basic syntax. So far, porting code from Blitzmax to C++ is no problem. :) Some nice wiki books out there, thanks for suggesting. :)

Just curious but does this mean that you are leaving BMax in favour of C++?

Jason.

Hey Mortiis,

what are you making in c++?

QS: I'll still be using Blitzmax for quite a while. But I was given the opportunity to also develop a console game and the framework used by the company I'll be working with is coded in C++. :)