Recent

Author Topic: Using Lazarus to teach Introduction to Programming  (Read 1692 times)

EganSolo

  • Sr. Member
  • ****
  • Posts: 398
Using Lazarus to teach Introduction to Programming
« on: April 21, 2026, 02:29:30 pm »
Soon, I'll be teaching an introduction to programming class for honors students at a high school. I’d like to use Lazarus as the IDE. However, since the class is focused on fundamentals, there won’t be any GUI programming.

1. Has anyone configured Lazarus to support console programming only? No component palettes and no object inspector? I know I can hide the Object Inspector by closing it, but I don’t know if it’s possible to hide the component palette ... Alternatively, is there a better environment suited for that sort of coding?

2. The school provides Chromebooks. Can I run Laz on such an environment or is it sketchy? What of FP?

3. If you've taught Intro to Programming with Laz, how did you configure it?

Thanks.

Thaddy

  • Hero Member
  • *****
  • Posts: 19117
  • Glad to be alive.
Re: Using Lazarus to teach Introduction to Programming
« Reply #1 on: April 21, 2026, 02:35:01 pm »
Lazarus already has the console program option.
But simpler than "File|New|Simple program" it won't get....
Code: Pascal  [Select][+][-]
  1. program Project1;
  2. begin
  3.  
  4. end.
You can also create your own template. Which may or may not be more appropriate. In my teaching days at University (early 80's ) and much later as a Borland certified trainer (1993), I wrote my own templates with instructions what should go where.

Pascal is still one of the best teaching languages, although I would prefer Python nowadays.

The most important thing is that the teacher is prepared, which means paying attention to the material, both your own and from external sources.

Success!
« Last Edit: April 21, 2026, 02:43:08 pm by Thaddy »
objects are fine constructs. You can even initialize them with constructors.

440bx

  • Hero Member
  • *****
  • Posts: 6462
Re: Using Lazarus to teach Introduction to Programming
« Reply #2 on: April 21, 2026, 02:42:10 pm »
However, since the class is focused on fundamentals, there won’t be any GUI programming.
I'd like to suggest you reconsider that decision.   The reason for the suggestion is that people who are first extensively exposed to console type programming, later have difficulties managing the fact that they do not own the display.  (Many MS-DOS programmers had a hell of a hard time wrapping their head around the concept of a windowed environment because of their being used to the programs "owning" the display (not to mention "owning" everything else too.))

I believe that the first few classes should be an introduction to GUI programming, focusing on the fact that the display is a shared resource and the ways it is shared.  Spend a few, maybe 3 or 4 classes on that and then, move on to console type programming once your students are fully aware that they are being taught how to manage a "limited" and simplified environment.  Within that simplified environment, you can teach them programming.  I very strongly suggest you have a look at the book "Oh Pascal" by Doug Cooper.  An excellent book with excellent and timeless programming advice.  Your students would benefit from reading it too.

Just my $0.05

HTH.

FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

Thaddy

  • Hero Member
  • *****
  • Posts: 19117
  • Glad to be alive.
Re: Using Lazarus to teach Introduction to Programming
« Reply #3 on: April 21, 2026, 02:48:44 pm »
@440bx

Starting with GUI when you want to teach logic is the most horrible thing I ever heard. Go wash your mouth, fingers.

GUI programming does not contribute to learning programming logic.
That is basically rule number one for introductory courses.
Just my $1.00 (intentionally 20 fold.)
I am aghast by such short sightedness.
objects are fine constructs. You can even initialize them with constructors.

Thausand

  • Hero Member
  • *****
  • Posts: 526
Re: Using Lazarus to teach Introduction to Programming
« Reply #4 on: April 21, 2026, 02:49:45 pm »
1. Has anyone configured Lazarus to support console programming only?
yes

Quote
No component palettes and no object inspector?
yes

Quote
I know I can hide the Object Inspector by closing it, but I don’t know if it’s possible to hide the component palette ...
Lazarus have option for use many desktop setup and have ability for switch desktop. Desktop setting is tell lazarus what is show and not show.

Fore hide component then have go setting, environment settings, then have uncheck palette is visible.

Quote
Alternatively, is there a better environment suited for that sort of coding?
Depend on what is find better. I have prefer and use text editor, have example vim or emacs (but all editor is ok when have syntac highlight for pascal).

Quote
2. The school provides Chromebooks. Can I run Laz on such an environment or is it sketchy? What of FP?
I not have know. I not have use chromebook any time. FP-ide also good editor for terminal. Advantage fp is have internal compiler.

Quote
3. If you've taught Intro to Programming with Laz, how did you configure it?
For program fpc (no gui) I no prefer and use Lazarus but have teach for use simple text editor that user have prefer. But today I not know if target user age have preference for editor. Today is more vs code and similar (I think is to much, but I old :-) ).
A docile goblin always follow HERMES.md

Thaddy

  • Hero Member
  • *****
  • Posts: 19117
  • Glad to be alive.
Re: Using Lazarus to teach Introduction to Programming
« Reply #5 on: April 21, 2026, 02:53:20 pm »
You can also use something like Geany as an editor, but I would edit the Lazarus config to hide the palet, indeed (good suggestion above), because configuring debugging for Geany is a bit difficult and relies on an external debugger.
(Although you only need to configure once in both cases)
objects are fine constructs. You can even initialize them with constructors.

nouzi

  • Sr. Member
  • ****
  • Posts: 329
Re: Using Lazarus to teach Introduction to Programming
« Reply #6 on: April 21, 2026, 02:53:51 pm »
Free Pascal can be installed after installation and includes a built-in text editor.
 Alternatively, you can use a direct interactive environment through your browser.

Ex:
https://www.onlinegdb.com/online_pascal_compiler
https://live.freepascal.org/
https://onecompiler.com/pascal
and more other online compiler
My English is  bad
Lazarus last version free pascal last version
Lazarus trunk  free pascal trunk 
System : Linux mint  64bit  Windows 7 64bit

Thaddy

  • Hero Member
  • *****
  • Posts: 19117
  • Glad to be alive.
Re: Using Lazarus to teach Introduction to Programming
« Reply #7 on: April 21, 2026, 02:57:04 pm »
The con to the fp editor is that it takes getting used to nowadays.
The Lazarus IDE looks much better.
Then again: fp has debugger support.

From an educational point of view, in modern times, I would prefer a GUI based editor like Lazarus, Geany or Notepad++.
All of these can output to the console, which is what you want.

You want them to be able to write "Hello, world!" in the first 5 minutes.

TIP: be creative with "Hello, world", let them say hello to their neighbours.... ;D :D
« Last Edit: April 21, 2026, 03:00:14 pm by Thaddy »
objects are fine constructs. You can even initialize them with constructors.

440bx

  • Hero Member
  • *****
  • Posts: 6462
Re: Using Lazarus to teach Introduction to Programming
« Reply #8 on: April 21, 2026, 02:59:28 pm »
I am aghast by such short sightedness.
Yes, I'm aghast by your short sightedness too but, I'll give you credit for being aware of it.

If you read carefully, you'll notice that I recommended spending a total of 3 to 4 classes on GUI programming, not the entire course.  If you get over your short sightedness, the point is not to put blinders on them which later become difficult to overcome.  Don't start by handicapping the students but, by opening their minds instead.

Suggesting Python as a way to learn programming ???... That's like recommending riding a moped to train for the Olympic 100 meters.  That will produce the next Jesse Owens of programming.



FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

Thaddy

  • Hero Member
  • *****
  • Posts: 19117
  • Glad to be alive.
Re: Using Lazarus to teach Introduction to Programming
« Reply #9 on: April 21, 2026, 03:01:18 pm »
GUI programming is firmly second course grade, not for beginners.
Period.

People who start like that end up in the screen drawers guild: beautiful looking with bad code underneath, like in the Delphi hausse days. I still see that every day on the forum and my late mother could do better than that in Delphi.

I am pretty sure that is the majority opinion of people who actually taught programming on a professional level.

It does not have to be Dijkstra: pen and paper, but not GUI. And when you do force them to use actionlists and actions and teach them to give meaningful names to their controls, like pun intended Button2 instead of Button1....

You are definitely not suited to be an educator.
I raise to $10,-
« Last Edit: April 21, 2026, 03:16:35 pm by Thaddy »
objects are fine constructs. You can even initialize them with constructors.

LeP

  • Sr. Member
  • ****
  • Posts: 290
Re: Using Lazarus to teach Introduction to Programming
« Reply #10 on: April 21, 2026, 03:36:00 pm »
This is my opinion, which has developed over several years of teaching (a long time ago), less than 1$ ...  :D

A good and comprehensive IDE is useful for providing students with a concrete and tangible example of how memory is structured, what BE and LE mean, how an INTEGER is written to memory, and what the stack and heap are.
A mere infusion of theory without practice misses the point.

I also agree that graphical objects are a subject for a more advanced course.

So the Lazarus IDE with its debugger is definitely more appropriate than solutions like NOTEPAD++.
Text editors are certainly fine initially, but soon you'll need to use more advanced tools.
Un Sistema per domarli, un IDE per trovarli, un codice per ghermirli e nel framework incatenarli.
An operating system to tame them, an IDE to find them, a code to catch them and in the framework chain them.

Thaddy

  • Hero Member
  • *****
  • Posts: 19117
  • Glad to be alive.
Re: Using Lazarus to teach Introduction to Programming
« Reply #11 on: April 21, 2026, 03:40:41 pm »
I agree with you, but 440bx seems to think for some reason that it is a good idea to start with teaching writing GUI apps...... Which it is NOT.
Using a good and modern ide is a different story: I encourage that.

objects are fine constructs. You can even initialize them with constructors.

440bx

  • Hero Member
  • *****
  • Posts: 6462
Re: Using Lazarus to teach Introduction to Programming
« Reply #12 on: April 21, 2026, 03:51:45 pm »
If he uses Lazarus, which I believe would be a good choice, the student will on one side see the power and flexibility of a GUI (Lazarus in this case) while being taught to write "hello world" on a single dedicated window. 

Nothing says, "I'm treating you like a bunch of incompetent ignorants unable to learn" than that.

Instead, start by explaining the screen is a shared resource that can be split into windows, each window given to an application and show how the application's architecture is affected by having to manage the screen real estate it has been granted.   Once that has been explained and understood, concentrate on console apps making the point that the reason is to emphasize the study of algorithms and good programming habits that will help when having to design and create the more complex architecture of a GUI app. 

Instead, let them know that ignorance is bliss and, enjoy it as long as you can  :D 
FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

LeP

  • Sr. Member
  • ****
  • Posts: 290
Re: Using Lazarus to teach Introduction to Programming
« Reply #13 on: April 21, 2026, 04:14:03 pm »
@440bx
This isn't a teacher's intention.
If you teach how to ride a bicycle, you don't show (or explain) a moped, a motorcycle, or a highway.
Anyone attending a course like this should be free of distractions, and the information (which will be overwhelming and incomprehensible to some) should focus on the essence of programming, even before algorithms, windows, and everything else.
Un Sistema per domarli, un IDE per trovarli, un codice per ghermirli e nel framework incatenarli.
An operating system to tame them, an IDE to find them, a code to catch them and in the framework chain them.

440bx

  • Hero Member
  • *****
  • Posts: 6462
Re: Using Lazarus to teach Introduction to Programming
« Reply #14 on: April 21, 2026, 04:22:05 pm »
If you teach how to ride a bicycle, you don't show (or explain) a moped, a motorcycle, or a highway.
It would be good for the one learning to ride a bicycle to know about highways because getting on a highway on a bicycle is not a wise thing to do and they should know why.  For that reason, they should also be told about the existence of mopeds, cars and, motorcycles.  That way they know the limitations of what they are learning and, it lessens the possibility that they will be unpleasantly surprised by being run over by a car because they got on a highway.

Once they've been given that knowledge they can concentrate on learning how to ride a bicycle being fully aware of its limitations (not a bad thing to be aware of.)


FPC v3.2.2 and Lazarus v4.0rc3 on Windows 7 SP1 64bit.

 

TinyPortal © 2005-2018