* * *

Author Topic: I have written an e-book for beginners!  (Read 6348 times)

nsunny

  • Full Member
  • ***
  • Posts: 116
  • Code is magic
    • LazPlanet
Re: I have written an e-book for beginners!
« Reply #15 on: December 18, 2017, 04:25:12 am »
Firstly, you use the word 'tool' when referring to visual components, I'm not sure thats a good idea. Possibility of confusing your 'tool' with the ones provided as part of FPC/Lazarus. People tend to think of tools as something you use here to help make the software rather than actually part of the software.
I was also thinking about it. I think it is ok in the case of the toolbar, but not so much when they are dropped to form. I think I need to find out a new word for this. But this is also true that sometimes teachers find some temporary words to make the students comfortable. This is so that they don't get lost in the new words and jurgons and start thinking its hard and give up. Maybe it is something like that. :)

But I will think about changing it for sure, if I find any replacement.

Quote
Secondly, installing. I think it would be a good idea to point people to the newly released install kits that ship 1.8.  The Linux package maintainers can be quite slow in pushing out new versions, especially for people on long term release OS.
I think that's great. I don't run Ubuntu for many days. But the last time I checked in a LTS, it was already to 1.4 or something. (I don't remember correctly though.) 1.4 would be ok to newcomers to try the basic things, but 1.0.6 or 9.x.x versions would be a problem to follow. Especially the compile sections in settings are different.

I think if the Wiki addresses this issue in some separate section of the Ubuntu page (wiki.lazarus.freepascal.org/Install_on_Ubuntu), it would be much better. Then I can shortly refer to that section if someone has the older version.

Quote
Another thing you probably have not come across is how hard Mac makes things for non Mac developers. So someone attracted to Lazarus's cross platform nature may find themselves looking at a Mac for the first time. On Mac's, to use the app outside of the IDE you need to make an "application Bundle" (press the button in Project Options) and then run (from memory) ~/MyApp.app/Contents/Mac/MyApp and to move the app elsewhere you need to delete the symlink down in that location and replace it with the actual binary.

I'll try and document this process and how to make a distributed dmg file on the wiki when I get some free time. This script does it (but I don't think it would be a good idea to link directly to it) - https://github.com/tomboy-notes/tomboy-ng/blob/master/package/mk_dmg.bash Perhaps all you need do in your book is mention that Mac's need that application bundle to be made and refer people to wiki ?

I don't have a Mac in my hand and I am not that accustomed to it. I see the wiki is loaded with text (http://wiki.freepascal.org/Installing_Lazarus_on_MacOS_X) and would not be helpful to newcomers. It would be great if you or someone else can provide me some instructions for Mac (preferably short and understandable) then I can include it in the next edition. Or better also, if the Wiki has this short instruction and just link from the book.

Thanks for the good points.
Lazarus TTS Tutorial | LazPlanet
Lazarus 1.8 | FPC 3.0 | Win7/Linux

dbannon

  • Sr. Member
  • ****
  • Posts: 263
Re: I have written an e-book for beginners!
« Reply #16 on: December 18, 2017, 07:00:48 am »
Ah nsunny, no !

Quote
can provide me some {INSTALL} instructions for Mac

As I noted at the top of the page about installing on Mac, its not hard but it is tedious !  Its not Lazarus/FPC's fault, there are just heaps of other things, XCode, Brew, gdb that have to be installed AND got working and there are lots of steps. And that page is not all, it links to a couple of other, quite detailed sets of instructions. Sorry, thats just how it is. Its a pity.

Disclaimer - I wrote much of the new content at the top of that page.
Lazarus 1.8, Linux (and reluctantly Win10, OSX)

nsunny

  • Full Member
  • ***
  • Posts: 116
  • Code is magic
    • LazPlanet
Re: I have written an e-book for beginners!
« Reply #17 on: December 18, 2017, 08:53:57 pm »
@dbannon

Oh my! You are right. I did not know it was that difficult to install on a Mac. I wonder who built the install system on Macs. This is not user friendly!
Even linux is easier than Mac! I have installed Lazarus on Arch Linux with just:
Code: [Select]
sudo pacman -S lazarus lazarus-qtOn Windows I have just double clicked the install file and continued.

I have searched on Youtube to see if there is any video showing the process and perhaps if somebody found an easier way. I found this one: https://www.youtube.com/watch?v=QE_IAjkXElg
It shows the process. This is easier to follow than the wiki.
Maybe I can link to it on my ebook to make things easy to understand.

I also learned about why all the steps are necessary on this video: https://www.youtube.com/watch?v=CN0o_qX4A8c

EDIT:
I guess this is also possible ( for Lazarus 1.8 ):
Quote
No debugger. In Lazarus 1.8 you can choose Run->Run without Debugger or set it up to always run without debugger. OK if you are building code developed elsewhere and certain to build cleanly (yeah, thats likely).
source: http://wiki.freepascal.org/Installing_Lazarus_on_MacOS_X#Step_3_install_gdb
« Last Edit: December 18, 2017, 08:58:21 pm by nsunny »
Lazarus TTS Tutorial | LazPlanet
Lazarus 1.8 | FPC 3.0 | Win7/Linux

Phil

  • Hero Member
  • *****
  • Posts: 2734
Re: I have written an e-book for beginners!
« Reply #18 on: December 18, 2017, 09:29:25 pm »
Firstly, you use the word 'tool' when referring to visual components, I'm not sure thats a good idea. Possibility of confusing your 'tool' with the ones provided as part of FPC/Lazarus. People tend to think of tools as something you use here to help make the software rather than actually part of the software.

Right. The term for a visual component is "control". Has been since VCL 1.0. Same with LCL. Same elsewhere, Eg, in Mac Cocoa framework, NSControl is the ancestor class of the visual parts:

https://developer.apple.com/documentation/appkit/nscontrol

In Delphi and Lazarus, everything on palette descends from TComponent, but visual components descend from TControl.

"Tool" is just wrong.

Another thing you probably have not come across is how hard Mac makes things for non Mac developers. So someone attracted to Lazarus's cross platform nature may find themselves looking at a Mac for the first time. On Mac's, to use the app outside of the IDE you need to make an "application Bundle" (press the button in Project Options) and then run (from memory) ~/MyApp.app/Contents/Mac/MyApp and to move the app elsewhere you need to delete the symlink down in that location and replace it with the actual binary.

No, the issue is that Lazarus has never been able to create a proper app bundle. No other Mac IDE has this problem.

You can avoid this Lazarus bug by starting your Lazarus project as a cross-platform project using this add-in:

https://macpgmr.github.io/MacXPlatform/LazXProj.html


Phil

  • Hero Member
  • *****
  • Posts: 2734
Re: I have written an e-book for beginners!
« Reply #19 on: December 18, 2017, 09:33:28 pm »
Its not Lazarus/FPC's fault

Yes, it is Lazarus/FPC's fault.

FPC depends on Xcode's linker, assembler, etc. so Xcode has to be installed first. Developers on Mac will already have Xcode installed, so you're talking about newcomers to Mac or hobbyists who have a Mac if they're surprised by this requirement. But it can be installed in one click from the Mac App Store.

The debugger on Mac is lldb. Lazarus still tries to use gdb, which hasn't been part of Xcode for years. My understanding is that some debugger solution for Mac was imminent several years ago, but that effort appears to have stalled:

http://lazarus-dev.blogspot.com/2014/05/de-bug-wars-new-hope.html

nsunny

  • Full Member
  • ***
  • Posts: 116
  • Code is magic
    • LazPlanet
Re: I have written an e-book for beginners!
« Reply #20 on: December 18, 2017, 09:49:38 pm »
@Phil

"Tool" is just wrong.
I agree. I have used it as a placement word to make things easier. As a beginner, it is not important to remember exactly which is called which. Concept is more important in this stage. Every other reference will guide him gradually to use the correct word. Also, I have called it Component once (when talking about component toolbar icons) and indicated that it is the real name and said that we're going to ignore the real name:

Quote
At the top there are some tools that you would drop into your form. (Tools are formally called “components”. But let’s forget that for now!)

Teachers sometimes call some things like this. He gives temporary names to things or even links stories to make the topic easier for the students, even if the story is not completely relevant. When he understands the whole thing, then the real names become easier to grasp.

Can you tell me if this is a good idea? I have no access to Mac so I can't test it.
Quote
No debugger. In Lazarus 1.8 you can choose Run->Run without Debugger or set it up to always run without debugger. OK if you are building code developed elsewhere and certain to build cleanly (yeah, thats likely).
Lazarus TTS Tutorial | LazPlanet
Lazarus 1.8 | FPC 3.0 | Win7/Linux

Phil

  • Hero Member
  • *****
  • Posts: 2734
Re: I have written an e-book for beginners!
« Reply #21 on: December 18, 2017, 09:57:08 pm »
@Phil

"Tool" is just wrong.
I agree. I have used it as a placement word to make things easier. As a beginner, it is not important to remember exactly which is called which. Concept is more important in this stage. Every other reference will guide him gradually to use the correct word. Also, I have called it Component once (when talking about component toolbar icons) and indicated that it is the real name and said that we're going to ignore the real name:

Quote
At the top there are some tools that you would drop into your form. (Tools are formally called “components”. But let’s forget that for now!)

Teachers sometimes call some things like this. He gives temporary names to things or even links stories to make the topic easier for the students, even if the story is not completely relevant. When he understands the whole thing, then the real names become easier to grasp.

But a control is not a tool. Analogy: A paintbrush is a tool, as is Lazarus IDE. The paint that's applied by the tool is more like a control.

Can you tell me if this is a good idea? I have no access to Mac so I can't test it.
Quote
No debugger. In Lazarus 1.8 you can choose Run->Run without Debugger or set it up to always run without debugger. OK if you are building code developed elsewhere and certain to build cleanly (yeah, thats likely).

If someone can't get gdb installed (or doesn't want to install gdb), that's a reasonable approach to getting started quickly.

Note that debugging with the supplied Xcode lldb debugger is easy to do once you're built the app. Just start the app via the debugger from the Terminal command line. Eg,

lldb MyProgram.app

https://developer.apple.com/library/content/documentation/IDEs/Conceptual/gdb_to_lldb_transition_guide/document/lldb-terminal-workflow-tutorial.html

http://lldb.llvm.org/lldb-gdb.html


Edit:  Oops, forgot. You can also debug a Laz app with lldb in Xcode:

https://macpgmr.github.io/ObjP/ProjectXC.html

nsunny

  • Full Member
  • ***
  • Posts: 116
  • Code is magic
    • LazPlanet
Re: I have written an e-book for beginners!
« Reply #22 on: December 18, 2017, 10:15:35 pm »
Quote
But a control is not a tool. Analogy: A paintbrush is a tool, as is Lazarus IDE. The paint that's applied by the tool is more like a control.
That's a great opinion. :) I could not find any better word at the moment so I used it. You can suggest a better word. But whatever you suggest, it should be easy for the beginners.

There are hundreds of resources out there that are not beginner friendly. They say that when it is on toolbar it is called "Component" and when it is dropped on the form it is a "Control" or an "Object". I think this book should stay out of this to be simple and welcoming to newcomers. Other resources can have the accurate words to guide them later if necessary.

Quote
If someone can't get gdb installed (or doesn't want to install gdb), that's a reasonable approach to getting started quickly.
I think this is easier.  8-)
Lazarus TTS Tutorial | LazPlanet
Lazarus 1.8 | FPC 3.0 | Win7/Linux

molly

  • Hero Member
  • *****
  • Posts: 2345
Re: I have written an e-book for beginners!
« Reply #23 on: December 18, 2017, 10:30:15 pm »
There are hundreds of resources out there that are not beginner friendly. They say that when it is on toolbar it is called "Component" and when it is dropped on the form it is a "Control" or an "Object". I think this book should stay out of this to be simple and welcoming to newcomers.
Fact is that they are all correct  :)

TControl -> TLCLComponent -> TComponent -> TPersistent -> TObject

Once you see/understand the inheritance, it is all starting to make sense.

I agree that starting with explaining inheritance would not be a good idea for complete programmer newbies. In that regards i also agree that it is sometimes a better choice to use analogies. Just be careful which analogies to use. If you want to avoid confusion then it is usually better to tackle that issue heads on, and explain it correctly and into detail right from the start (the attention span these days is not very long  :'( ).

PS: "The watchers always know better than the doers"  :)
« Last Edit: December 18, 2017, 10:41:53 pm by molly »

dbannon

  • Sr. Member
  • ****
  • Posts: 263
Re: I have written an e-book for beginners!
« Reply #24 on: December 19, 2017, 12:03:49 am »
Quote
That's a great opinion. :) I could not find any better word at the moment so I used it. You can suggest a better word. But whatever you suggest, it should be easy for the beginners.
nsunny, I agree its a good idea to simplify in beginner texts but its not a good idea to mislead. A tool is something the developer uses, he/she does not ship a tool with the product. Phil suggested "control", that probably is the best choices. "Tool" is wrong.

Quote
I think this {leaving gdb out} is easier.
Perhaps. But I do think you should note that a debugger makes a huge difference when someone is struggling to understand how things work, or don't work. Not having a debugger would probably leave a few newcomers feeling they are lost and the IDE is not helping. Choose between short term easier and long there easier !

Davo
Lazarus 1.8, Linux (and reluctantly Win10, OSX)

Phil

  • Hero Member
  • *****
  • Posts: 2734
Re: I have written an e-book for beginners!
« Reply #25 on: December 19, 2017, 01:24:26 am »
Quote
That's a great opinion. :) I could not find any better word at the moment so I used it. You can suggest a better word. But whatever you suggest, it should be easy for the beginners.
nsunny, I agree its a good idea to simplify in beginner texts but its not a good idea to mislead.

Not sure I would say misleading. I accept that he was trying to simplify the terminology, although I think we do that at our peril.

I looked around at other introductions. For example, with Swift Playgrounds, I don't see much discussion of the visual elements, but when they come to the Swift syntax and fundamentals, they don't shy away from using the expected terminology (variables, loops, functions, etc.) - and this is for schoolchildren.

https://www.apple.com/swift/playgrounds/?cid=wwa-us-kwbi-ipad&muid=e43b0535-114a-4679-8f8e-b0b6788b3c88&mtid=2092592t39165&aosid=p238&mnid=IJKwGAqO-dc_mtid_2092592t39165_pcrid_12370304354_

Many programming introductions nowadays are not written tutorials in the traditional sense, but Web-based apps that allow beginners to start working with the language or library without installing anything. Again, the various Swift Sandboxes:

https://www.weheartswift.com/swift-sandbox/

https://swift.sandbox.bluemix.net/restricted#/repl

Even the qooxdoo JavaScript framework has its own Playground app, which allows you to test not only JS code but visual controls on both desktop and mobile as well, all in the comfort of your browser:

http://www.qooxdoo.org/current/playground/

Something like a sandbox or playground for FPC and/or Laz might be interesting.

nsunny

  • Full Member
  • ***
  • Posts: 116
  • Code is magic
    • LazPlanet
Re: I have written an e-book for beginners!
« Reply #26 on: December 19, 2017, 09:35:00 pm »
I think the word "Tool" is easier for beginners.

But then again, this is also true:
Quote
A tool is something the developer uses, he/she does not ship a tool with the product.

Quote
Fact is that they are all correct  :)

TControl -> TLCLComponent -> TComponent -> TPersistent -> TObject
Thanks for clearing that up.
If I can decide on applying the formal terminology, I think "Component" best suits the purpose. The Lazarus interface uses the word "Component" very often. The Ctrl+Alt+P dialog has it, and even the filter on the Object Inspector has it. So it would be easier to remember this through repeatation (as he uses Lazarus more and more).

But again, I think we would need to check this with real beginners to see which one they like. Afterall we are writing for them. You guys can ask newcomers in your circle to see which one they like, or which one is easier for them. "Tools", "Components" or any other word.

I have listed your valuable feedbacks. I would work on them in the future version.
Please let me know what you find talking with newcomers.
Lazarus TTS Tutorial | LazPlanet
Lazarus 1.8 | FPC 3.0 | Win7/Linux

molly

  • Hero Member
  • *****
  • Posts: 2345
Re: I have written an e-book for beginners!
« Reply #27 on: December 19, 2017, 10:42:18 pm »
I would personally go with the word component. I use it in my teachings as well.

The word component is technically correct and comparable with the word ingredient, a building block that when put together with more of them can become an end-product. Just like a house that's build with an amount of individual bricks.

Using the word component has another advantage as you are able to specifically mention any of its ancestors without punishment or sounding strange.

Another advantage is that (later on) you are able to specify the difference between visual and non-visual components. That way it also doesn't become awkward when you tell/describe to people that a control is a visual component.

2 cents

Zath

  • Sr. Member
  • ****
  • Posts: 283
Re: I have written an e-book for beginners!
« Reply #28 on: January 25, 2018, 11:47:52 pm »
Nice work.

Two minor things.

One:-Component gets my vote over tool.

Two:- The font you use in the emphasised code makes parentheses look similar to square brackets. A newbie "could" mistake one for the other.

 




 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus