Recent

Author Topic: The Silver Coder on YouTube  (Read 3841 times)

silvercoder70

  • New Member
  • *
  • Posts: 43
Re: The Silver Coder on YouTube
« Reply #15 on: August 07, 2024, 12:55:52 am »
Yeah... I knew that when I did the video and wondered if that would promote bad programming practices. Thanks for your feedback.

Hansvb

  • Hero Member
  • *****
  • Posts: 686
Re: The Silver Coder on YouTube
« Reply #16 on: August 07, 2024, 08:24:52 am »
Hi,
Consider it as an opportunity for a follow-up video explaining memory leak detection with "use heaptrace" in Lazarus. (Project options, debugging).

Just one thought.

silvercoder70

  • New Member
  • *
  • Posts: 43
Re: The Silver Coder on YouTube
« Reply #17 on: August 07, 2024, 10:21:51 am »
@Hansvb - Funny you mention that as that I have done that already :)

avk

  • Hero Member
  • *****
  • Posts: 756
Re: The Silver Coder on YouTube
« Reply #18 on: August 08, 2024, 07:07:06 pm »
Yeah... I knew that when I did the video and wondered if that would promote bad programming practices...

I would like to point out that the conventional way of using enumerators looks much simpler and usually does not lead to memory leaks:
Code: Pascal  [Select][+][-]
  1. ...
  2.   //LPersonInterator := LPersonList.GetEnumerator;
  3.   //while LPersonInterator.MoveNext do
  4.   //begin
  5.   //  LPerson := LPersonInterator.Current;
  6.   //  Writeln('Person Name: ', LPerson.Name_, ', Age: ', LPerson.Age);
  7.   //end;
  8.   //LPersonInterator.Free;
  9.   for LPerson in LPersonList do
  10.     Writeln('Person Name: ', LPerson.Name_, ', Age: ', LPerson.Age);
  11. ...
  12.  

silvercoder70

  • New Member
  • *
  • Posts: 43
Re: The Silver Coder on YouTube
« Reply #19 on: August 08, 2024, 11:52:24 pm »
Thanks...

That way is definitely better, however it did not show off (for lack of any better word) what an enumerator looks like, and perhaps when (depending on your background) are used to iterators (/enumerators).

A scenario where they can be useful is where you want to apply some sort of filter on the elements being processed - though here you would be writing your own enumerator.

silvercoder70

  • New Member
  • *
  • Posts: 43
Re: The Silver Coder on YouTube
« Reply #20 on: August 09, 2024, 12:04:37 am »
And sparking discussions like these can also be beneficial for (new) users/programmers as well. :)

silvercoder70

  • New Member
  • *
  • Posts: 43
Re: The Silver Coder on YouTube
« Reply #21 on: August 15, 2024, 09:39:19 am »
New Video here - https://youtu.be/vBKY7wDFy6I

This one is titled "Finding Memory Leaks in Free Pascal (and Lazarus)" and addresses the issues in previous one on generics which had some issues (and mentioned by @paweld). Thanks to @Hansvb for the suggestion.

And thanks to @avk regarding the others suggested change (shown below) which works well if processing all elements in the list ...

Code: Pascal  [Select][+][-]
  1. for LPerson in LPersonList do
  2.     Writeln('Person Name: ', LPerson.Name_, ', Age: ', LPerson.Age);
  3.  



silvercoder70

  • New Member
  • *
  • Posts: 43
Re: The Silver Coder on YouTube
« Reply #22 on: August 27, 2024, 09:47:47 am »
Intro to Database Apps in Lazarus

https://youtu.be/mPvTyTbX2Ko

Want to start building database apps with Lazarus? In this easy intro, I’ll show you how to set up a database connection, work with SQL queries, and use data source components in a data module. We’ll also cover adding DB-aware components to a form, so you can create your own functional database apps.

silvercoder70

  • New Member
  • *
  • Posts: 43
Re: The Silver Coder on YouTube
« Reply #23 on: September 08, 2024, 01:03:15 pm »
Beginner's Guide to Object Pascal Classes: Creating a Person Profile

https://youtu.be/F-83sirIYaQ

In this video, we dive into Object Pascal by creating a person profile class, similar to what you might find on Reddit or a dating app. Learn how to define properties, methods, and build a simple class structure from scratch.

Links:
https://wiki.freepascal.org/Class
https://www.embarcadero.com/products/delphi/object-pascal-handbook

 

TinyPortal © 2005-2018