Finding joy in coding Using Pascal programming language

Started by
43 comments, last by jms bc 10 years, 10 months ago

If your dealing with Windows API, wouldn't it be a lot easier to use one of the "Visual Studio" suites ?


msgbox("Can't we all just get along?")

Unfortunately not everyone uses Visual Studio (especially if they want to make game/software that is actually portable). Also in most cases people seem to want to reinvent the wheel, like here: http://thedailywtf.com/Articles/A-First-Date.aspx.

Anyway from C-Like languages I particularly like Java and C#. First because of its clean, object-oriented syntax (though getters/setters gets to me and I don't use them in my own classes) and latter maybe because it was designed by guy who worked on Delphi (though I felt in love with C# thanks to Unity and learned about that same guy who worked on Delphi worked on C# also just recently). I kinda like Ruby too, but since it is only used in RPG Maker series and I rarely use RPG Maker, I don't have any occasions to practice it.

Then what do you use instead of getters and setters? Public variables?

“There are thousands and thousands of people out there leading lives of quiet, screaming desperation, where they work long, hard hours at jobs they hate to enable them to buy things they don't need to impress people they don't like.”? Nigel Marsh
Advertisement

Yes, they're more straightforward.

Now, take those two codes to some friend who isn't programmer. First show it this:


for (i=0;i<15;i++) {
Car[i]->Ignite
}

I don't particulary care if the code can be understandable for non-programmers. Because hopefully, and if we do our jobs well, they'll never have to look at it.

What I care is that its easier to type. There are a lot of curly braces around, typing {} is extremely easy, while the begin end; block isn't. The C-like for look is absolutely simple having in mind how versatile it is (no (for i=0, j=2; i < 15 && j < 20; i++, j+=4) in pascal for example). It would be better to compare it to a for each loop since it has closer functionality to the pascal for.

Besides, you underestimate how well humans can read symbols (besides complete words I mean, or collection of symbols if you prefer), give the symbol a good enough meaning, and it will stuck in there forever. For example, it happened the first time I looked at a for each loop in Java, the teacher said "read the : as "in" ". Stuck in my mind forever. for Object obj : collection sounded totally sane since then.

IMHO, C like languages hit a sweet spot between lone symbols and complete words (until you find C++ pointer arithmetic operators that is). Plenty of lone symbols so everything is fast to read and fast to type, but also a few words to mark the more complex ideas.

Have in mind that I learned to code in Ada, and make no mistake, I really like some of its syntactic (sugarish) features (say, easy range manipulation, ordinal types, etc), but I found C-like syntax much easier to deal with and the lack of procedure/function distinction liberating. Specially the procedure/function distinction part, looks like its just a way to make compiler implementator's life easier rather than the language user's life easier, or maybe it derives from a time when programmers were more mathematicians than programmers (hence the name I guess).

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

My journals: dustArtemis ECS framework and Making a Terrain Generator

Yes, they're more straightforward.

I agree

“There are thousands and thousands of people out there leading lives of quiet, screaming desperation, where they work long, hard hours at jobs they hate to enable them to buy things they don't need to impress people they don't like.”? Nigel Marsh
As above, getters and setters are often an anti-pattern. They usually indicate a failure of their parent class to actually represent some kind of useful abstraction.
If you're making classes wih loads of paired setters/getters, then public members will probably suffice, as you're just describing a data format, not a true OO 'class'.

First google result for me is: http://typicalprogrammer.com/?p=23
Of course, but can we get back to the topic?

IMO C/C++ is like cleaning your apartment after large party. Pascal is like party itself - you can get things done quickly while enjoying yourself without shooting yourself in the foot.

Also great quote from David Keppel:

C++ provides a remarkable facility for concealing the trivial details of a program - such as where its bugs are.

*shrugs* If I want to get something done quickly I'll go grab C#

*shrugs* If I want to get something done quickly I'll go grab C#

Or python

“There are thousands and thousands of people out there leading lives of quiet, screaming desperation, where they work long, hard hours at jobs they hate to enable them to buy things they don't need to impress people they don't like.”? Nigel Marsh

Pascal was actually the first programming language I used. It was before internet, and a friend had lots of patience for my endless questions by phone :)

I remember my first program, a small "piano" in text-mode "graphics", with lots of copy-paste, because I hadn't grasped the concept of "functions" yet.

Then I moved on to assembler, z80 and 68000 for TI calculators.

After a few years of that, transitioning into C and C++ felt very natural, "to get things done quickly" :)

Of course, but can we get back to the topic?

IMO C/C++ is like cleaning your apartment after large party. Pascal is like party itself - you can get things done quickly while enjoying yourself without shooting yourself in the foot.

While I could agree with your conclusions.. the points you are making in this thread to prove your positions are just highlighting your total ignorance about C++ and C and absolute lack of understanding of programming in general.

It would be interesting to see how you propose to pass a string to a C function then... that'll be really entertaining or how useful would be to pass a copy of a Widget that I want to set the text on.. amaze me.

Stefano Casillo
TWITTER: [twitter]KunosStefano[/twitter]
AssettoCorsa - netKar PRO - Kunos Simulazioni

This topic is closed to new replies.

Advertisement