PDA

View Full Version : Another Pascal vs. C argument



laggyluk
06-06-2013, 08:36 AM
Thread Created by WILL: Moved all posts to new thread. Discuss this here please.

besides, if someone takes game dev seriously, pascal is not a best choice..

Dan
06-06-2013, 08:41 AM
it is still by far not a bad choice. but what is THE best choice then?
btw we're going way off topic here=)

wagenheimer
06-06-2013, 12:10 PM
I do my living from GameDev in Pascal, and I do live very well! =)

So I think pascal is not a bad choice at all!

Rodrigo Robles
07-06-2013, 12:03 AM
Many people make games using VERY slow things like java and javascript, so Object Pascal is a very good choice.
The C-derived languages are popular because of C language. C language became popular because is fast. Java became popular because is free. Pascal was popular because was designed by professor Wirth to be didatic and readable. C language was designed after Pascal and adds no respectable features, but an ugly sintax and a pointer-oriented design that is only good to speed optimizing. Anyway modern Object Pascal has all the features that C++ has (except for multiple inheritance that is not that useful and in Pascal is emulated by interfaces).
If the best languages became popular, people today would be using Object Pascal, Eiffel and Scala. The most popular languages are just a market choice, not a technical choice.
Also, I'm very proud of my Object Pascal 3DMMORPG project: http://sourceforge.net/projects/gamemundo/
And if my game miss features, it's my fault, because the language/framework never disappointed me.

laggyluk
07-06-2013, 12:58 AM
it's easier to use existing code then reinvent the wheel and code base for C++ is huge compared to Pascal when it comes to gamedev.
Second -when looking for work in the industry Pascal is not of high demand - anyone knows of a major company using it for writing games?
For those two reasons I say that it's not optimal decision to use what we use :P I don't say it's a bad decision, just not best if someone wants to be a 'pro'.

SilverWarior
07-06-2013, 05:15 AM
it's easier to use existing code then reinvent the wheel

It is easier to start by using existing code but then if you wan't to do something uniqe you can quickly find yourself limited by that existing code.


I don't say it's a bad decision, just not best if someone wants to be a 'pro'.

Define PRO!
Do you mean PRO as game developer which works for some AAA gaming company on some game project where great graphics, superb soudeffects are more important than actual gameplay?
Do you mean PRO as game developer which works for some AAA gaming company where metting the dedline is more important than fixing gamebreaking bugs?
Or do you mean PRO as game developer which decides to go and actually do something new and uniqe despite the fact that for achieveing this he has to write most of his code from scratch?

Rodrigo Robles
08-06-2013, 09:14 PM
it's easier to use existing code then reinvent the wheel and code base for C++ is huge compared to Pascal when it comes to gamedev.
Second -when looking for work in the industry Pascal is not of high demand - anyone knows of a major company using it for writing games?
For those two reasons I say that it's not optimal decision to use what we use :P I don't say it's a bad decision, just not best if someone wants to be a 'pro'.

If the goal is to get a job in the game industry (and fortunately is not my goal), Object Pascal definitively is not the way to go. AAA is still using C++, but new multiplatform markets are focusing in new tools like Unity3D and javascript.

If the goal is to make your game by the indie way, you are free to choose your tools by the technical requisites without the influence of the market.

The best developers I know are the guys that reinvent the wheel. Guys that create new, improved and personal wheels. As much third-partie code you use, you became more user and less developer.

About to be a pro, I agree with SilverWarrior that it's like a buzzword hard to define. I would prefer words like "good" or "great" to define developers that made great software/games.

Daikrys
09-06-2013, 09:03 AM
as far as I can tell it's just the same as compiling for an android phone/tab (arm-linux), since tegra 3 is a quad-core ARM processor. I should have some fun with that as soon as I have the console.

correct, you just need to implement the conroller handling via ouya sdk and thats all :)


I rather switch to c++ than invest that kind of money into pascal development just because I like the language

you know how instable c++ is? even with some well developed engines are so unstable at some points that any developement will be interrupted. this is not my personal expierence cause i hate C syntax but some comrades in the game industry always complain about that.
as far as i can tell one of them moved to pascal for tool development and use c# for their games. most of the others switched to unity or similar game maker for that reason. and yeah they are full time game developer with mid-size companys.
i also dont believe that its easier to build android games with c++ then with pascal, there are plenty of questions in the forums on how to compile etc. (like here :>)

personally i think oxygene is really to expensive for hobby developer and since ouya might be a minor (no major!) goldrush, if you get lucky, there is truly some sort of risk getting the money you spend for tools back. (if you go pro you will get it back sooner or later)

as for me i switched to HTML5 for some professional games (and a good reason) and hope they get the controller support working before july (depency from third partie developer is no fun~). for bigger games i will still stick to pascal with its really nice syntax and enough engine building cracks around here who deliver some fine frameworks :> (unless i get six numbers on my paycheck, buy a unity license with all modules for around 10k and hire an expensive coder to handle anything, delusions of grandeur is growing~)

laggyluk
09-06-2013, 09:33 AM
you know how instable c++ is? e? not more than the person using it. harder to harness than some high level languages like c# or java but not unstable..

SilverWarior
09-06-2013, 03:20 PM
While this is moving a bit away from threads topic I still have the need to say it so please do apologize me.

First for all of you who desire to get into AAA gaming industry.
It doesn't matter what programing language you use but what you have to show of to them. If you think that you will be hired by some big AAA company just becouse you know C++ think again.
You will be hired by what you can contribute to them regardles in which programing language is that written. Why?
You do know that you can use more than one programing language in one application? Easiest way is by using either dynamic or static libraries. And yes it is also posible to use more than one programming language in making single executable. All you need for this is modified linker whcich is capable of joining bytecode from different programing languages and the fact that code is written in such way so that parts of fiinal application which are written using different programing language can comunicate with each other (same variable types, comon interfaces, etc.).
Besides if you would manage to really impres some big AAA company and they are not prepared to use some Objective Pascal code in their games they will ofer you suitable training in the programing language they use and the development tools they use.
So no need in banging your head and trying to do something in C++ if you know that you can probably do that easier in Objective Pascal as Objective pascal is programming language you are much more comfortable with.

To all those of you saying that there are just some low level things that cant be done in Objective Pascal but can be done in C++
Don't BS me! (sorry for my rugh language) Objective Pascal is one of rare higher level programming languages which still alows you to go down to lovest levels when needed.
If you wan't you can still manually initialize any object, variable you wish by caling all low level cals for doing this so by yourself.
You can use C++ style like pointers if your want. Sure debuger will bug you with warnings of potentionally dangerous code for this but you can still do it.
Infact if you want you can rewrite whole RTTI part or even whole memory manager. And if you decide in rewriting default memory manager you can look at FastMM memory manager (the memory manager newest Delphi versions now use) source code for reference. http://sourceforge.net/projects/fastmm/
So don't BS me (sorry for my foul language again) that some low level stuff can't be done in Objective Pascal. They can be done but they will probably require as much code as doing theese fearures in C++ (yes code in existing libraries is still code).
The best thing of Objective Pascal is that you are not forced to do everything on lowe level as many things are already done (maybe not in most efficient way) for you but there is nothing stopping you from reinventing the wheel.

As for stability of each programming language.
Unles you are talking about high level programming languages which doesn't alow you to go down to low level (Java, C#, .NET and alike) it all depends on programer who is working with it.
So if something witten in C++ is unstable it is only becouse at some level programer or programers which worked on that thing screwed someting up.
And since when working with low level programming langugages you have to do everything by yourself it means you have to write more code for it. And more code you write more chances you have to screw up something.

The biggest drawback of low level programming languages in comparison to high level programming languages is that for achieving same thing you ned more code. And as the code amount increases so does maintaing of this code becouse it becomes more dificult to vizualize what that code does. It is much easier to vizialize what 100 lines of code does than what 1000 lines of code does even fhou the final result might be compleetly the same.
The main reason why higher level programming languages were developed in first place is to overcome this dificulties of visualizing that lots of code.
And yes most higher level programming languages can do everything that low level programming languages can do becouse they actually use parts of low level programing languages code wraped into some higher language methods just so you don't need to write all that by yourself. Instead you can simply cal one function which can do waht 100 lines of C++ code would do.


Again I would like to apologize for some bad language I used but I realy get pissed of (here I go again) when pepole start saying that one programming language is so much better than other just becouse it is used more comonly than the other as this is in most of the times far from being truth.

Anywhay in the end it all depends on programer which is using programming language and not the programming language itself.


As for costs of investments for development tools.
While price for some development tool can be perfectly acceptable by one person that doesn't mean that it will be even acceptable by someone else as their financial situations are probably not the same.
I myself bought a new version of Delphi XE2 some more than a year ago. For me that seemed as acceptable investment even thou I'm a hobby programer who hasn't managed to compleete any of his projects yet. But probably many other wouldn't agree with me as their financial situation is probably worst than mine even thou mine is not so good either.

Whatever you do in your life you will always need to put some investments into. Now what are acceptable investments is up to each individual himself. So there is no point in arguaing about that.

Cybermonkey
09-06-2013, 04:57 PM
After all this is pascalgamedevelopment, right? So if we can't talk about our favourite language Pascal or Object Pascal here, where else? I can see no sense in comparing C++ and Pascal here, because it is a Pascal affine site. I thought Pascal programmers only talk about C++ because it only consists of comments {} ;)

paul_nicholls
10-06-2013, 10:33 AM
After all this is pascalgamedevelopment, right? So if we can't talk about our favourite language Pascal or Object Pascal here, where else? I can see no sense in comparing C++ and Pascal here, because it is a Pascal affine site. I thought Pascal programmers only talk about C++ because it only consists of comments {} ;)

haha! good one :)
I agree, we are Pascal-ers here :)

JC_
10-06-2013, 11:14 AM
How much faster is C++ than FPC ? Can it be measured ? What is the bottleneck ?

Dan
10-06-2013, 12:38 PM
the difference is marginal and depends a lot on the compiler you use. overall, gcc produces slightly faster code than fpc, but as I said the difference is fairly small.

phibermon
10-06-2013, 02:13 PM
Any good object pascal coder can do anything that a good C++ coder can do. Yes there are minor differences with various C++ compilers producing more optimized code but as Dan said, the difference is so negligible that the only time you'd make a choice based upon that metric alone is on a super computing cluster where such negligible differences can add up across many thousands of instances.

And that said, the 32bit Delphi compiler has been known to beat out MSVC in various cases (thanks FastMM)

I think the only arguments that should be made are for learning the language, what tools are available for constructing your patterns and how that effects time to market (how long it takes to finish the project, including in that sense how many people you need and the availability of those skills)

Everybody knows pascal is easier to learn and it's for a pretty basic reason really : English words used instead of symbols, which were only chosen in C back in the early days to save memory, not keystrokes. Back then they also limited var names to 8 chars giving rise to retarded practices in code where all the vars are called things like Agr, syHbal, A, B, C etc

It's also a strongly typed language which by design gives rise to far fewer bugs than C/C++. A good C/C++ programmer won't hit those bugs because they'll have a coding style that provides the same error reduction but that basically means they're manually following a process which pascal by it's very nature, enforces. A waste of effort for a new coder.

C is also case sensitive, again an archaic throwback to the low memory days where they wanted to make better use of each byte hence making the distinction between lower and upper case so I can call one var c and the other C and they're two distinct vars.

How on earth, in any sence, does case sensitivity help programmers? it simply does not, it makes code harder to read and introduces another avenue for mistakes and can lead to some really nasty bugs where you actually do have two vars of the same name but with different cases. In that instance you don't even get a warning, a simple typo causes a really hard to find bug. An experienced C coder would now argue that you avoid having the same words for vars so you don't run the risk of that happening - the response to that of course is obvious.

And then there's C/C++ string handling which is NONE. C/C++ doesn't support stings, that's left to the libs instead, string classes and so on. But there's so many different ways of handling strings in C, so many different 'standard' libs, that it's always a problem when introducing large sections of code to one another. Pascal has native strings, even native unicode support on the later compilers. All the memory handling is done for you, scope etc.

And the nice thing is that if I really wanted to, I could do strings just like any C/C++ lib does, all I have to do is process the data manually just like a C string class would do anyway.

Oh and finally, C++ was C with ++ added as it was a kind of joke that C++ is an increment of C. (++ being the increment operator) but look at this example :

int C = 5;
int D = C++;

What's now stored in D? 6? you'd think so wouldn't you? no, in fact it's 5, and C is now 6. C++ increments AFTER the var has been used, if you wanted 6 stored in D then you'd write :

int C = 5;
int D = ++C;

What I demonstrate here is that C++, the supposed evolution of C is in fact no better than C, as what's displayed in the statement is still equal to C and the incremented value has yet to be used. Not to mention that C hasn't been declared or set yet.

SilverWarior
11-06-2013, 05:36 AM
Here is some interesting article about an analysis of programer hapines one guy made:
http://codeofrob.com/entries/evented-github-adventure---sentiment-analysis-of-github-commits.html
The most interesting are results. Based on his results Delphi developers are the most happy ones :D

thegilb
18-01-2018, 08:03 PM
Any good object pascal coder can do anything that a good C++ coder can do. Yes there are minor differences with various C++ compilers producing more optimized code but as Dan said, the difference is so negligible that the only time you'd make a choice based upon that metric alone is on a super computing cluster where such negligible differences can add up across many thousands of instances.

True, but then again by that argument I could also say that any JavaScript programmer can do anything that a good C++ coder can do. Not that I'm beating on JavaScript, I actually quite like the language. The point is that you could substitute any language. Performance isn't everything. Java actually fixes quite a few problems discovered in C++ :-)


And that said, the 32bit Delphi compiler has been known to beat out MSVC in various cases (thanks FastMM)

Microbenchmarks are pretty meaningless anyway, but MSVC is far from being the final word in compiler technology. Again, if performance were everything then I'd better go learn me some (more) Fortran.


I think the only arguments that should be made are for learning the language, what tools are available for constructing your patterns and how that effects time to market (how long it takes to finish the project, including in that sense how many people you need and the availability of those skills)

Excellent, I was wondering when you'd move on to talking about SmallTalk! ;-)


Everybody knows pascal is easier to learn and it's for a pretty basic reason really : English words used instead of symbols, which were only chosen in C back in the early days to save memory, not keystrokes. Back then they also limited var names to 8 chars giving rise to retarded practices in code where all the vars are called things like Agr, syHbal, A, B, C etc

*Ahem* I'm pretty sure "those" days that you refer to were quite a bit before your time! The world of computers was very different back then, I just can't see how this is a relevant point.


It's also a strongly typed language which by design gives rise to far fewer bugs than C/C++. A good C/C++ programmer won't hit those bugs because they'll have a coding style that provides the same error reduction but that basically means they're manually following a process which pascal by it's very nature, enforces. A waste of effort for a new coder.

Well now if Pascal has a monopoly on bug free code I'm sure there's quite a lot of academics that would like to know more! Think of the defence industry and how much money they could save with bug free software!! More seriously, let's get real - Pascal's type system isn't revolutionary. It's good enough though, I'm not beating on it.


C is also case sensitive, again an archaic throwback to the low memory days where they wanted to make better use of each byte hence making the distinction between lower and upper case so I can call one var c and the other C and they're two distinct vars.

There's quite a lot of case-sensitive languages ... I guess, programmers just find naming things hard?


How on earth, in any sence, does case sensitivity help programmers? it simply does not, it makes code harder to read and introduces another avenue for mistakes and can lead to some really nasty bugs where you actually do have two vars of the same name but with different cases. In that instance you don't even get a warning, a simple typo causes a really hard to find bug. An experienced C coder would now argue that you avoid having the same words for vars so you don't run the risk of that happening - the response to that of course is obvious.

I can honestly say that I've never come across this kind of bug. Maybe it is a learned discipline, I don't really know, but I think you might be making a mountain out of a molehill.


And then there's C/C++ string handling which is NONE. C/C++ doesn't support stings, that's left to the libs instead, string classes and so on. But there's so many different ways of handling strings in C, so many different 'standard' libs, that it's always a problem when introducing large sections of code to one another. Pascal has native strings, even native unicode support on the later compilers. All the memory handling is done for you, scope etc.

I'm not too sure about that, there's just the C standard library for strings, and the standard C++ string container. Also, C++11 has standard unicode string support (hooray!).


And the nice thing is that if I really wanted to, I could do strings just like any C/C++ lib does, all I have to do is process the data manually just like a C string class would do anyway.

Why would you want to do that if C string handling is so bad?


Oh and finally, C++ was C with ++ added as it was a kind of joke that C++ is an increment of C. (++ being the increment operator) but look at this example :

int C = 5;
int D = C++;

What's now stored in D? 6? you'd think so wouldn't you? no, in fact it's 5, and C is now 6. C++ increments AFTER the var has been used, if you wanted 6 stored in D then you'd write :

int C = 5;
int D = ++C;

Aw come on that's kids stuff. Everyone knows pre-increment is write then read. If you really want to go down the rabbit hole (I know you don't) then you would have pointed out that two increments in the same statement is undefined behaviour.


What I demonstrate here is that C++, the supposed evolution of C is in fact no better than C, as what's displayed in the statement is still equal to C and the incremented value has yet to be used. Not to mention that C hasn't been declared or set yet.

That's it, I'm going to learn me some Ada!

SilverWarior
19-01-2018, 03:03 PM
@theglib Why are you resurrecting this old thread?

phibermon
19-01-2018, 04:28 PM
@theglib Why are you resurrecting this old thread?

He's an old friend trying to goad me into a debate because he misses it as much as me ;)

Four and a half years ago - no longer relevant. Reading it back I'm fairly certain I wrote the references to the increment operator as tongue in cheek - a long standing joke that didn't originate with me.

As for the other points? there are different considerations for a fledgling coder compared to a seasoned professional. Pascal was always the go-to language in academia for teaching programming techniques. Indeed the creator of the language - Niklaus Wirth - intended pascal to be used in this way. It has now widely been supplanted by Java in this role which is itself chosen over C++ for the same reasons OOP was before it : the idea is to teach programming - not syntax.

The points taken in that context are valid. Comments such as "Aw come on that's kids stuff. Everyone knows pre-increment is write then read." are not helpful since we *do* teach a lot of kids here. We're not trying to demonstrate our knowledge - we're trying to share it. :)

Ultimately you should choose whatever language you're most comfortable with that allows you to target the platforms you desire. You'll find communities out there to help you no matter what you choose.

Me and @thegilb must now play tic-tac-toe where we will eventually discover that the only winning move is not to play.

SilverWarior
20-01-2018, 08:17 AM
Ultimately you should choose whatever language you're most comfortable with that allows you to target the platforms you desire. You'll find communities out there to help you no matter what you choose.

I completely agree with that.

Anton
02-02-2019, 01:46 PM
int C = 5;
int D = C++;

This seems like a proper place to mention the D programming language - https://dlang.org/ . To me it seems like an interesting project and it has certain features which look close to Pascal.
Also, here are few examples of C++ gramatical epicness - https://www.youtube.com/watch?v=OuKkDv95uEA ;D