Forum > Beginners
Lazarus – Crawling Before The Walk
TRon:
@MrPink:
(yes, sorry me again with more or less the same message)
I understand you predicament but OOP isn't exactly magic (or difficult).
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---program test; {$mode objfpc}{$h+} uses classes; var lines : TStringList; line : string;begin lines := TStringList.Create; lines.LoadFromFile('test.pas'); for line in lines do writeln(line); lines.Free;end.
And that use of TStringList is in basics what OOP is. Nothing more, nothing less (the example makes use of an already existing OOP class but you could create your own classes/objects as well if that peaks your interest).
Unfortunately, I only was able to locate 3 video's from Tom's tutorials so that would not provide too much information for you I'm afraid.
The Lazarus IDE can be used in exactly the same way as FP-IDE, the only difference is the GUI vs TUI environment.
So, in case you do not wish to use OOP then by all means do not use it and keep on programming the way you were used to with FP-IDE. And also in FP_IDE you could use the same code as per example and you would have been using OOP. There literally is no difference.
The only thing I can add to that is that most Lazarus related tutorials do not emphasis on this but rather focus on designing GUI applications, e.g. how the object inspector works , how certain (visual) component behave how to add different forms etc.
Why I repeat the same again ? It seems that you (still) have the idea that using Lazarus means that you need to use GUI components and per default you are using OOP. Let me try with writing that: OOP <> GUI
OOP is but a programming concept and a GUI /can/ be implemented using that concept. In case of Lazarus the IDE itself consists out of GUI components that are implemented using classes and objects (thereby using the OOP concept). At the same time the Lazarus IDE allows you to make use of all these classes and objects in order to create your own GUI applications (but only if you want to do so).
MrPink:
Apologies for my dipping in and out of the forum with robust time gaps. But first and foremost, I need to say how impressed I am with the genuineness of everyone’s helpfulness. It’s like with librarians – they never wither. And like a basketball held-aloft, they never hold their sphere of knowledge out of your reach......
I caught another post where someone was seeking help in an ongoing FP/Lazarus class. All three of my old-dog learned languages (Basic, Fortran, Pascal) came via a formal classroom, so it made me yearn for a local community college to offer same. Unfortunately, not available. Though I wish it were.
In the meantime, I am learning from your comments. Condensing TRon’s last paragraph, it makes sense to me that: “OOP is a concept, and a GUI can be implemented using that concept. As to the Lazarus IDE, it allows the use of classes and objects in order to create your own GUI applications.”
Indeed. Which brings me to srvaldez, pertinently asking what kind of program I am planning to write (???). Answer: Research programs, whereby (1) a data file is loaded into a matrix and (2) sorted for outcomes. Simple tasks in conjunction with a personal hobby; nothing remotely close to having a user base or creating GUI applications.
At the top I referenced a lack of time, which makes me the bottleneck here. Bottom line; I need to do some hands-on Lazarus-environment programming. I will then see where I encounter difficulty, and kick out a few questions for you good folks to answer. Please stay tuned for that......
Thank you,
MrPink
carl_caulkett:
Maybe when you are starting, it's better to just treat Lazarus as a tool for "Event-Driven Programming". The fact that OOP underlies a lot of the software technology behind that "Event-Driven Programming" doesn't really matter at first. That said, it's a good idea to keep your mind open to the use of classes, then you will find that a lot of OOP principles can be absorbed like osmosis. Eventually you will, hopefully begin to join the dots, as it were, and start to actively learn OOP principles.
Joanna from IRC:
Speaking of I’ve been trying to get better at oop design. Doing it right can be rather challenging. Having a class within in a class that isn’t Always used is a big no no . I created abstract virtual methods to be overridden when I need the functionality. Does anyone here use abstract methods?
Handoko:
--- Quote from: Joanna from IRC on November 25, 2024, 03:46:34 pm ---I created abstract virtual methods to be overridden when I need the functionality. Does anyone here use abstract methods?
--- End quote ---
Rarely, but I did.
Navigation
[0] Message Index
[#] Next page
[*] Previous page