2020-06-21 19:00:05 (edited by George_Gaylord 2020-06-21 19:07:21)

Hello everyone. So, it has recently come to my attension that next term I'll be learning Pascal in school. So, I wanted to skip ahead so that I could probably have time to play around and do some stuff with it by the time school reopens in September. I've got a few questions though.

1. Are there any hurdles I'll have to jump through? IE, inaccessible IDE, compillor or some other reason? Or is it accessible out of the box? Or do I have to do anything specific for accessibility with NVDA?
2. Would you recommend it for audiogame development, or just regular software development in general? Or do you suggest I just deal with it to pass my class?
3. Is it modern? I know it has some age behind it, but python does as well, and its still being developed and widely used.
4. Does it use indentation or braces? I'll find that one out when I get to the site, but I'd just thought I'd ask here as well.
5. Do you actually use it?
6. Do you think Caribbean schools should teach something better? Or is it fine for basic teaching?
7. Would you take Pascal over PB and BGT? Or are they all equal?


Eitherways, I'm going to do some reading up on Pascal today and I have a pretty good reason to get off my lazy behind and actually get into this. Any answer is nice. Thanks guys.

Edit.

I forgot to mention that all English-speaking Caribbean countries have the same secondary school syllabus, probably minusing one or two countries, so that's why I said Caribbean Schools in stead of Trinbagonian schools.

You ain't done nothin' if you ain't been cancelled
_____
I'm working on a playthrough series of the space 4X game Aurora4x. Find it here

2020-06-21 19:04:48 (edited by George_Gaylord 2020-06-21 19:08:39)

So, according to the Syllabus, I'll have to first design the algorithm, which, if I remember correctly, is basically saying, to do this, the script will have to add x and devide by z then do that. Which, I'm reasonably good at, and then they want us to do something painful. That is, having to write down my code on a piece of paper. Which is painful, because I'll have to tell my aide every, single, symbol, and, every, single indentation if Pascal has that. So, It'll be fun to see  what they'll make us do.

I almost forgot, they also want us to comment our code, which, for the love of god I hate doing with a passion. I know its something good to do, like if later on I'll need to do a rewrite, but its just like a waste of energy for me.

You ain't done nothin' if you ain't been cancelled
_____
I'm working on a playthrough series of the space 4X game Aurora4x. Find it here

2020-06-21 19:34:28

I don't know Pascal. I know of pascal.  It is one of the most archaic things I can think of, and with something like one exception (innosetup) it's not used in any major modern projects to my knowledge.  Your schools should be teaching something better.  To give you some idea just how archaic archaic is, it stopped being popular before VB6 stopped being popular, if I have the timelines right.  It was a big deal once upon a time, but unlike 3 or 4 other things it died off.  You won't have a problem with it, but you'll almost certainly never use it outside school, and the only value it will have on something like a resume is to show that you can program--I highly doubt you'd find a job hiring for it.

Commenting is a good skill to learn.  School will want you to comment more than is necessary, but when you do anything actually complicated (Synthizer, any of my projects at work, etc etc etc) having a big block comment at the top of the file saying "Here are the relationships between the pieces here, this is why it's this way, here are the major steps to this algorithm" are major time savers later when you have to come back to it, and allow others to collaborate.  Plus, if you can't write such a comment, it's a good sign that maybe you need to think more before coding.  Unfortunately school is going to be like:

# If x is less than 5
if x < 5

Because it's school, and if I recall it's high school, which usually doesn't teach programming worth anything.

My Blog
Twitter: @ajhicks1992

2020-06-21 19:44:39 (edited by Rastislav Kish 2020-06-21 19:46:22)

Hello,
@1: take my deepest condolences.

1. Regarding accessibility no, as long as you use command line compiler, I don't know about ides.
2. No, powered to 10. I would rather use bath script than Pascal, personal opinion.
3. No. It is taught in schools, that's true, but that's simply about the fact, that many schools, including universities are simply not modern. Pascal is a very old functional language without oop and while its newer forks introduce some object oriented programming, the result is quite weird.
4. None of that. Instead of { and }, in Pascal, you use begin and end.
5. not anymore... luckily.
6. Yes, they definitely should.
7. Definitely not. I don't know about Pure basic, as I never used it, but BGT in terms of audiogames development is a much better choice than Pascal. Videogames development would be another thing though, here you would probably have to decide between Pascal and PB.

As for dictating your code to paper, if you can't actually simply print it, one thing, which you may find useful on Pascal is, that it's case insensitive. Thus you don't need to spell names of things character by character, but can actually say them as normal words.
As for Pascal's popularity, this is of course hard to summary objectively, but from all kinds of statistics I've seen, I don't remember a singleone where pascal would have at least middle place. There are few projects using it currently, Cheatengine for example if I remember right was made in Pascal, but overall the language is dying, if not dead already.
So if I was in your place, I would use it just for the school, and invest the time to something more useful.

Best regards

Rastislav

2020-06-21 19:45:56

Ouch. The commenting sounds quite painful. But seriously though, I should actually get into it.

About 2 years ago or so, we were talking about file extensions and I can't remember how, but .pas ended up coming up. Then, our teacher was like, its not important for now, but later on yule learn to programme in Pascal then it'l be Important. I actually checked it out, then I forgot about it, because I thought we may learn something else, like python or even C, but today I found the syllabus and realised its true.

Oh and @Camlorn, apparently they haven't changed the syllabus in seven years, hence why Pascal is still being taught. You'd think with reading all the stuff they wrote in the syllabus, about how they want Caribbean students to be literate in not just languages, but with technology, and yayadadadadada blah, blah blah, you'd think they'd at least let us learn Python or something a little more modern

You ain't done nothin' if you ain't been cancelled
_____
I'm working on a playthrough series of the space 4X game Aurora4x. Find it here

2020-06-21 21:07:34

@5
Even U.S. universities do bad at this.  See also every school that teaches C as a first programming language while expecting good results.  I suspect your schools don't care because updating it is expensive, and whatever language you learn in high school doesn't matter anyway, because high school level programming stops very far short of even introductory university-level courses in most cases.

Commenting in the way I describe isn't painful.  I suspect that the actual problem is that your thought processes are not yet developed enough for it to be painless.  Good comments come from a  very good understanding of what you're writing before you write it, or from the points where it turned out the obvious understanding was wrong.  But that requires some degree of proficiency that you may not have yet.  Also I'm not saying I comment every file--good code that does simple things stands alone.  But from Synthizer's internals, as something I would consider a good comment which I happen to have open in another window:

/*
 * Buffers hold decoded audio data as 16-bit samples resampled to the Synthizer samplerate.  The following entities are involved:
 * 
 * - A BufferData holds the data itself.
 * - A Buffer holds a reference to a BufferData.
 * - A BufferChunk holds a non-owning reference to a chunk from a buffer.
 * 
 * A BufferReader type is also provided, which provides convenience methods for reading without having to deal with assemblying objects yourself.
 * 
 * Design justifications/explanations:
 * 
 * - We use 16-bit samples because this is enough for audio playback, and it cuts ram usage in half w.r.t. floats.
 * - We store data in noncontiguous chunks in order to assist low memory systems, and also because this makes it harder for someone to just copy audio data out with a debugger,
 *   since doing so would require walking our internal structures. Also, branch prediction should make reading cheap.
 * - We resample first for CPU usage purposes.
 * - A Buffer and BufferData are separate types because we can expose Buffers through the C API, which will allow us to offer a BufferCache in future,
 *   rather than making everyone implement this themselves.
 * 
 * Most of this file is inline because otherwise things get expensive very quickly short of compiling with LTO and optimization and it would be nice to be able to use these in debug builds.
 * */

You still have to read the code to fill in the gaps, but the comment fills in the gaps the code doesn't explicitly talk about, and you get an overview of what the literally 100 plus lines in this file are going to be doing without having to read them all first.

Now obviously commenting how school is probably going to want you to, that's going to suck.

My Blog
Twitter: @ajhicks1992

2020-06-21 21:08:26

Also I lied, that file is 246 lines.  To put it in perspective as to why the comment is valuable.

My Blog
Twitter: @ajhicks1992

2020-06-21 21:12:58

@op, I can tell you that I have never seen pascal used in anything I've downloaded other than cheat engine and Innosetup. Pascal is pretty much dead. Its been dead for a long, long time. It doesn't help that there are like 3 different variants of it either (object pascal, pascal, turbo pascal, delphi pascal...). If they want to teach you something unusual, they'd be better off teaching you Ada. smile As for answers to your questions:
1. Are there any hurdles I'll have to jump through? IE, inaccessible IDE, compillor or some other reason? Or is it accessible out of the box? Or do I have to do anything specific for accessibility with NVDA?
There is a compiler -- free pascal -- that's just CLI-based. There's an IDE too, but that's pretty much entirely inaccessible.
2. Would you recommend it for audiogame development, or just regular software development in general? Or do you suggest I just deal with it to pass my class?
Deal with it to pass your class. You have no reason to use it anywhere else, and no modern workplace even uses it. (That makes me think of COBOL... I don't even think anyone uses that anymore either.)
3. Is it modern? I know it has some age behind it, but python does as well, and its still being developed and widely used.
The difference between Python and Pascal is that Python was made in 1990 and is still actively maintained; Pascal was made in 1970 and, to my knowledge, no one maintains a compiler for it anymore.
4. Does it use indentation or braces? I'll find that one out when I get to the site, but I'd just thought I'd ask here as well.
Neither. I'll show you a hello-world program in a moment.
5. Do you actually use it?
No. I have no use for it anywhere.
6. Do you think Caribbean schools should teach something better? Or is it fine for basic teaching?
By far, yes. They should. They should be teaching you C/C++ like every other university does.
7. Would you take Pascal over PB and BGT? Or are they all equal?
No.
As a hello-world program... from Rosetta Code:

program HelloWorldGraphical;

uses
  glib2, gdk2, gtk2;

var
  window: PGtkWidget;

begin
  gtk_init(@argc, @argv);

  window := gtk_window_new (GTK_WINDOW_TOPLEVEL);

  gtk_window_set_title (GTK_WINDOW (window), 'Goodbye, World');
  g_signal_connect (G_OBJECT (window), 
                    'delete-event',
        G_CALLBACK (@gtk_main_quit),
        NULL);
  gtk_widget_show_all (window);

  gtk_main();
end.

Yes, the period with "end" is required.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2020-06-21 21:16:07

Also, @6, yeah, I need to start commenting my code that way too. I use Rust but the concept is the same...

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2020-06-21 21:20:07

what in the world is oop?

I am a divine being. I can be called a primordial deity, but that might be pushing it, a smidge. I am the only one of my kind to have ten tails, with others having nine. I don't mean to sound arrogant, but I have ascended my own race.

2020-06-21 21:20:55

@8
Cobol is still widely used in the banking/financial sector, and the last update to the standard for it was (I think) 2014.  I don't have specific sources on hand, but my understanding of that one is that basically there's around a billion lines of code or so powering the financial industry, banks, and the IRS, and a massive shortage of Cobol programmers because no one teaches it anymore.  So there's a very good possibility that if you did know that one, you could just name your price.

It was originally designed by people entirely outside the CS/programming industry in the 60s who wanted a language for such people, then got used in all the places like banks where the software is so far from the point that the devs are those annoying people who make it possible for the actually important people to get their jobs done, and it's still there because those sorts of industries won't rewrite anything until the computers are melted heaps of slag.

My Blog
Twitter: @ajhicks1992

2020-06-21 21:22:32

@10 OOP is object oriented programming. Also known as how you sound cool when you want to talk about how you use classes for stuff in a job interview.  OOP features just means "has classes and inheritance" basically.

My Blog
Twitter: @ajhicks1992

2020-06-21 21:43:55

@11, yeah, tat sounds like the modern business: "Lets use ancient stuff until it just doesn't work any more. And for our IoT and embedded systems, lets not update or patch them because we supposedly don't have the money (though it usually doesn't cost)."

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2020-06-21 21:48:55

I need to start commenting like you, camlorn. I hardly ever do. I'll probably just have a comment at the top of the file, because seeing
"""
This function does blah, blah blah and blah.
It returns blah.
It takes these arguments, a, b, c, d, e, f, oh and also g.
"""
And then every like third line has
# This does this.
That drives me crazy, personally. But large comments at the top of files like that are actually useful.

2020-06-21 21:49:49

To clarify, I don't mind docstrings or comments describing what a function does. I do mind however having one of those and then commenting every like third line of code as well.

2020-06-21 21:50:46

Lol school again.

You ain't done nothin' if you ain't been cancelled
_____
I'm working on a playthrough series of the space 4X game Aurora4x. Find it here

2020-06-21 21:51:30 (edited by George_Gaylord 2020-06-21 23:57:02)

Agreed with Ty

You ain't done nothin' if you ain't been cancelled
_____
I'm working on a playthrough series of the space 4X game Aurora4x. Find it here

2020-06-21 22:35:17

Okay, in case anyone wanted this, I found an opened source Pascal game. But don't ask me about the acessibilty. Its truly a cross platform game, minus Android as usual.

http://www.hedgewars.org/download/relea … .0.tar.bz2


Maybe this can benefit somebody.

You ain't done nothin' if you ain't been cancelled
_____
I'm working on a playthrough series of the space 4X game Aurora4x. Find it here

2020-06-22 00:01:10

And if you wanted even more resources, I found a intro guide, that I think teaches you how to do stuff with the terminal, so if you're in a situation like me, here's a ok resource.

https://castle-engine.io/modern_pascal_ … ction.html

You can also find a crossplatform game engine on there.

You ain't done nothin' if you ain't been cancelled
_____
I'm working on a playthrough series of the space 4X game Aurora4x. Find it here

2020-06-22 19:50:47 (edited by zenothrax 2020-06-22 19:55:22)

camlorn wrote:

To give you some idea just how archaic archaic is, it stopped being popular before VB6 stopped being popular, if I have the timelines right.  It was a big deal once upon a time, but unlike 3 or 4 other things it died off.

You're correct in saying that it died off before VB classic did, but let me lay out the timeline a bit, so you get how old Pascal and BASIC are. I'll explain the creation and increase in popularity throughout the 70's, then I'll skip ahead to the 90's when the languages reached their peak among PC programmers.

  • 1964: John G. Kemény and Thomas E. Kurtz create the original BASIC (Beginners, all-purpose, symbolic instruction code) at Dartmouth College, after being frustrated by Fortran.

  • 1970: Niklaus Wirth creates Pascal, named after the famous Blaise Pascal, after becoming frustrated with Algol60 and failing to improve it with the AlgolW project.

  • 1973: "101 BASIC Computer Games" is published by David Ahl, and BASIC's popularity on minicomputers such as the DEC PDP series and HP 2100 series, increases.

  • 1975: Microsoft's first product was, in fact, a version of BASIC for the MITS Altair 8800, one of the first personal computers.

  • 1976: Microsoft ports BASIC to the MOS Technology 6502 microprocessor.

  • 1977: UCSD Pascal, one of the early versions of Pascal to be ported to various personal computers, is created at the University of California, San Diego.

  • 1978: Steve Wozniak creates Integer BASIC for the Apple I, which is added to the ROM chip for the Apple II.

  • 1979: Apple Computer publishes Apple Pascal, based on UCSD Pascal, for the Apple II.

  • 1989-1990: Turbo Pascal 5.5 and 6.0 were released. These were the first to bring object-oriented features to IBM PC users, since Object Pascal was created by Apple and had been used by Macintosh programmers since 1985.

  • 1991-1992: Microsoft introduces Visual Basic 1.0 for Windows 3.1 and DOS.

  • 1993: Visual BASIC 3.0 is released. This was the first extremely popular version of VB, and was the first to support reading and writing of Access databases. Borland releases Turbo Pascal 7.0, the first version to support creation of Windows executables and DLL's and introduce syntax highlighting.

  • 1995: Microsoft introduces Visual BASIC 4.0, the first version that could create 32-bit as well as 16-bit Windows programs. Borland introduces Delphi 1.0 for Windows 3.1, based on Turbo Pascal for Windows, and is one of the first examples of Rapid Application Development.

  • 1996-1997: Borland releases Delphi 2 and 3. Delphi 2 introduced support for 32-bit Windows, and Delphi 3 introduced support for the COM architecture.
    Microsoft introduces Visual BASIC 5.0, the first version to exclusively support 32-bit Windows and support for user-created controls.

  • 1998: Visual BASIC 6, the most popular edition of VB classic, is released. A major improvement was introduced in VB6, that is, to allow creation of web-based applications. Borland, then called Inprise, releases Delphi 4.0, which includes improvements such as method overloading, dynamic arrays, Windows 98 support, Java interoperability, and high performance database drivers. It was the last version shipped with Delphi 1 for 16 bit programming.

Whereas Visual BASIC was replaced with VB.net, Delphi still exists. Inprise, which went back to the Borland name, now known as Embarcadero, still sells Delphi. Although Borland/Embarcadero did produce versions of Delphi for the .net Framework, support for delphi.net was dropped in 2009. The latest version of Delphi is Embarcadero Delphi 10.3, codenamed Rio.

#FreeTheCheese
"The most deadly poison of our times is indifference. And this happens, although the praise of God should know no limits. Let us strive, therefore, to praise Him to the greatest extent of our powers." - St. Maximilian Kolbe

2020-06-22 20:59:19

While it would be better if they had you learn other languages like Java, C++, javascript, or python, there will be many things you will learn from studying Pascal that will help you when you learn the other languages. In its time, Pascal was mostly considered a good language to use for scientific purposes. 

As you learn other languages, you will find that their IDE's range in accessibility.  However, for most languages, you can use something like Notepad++ and the command line to write and compile your code--the IDE just adds features to make the process easier.

Actually, a big reason why so much COBOL code is around is because it is both old and complex and the process of rewriting it to another more modern language is expensive.  There is a shortage in COBOL programmers right now so if you are competent at working with COBOL, you can get a good paying job. 

When it comes to commenting code, no one seems to be very good at it until they have had to maintain either someone else's code or something they coded a long time ago.  That is when it becomes much easier to see which parts of the code are easily understandable and which parts of the code could use a comment to ensure they are easier to understand.Good luck in learning pascal!
When it comes to commenting code, it see

2020-06-22 21:41:01

Hmm, so i can do it in a text editor? Because lazarous is inaccessible as lemons.

You ain't done nothin' if you ain't been cancelled
_____
I'm working on a playthrough series of the space 4X game Aurora4x. Find it here

2020-06-22 22:13:05

I took a college course in Turbo Pascal back in 2008 or so. At the time, I didn't know of a command line compiler, so I used the IDE that the college told us about. It was a DOS program, and it took me a week to figure out how to make JAWS work with it. Once I figured that out, it worked really well. If you are able to get it to work with a command line compiler, do it. I wish I had known about one at the time.

2020-06-22 22:37:20

I would suggest you use the Free Pascal compiler, which has support for the Turbo Pascal syntax. There is a VS Code Extension for Pascal if you want to use it.

#FreeTheCheese
"The most deadly poison of our times is indifference. And this happens, although the praise of God should know no limits. Let us strive, therefore, to praise Him to the greatest extent of our powers." - St. Maximilian Kolbe

2020-06-22 22:39:44

Hmmm.
Well access wize at university 10 years back, you will use something called freepascal.
Search it on the net, get and install it and all its stuff.
Now, you can't just use freepascal itself.
www.bloodshed.net, bloodshedsoftware have dev pascal which is a windows app that will lock into pascal and allow you to compile things.
It was accessible, at least I think it is still, do not know about any of this still being about because it was at least 15 years back I did this kind of thing but back in 2005 it was.
I was still using xp though.
Anyway you would start with begin and end with end.
You would have many writelns, for input and readlns for output and between this the opperations.
As long as you can read in a console then you will probably be ok.
I only learned the basics of programming here.
You basically need to write a few math problems to output to consoles and thats about it.
No linking, no units, no dlls, not even other modules.
Its basically to show you programming.
Pascal has no use outside university unless you learn delphi.
I really wish my university did python or something at least thats rellivant especially now.
The other thing I was taught was basic javascript for internet explorer.
I guess now it would be java or something a bit more usefull to be honest.
I never got into c or c++ though bloodshed do have a c++ compiler which is contained.
To be honest if I was going to learn programming, for a start, I'd start with something simple like bgt then move to python.
Technically if you master c you can jump to anything, though if I was moving to the c language or something I'd start with the mono or dotnet stuff which aparently is supposed to be modular and not as hard to learn.
Its a real shame there isn't gw basic or any basic for windows.
I don't know why microsoft doesn't include some simple basic language for windows but then windows aint simple anymore.