Re: [Lazarus] Teaching Pascal at College

2016-10-12 Thread Martin Schreiber via Lazarus
On Wednesday 12 October 2016 20:10:50 Adrian De Armas via Lazarus wrote:

> Today I had a meeting about doing the module more interesting to the
> students. Currently we teach algorithms making console applications and
> usually I receive questions like "Why don't we do something more modern?".
>
I made such an experiment with Free Pascal and MSEide+MSEgui:

https://sourceforge.net/projects/mseuniverse/files/book/
"programmierspass_0_1.zip" contains the text and example code (German).

Martin
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Teaching Pascal at College

2016-10-12 Thread LacaK via Lazarus



I would also caution against starting on GUI programming too early.

+1
(few years ago I have teached programing on school in our city. I am not 
a techaer, but school lost teacher and was not able to find someone else)
I have used FreePascal + Lazarus for my courses, but we have used only 
project type of "Program" (so no LCL GUI), exactly for reasons what was 
mentioned.


I understand, that black/white window does not look modern. You can 
introduce 2 courses:

1. Introduction to Pascal (Object Pascal)
2. GUI programing

L.

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Teaching Pascal at College

2016-10-12 Thread Tony Whyman via Lazarus
When I read your post ,it sent me back to read the Introduction to 
Nicklaus Wirth's original "Pascal user Manual and Report" where the 
opening paragraph says:


"The development of the language Pascal is based on two principal aims. 
The first is to make available a language suitable to teach programming 
as a systematic discipline based on certain fundamental concepts clearly 
and naturally reflected by the language. The second is to develop 
implementations of this language which are both reliable and efficient 
on presently available (1975) computers".


Certainly the intent was a very good match for what you want and IMHO 
that intent was fully realised.


If you can find it, I would recommend getting hold of a copy of what is 
now an ancient text "Pascal - An Introduction to Methodical Programming 
- Findlay and Watt - ISBN 0 273 01220 7 (Original Edition) now 
978-1857283648". First published 1978. This used to be the definitive 
text for learning Pascal and somewhat to my surprise still seems to be 
available from Amazon in its 3rd Edition.


When I looked down through the content list the order of play and 
presentation still seems just right for a first course in programming. 
It does not deal with Object Oriented programming or even "Units". ISO 
standard Pascal will still some time away but that anyway should be the 
next semester.


I would also caution against starting on GUI programming too early. If 
the students don't have a grasp of fundamentals then they will get lost 
very quickly. Perhaps the best approach is at the end of each subject to 
translate the simple procedural program they have been working on into a 
GUI program as a whole class exercise.


From having myself developed many courses in Data Communications over 
the years, I would also always try and make sure the students understand 
the context, the background to what they are doing and why.


Somehow you need to get Boolean Algebra in there as well. Findlay and 
Watt give a primer on this in chapter 5, which is probably about the 
right stage after having done the basics. And then, of course, there are 
Turing Machines...


Have fun

Tony Whyman

MWA


On 12/10/16 19:10, Adrian De Armas via Lazarus wrote:

Hello everyone,
I am a professor of "introduction to programming". Currently we are 
working with matlab and c.


Today I had a meeting about doing the module more interesting to the 
students. Currently we teach algorithms making console applications 
and usually I receive questions like "Why don't we do something more 
modern?".


I recommended that we should use Pascal in General and Lazarus in 
particular to teach how to create rich GUI Applications and to my 
surprise the idea was well recieved. Now I have to make suggestions 
about how to prepare the module starting from zero. Students do not 
know how to program and I need to include subjects as: variable 
declaration, operations, if, while, for, functions and procedure, 
arrays and multidimensional arrays.


I would love to know what you think about making the transition from 
console to GUI.

This is an exciting opportunity I'd love to make it right.

Regards




-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Teaching Pascal at College

2016-10-12 Thread Mehmet Erol Sanliturk via Lazarus
On Wed, Oct 12, 2016 at 11:52 AM, Chris Kelling via Lazarus <
lazarus@lists.lazarus-ide.org> wrote:

> I'll tell you, after years of doing top down modular programming, it took
> me a little time to adjust to event driven programing.  It wasn't until I
> used a FOR loop on a form to collect the input that I realized what the
> difference is.
>
> For a beginning student, you can approach it in two ways - teach
> programming concepts or just teach the language.  This is what I learned in
> my Computer Science classes.
>
> I had a couple of classmates who were hot shots in JAVA by reading the
> tutorials online.  Where as their mastery of JAVA was impressive, they had
> no concept of what they were doing in the context of programming.  This was
> a data structures class, and concepts and how to apply them was totally
> lost on them.  Their code was sloppy, inefficient, and very hard to
> troubleshoot.
>
> One exercise in my C class called for creating a linked list.  I used
> recursion, which took my instructor off guard.  He said it wouldn't work,
> and I asked, "It worked on all my tests, should I stop doing it this way?"
> He looked at my code again, get a huge  smile and remarked that
> I used recursion.  I said yes, the pre-req for the course was programming
> I and II, which is where we learned recursion.  He still have me more
> credit because most students were using some king of loop
>
> The point being, the language doesn't matter except for syntax.
> Programming is programming.  That being said, more to what you asked.
>
> To understand how the more advanced concepts work and are used, there
> needs to be a broad base.  I still write a lot of my logic in a unit and
> then add that unit into a project.  Defiantly start them off making simple
> console programs just to demonstrate the concepts.  I'd do it via the
> Lazarus IDE so they get used to that environment.  After they have the
> basic concepts, introduce what Lazarus is - a group of libraries extending
> FPC into the visual design.  They should have enough of a grasp on the
> concept of say arrays to understand how a
> list control works, or how you can use conditional branching (both IF
> -THEN-ELSE and CASE) to check for radio button and check box states.
>
> But then again, I'm not a professional educator.
>
> -Chris
>
> On Wed, Oct 12, 2016 at 2:10 PM, Adrian De Armas via Lazarus wrote:
>
>  Hello everyone, I am a professor of "introduction to programming".
> Currently we are working with matlab and c.
>
>
> Today I had a meeting about doing the module more interesting to the
> students. Currently we teach algorithms making console applications and
> usually I receive questions like "Why don't we do something more modern?".
>
>
> I recommended that we should use Pascal in General and Lazarus in
> particular to teach how to create rich GUI Applications and to my surprise
> the idea was well recieved. Now I have to make suggestions about how to
> prepare the module starting from zero. Students do not know how to program
> and I need to include subjects as: variable declaration, operations, if,
> while, for, functions and procedure, arrays and multidimensional arrays.
>
>
> I would love to know what you think about making the transition from
> console to GUI.
> This is an exciting opportunity I'd love to make it right.
>
>
> Regards
>
>
> --
>
>


I have taught mostly Fortran programming to the students ( with Cobol , but
, less frequently ) in a University ( Pascal in another University ) .

In those days , there was no any GUI programming facility like Lazarus .

When GUI is started , it was assumed that the students may learn more
effectively . My opinion is that such an assumption is misleading , because
, it is very easy to generate a GUI program . When it comes to perform some
, let's say , data processing , it is becoming necessary to write some
Pascal procedure parts ( or procedures ) within GUI program . In that part
, the students becoming helpless because they do not know how to write such
procedures or parts .  To help to the students , my opinion is that , a
double way approach should be used :


First teach how to program in plain Pascal , for example , input - process
- output in a console program which is easy to write  . After the students
have learned what can be down , embed main steps of this console program
into a Lazarus ( GUI ) program . In that way , the students will learn how
to write an algorithm in Pascal and test it in a simple console program ,
and then how to make it a GUI program .


They in that way learn how to generate a GUI program . Sometimes by
beginning from a console program or directly beginning a GUI program and
improve its procedures supplied by Lazarus generated sources , they will be
able to develop a software by selecting whichever way is easy and suitable
for them .


Mehmet Erol Sanliturk
-- 
___
Lazarus mailing list

Re: [Lazarus] Teaching Pascal at College

2016-10-12 Thread Paul Breneman via Lazarus

On 10/12/2016 01:10 PM, Adrian De Armas via Lazarus wrote:

Hello everyone,
I am a professor of "introduction to programming". Currently we are working
with matlab and c.

Today I had a meeting about doing the module more interesting to the
students. Currently we teach algorithms making console applications and
usually I receive questions like "Why don't we do something more modern?".

I recommended that we should use Pascal in General and Lazarus in
particular to teach how to create rich GUI Applications and to my surprise
the idea was well recieved. Now I have to make suggestions about how to
prepare the module starting from zero. Students do not know how to program
and I need to include subjects as: variable declaration, operations, if,
while, for, functions and procedure, arrays and multidimensional arrays.

I would love to know what you think about making the transition from
console to GUI.
This is an exciting opportunity I'd love to make it right.


As an electrical engineer (starting study at age 14) I've always enjoyed 
learning programming when it is *combined* with hardware.  There are 
links to two such projects at the top of this page:

  http://controlpascal.com/tutorial.htm

There is a link near the bottom of that page to *ideU* which might be 
one way to transition from console to GUI.


Please keep us informed about how things progress!

Regard,
Paul

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Fast-small utilities for common javascript tasks, anyone?

2016-10-12 Thread Michael Van Canneyt via Lazarus



On Wed, 12 Oct 2016, Leonardo M. Ramé via Lazarus wrote:


El 08/10/16 a las 05:18, Michael Van Canneyt via Lazarus escribió:




Hi Michael, could you post jsmin.pas here?.


I added it to FPC SVN.  packages/fcl-js, unit jsminifier. I included 
an example program.


Improvements and suggestions welcome.

Michael.


Thanks Michael, that's great!.

BTW, I've found also a CSS Minifier, developed by Udo Schmal 
(http://www.gocher.me/CSSMin) I'll ask him if he allow us to add it to 
fcl-js.


Great, that would come in handy as well !!

Michael.-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] TDBEdit, TStringField Size, DataSize, DisplayWidth and MaxLength

2016-10-12 Thread Tony Whyman via Lazarus

On 11/10/16 19:21, LacaK via Lazarus wrote:
I am aware of it. I have not added all other MBCS because ! I doubt, 
which are realy used nowadays.
My guess is that UTF-8 is far most used / supported as client 
character set.

No problem to add them if there will be real demand from users ...
Perhaps the correct answer is to let the database driver work this one 
out rather than have a fixed decision in the FCL.


I would suggest the following change:

function TStringField.GetDataSize: Integer;

begin
  Result := FieldDef.CharSize * Size + 1;
//  case FCodePage of
//CP_UTF8: Result := 4*Size+1;
//else Result :=   Size+1;
//  end;
end;

TFieldDef.GetCharSize uses the same algorithm so this avoids a code 
duplication anyway. But I also want to make TFieldDef.GetCharSize and 
TFieldDef.CreateField virtual methods. That way a database driver can 
readily expand upon the character sets supported to match what it 
supports rather than be limited by the FCL default.


In IBX, I have already done this using TIBFieldDef and TIBStringField as 
subclasses in order to pass character set information. However, because 
TFieldDef.CreateField is non-virtual, the implementation is not as 
elegant as it should be. That is the extra info is added to the 
TIBStringField as the dataset is opened rather than when the field is 
created. It is also less maintainable as the functionality should be in 
TIBFieldDef rather than in a different class altogether.


Making those two methods virtual is the most important change. I can 
live with TStringField.GetDataSize as it is because that is already 
virtual and a future TIBStringField can readily override it.


Tony Whyman
MWA
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Fast-small utilities for common javascript tasks, anyone?

2016-10-12 Thread Leonardo M. Ramé via Lazarus

El 08/10/16 a las 05:18, Michael Van Canneyt via Lazarus escribió:




Hi Michael, could you post jsmin.pas here?.


I added it to FPC SVN.  packages/fcl-js, unit jsminifier. I included 
an example program.


Improvements and suggestions welcome.

Michael.


Thanks Michael, that's great!.

BTW, I've found also a CSS Minifier, developed by Udo Schmal 
(http://www.gocher.me/CSSMin) I'll ask him if he allow us to add it to 
fcl-js.


Regards,

--
Leonardo M. Ramé
Medical IT - Griensu S.A.
Av. Colón 636 - Piso 8 Of. A
X5000EPT -- Córdoba
Tel.: +54(351)4246924 +54(351)4247788 +54(351)4247979 int. 19
Cel.: +54 9 (011) 40871877
--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus