Sunday, May 20, 2018

Don't Just Code in Delphi, Think in Delphi

I have always struggled with fully understanding the object oriented nature of Delphi. I still struggle with it today. For example, I have tried to read Nick Hodge's book "Coding in Delphi" three times and can't get past page 23. I'm currently on page 96 of Pawel Glowaki's book "Expert Delphi" and had to stop because he talks about using the TTextWriter class which is a class with virtual abstract methods. Virtual Abstract Methods, are you kidding me. What the hell are Virtual Abstract Methods.

(Expert Delphi page 96) "Notice that the TTextWriter class is a class with virtual abstract methods that just define the interface to the text writing functionality so we need to use one of the text writer descendants such as TStringWriter."

Okay, so I get a small glimpse into what Pawel's talking about. These VAM's are just interface definitions. They don't really exist. The real functions exist somewhere else. In this case the TStringWriter class. I'm just barely hanging on here, but I'm hanging on.

I blame my Delphi ignorance on my lack of going back to square one and learning Delphi's OOP think from the beginning. At the time I started using Delphi I just plowed ahead and made the code work. I wanted a Windows program and that is all I cared about. Looking back at it, I'd say I forced Delphi to work like my top-down procedural thinking. I never fully embraced the Delphi OOP think.

Hodges, Glowaki, Cantu, and all the other Delphi authors out there think in Delphi. And if I want to understand them and be proficient in Delphi I need to think in Delphi too.

So, how do you think in Delphi?

You find a resource that explains Delphi in a simple straight-forward manner. Perhaps a resource that teaches you how Delphi came into being. Does such a resource exist? Yes. And I just so happened to have a copy on my bookshelf.


Here are three paragraphs from page 7 and 8. If these paragraphs speak to you like they did me, then I highly recommend you read the entire Turbo Pascal 5.5 Object Oriented Programming Guide.

The challenge of object-oriented programming (OOP) is that it sometimes requires you to set aside habits and ways of thinking about programming that have been considered standard for many years. Once that is done, however, OOP is simple, straight- forward, and superior for solving many of the problems that plague traditional software programs. 

A note to you who have done object-oriented programming in other languages: Put aside your previous impressions of OOP and learn Turbo Pascal 5.5's object-oriented features on their own terms. OOP is not one single way; it is a continuum of ideas. In its object philosophy, Turbo Pascal 5.5 is more like C++ than Smalltalk. Smalltalk is an interpreter, while from the beginning, Turbo Pascal has been a pure native code compiler. Native code compilers do things differently (and far more quickly) than interpreters. Turbo Pascal was designed to be a production development tool, not a research tool. 

And a note to you who haven't any notion at all what OOP is about: That's just as well. Too much hype, too much confusion, and too many people talking about something they don't understand have greatly muddied the waters in the last year or so. Strive to forget what people have told you about OOP. The best way (in fact, the only way) to learn anything useful about OOP is to do what you're about to do: Sit down and try it yourself.

I'm convinced this little 124 page resource will give me the solid foundation of Delphi think that I've  been missing. I was so excited to find this little gem and what it offers, I had to stop reading and tell you guys about it.

A copy is available on archive.org

Enjoy!

Semper Fi
Gunny Mike
zilchworks.com


Saturday, April 28, 2018

What do you, me, Warren Buffet, and his pilot have in common?

Success. Each one of us; you, me, Buffett, his pilot all want success. Whether we acknowledge it or not, we each hunger for success. So, what separates the exceptionally successful people from the rest of us?

Check out this story about Warren Buffet and his long-time pilot then you decide.




Mike Flint was Buffett's personal airplane pilot for 10 years. Flint had flown for 4 different U.S. Presidents before, so he was pretty good at flying. Yet he still felt as though he hadn't achieved all of the career and life goals that he wanted to.

So one day Buffett jokingly says to Flint: "The fact that you're still working for me tells me I'm not doing my job. You should be out going after more of your goals and dreams."

So Flint asks Buffett for his help, and Buffett tells him to go through this 3-step exercise.

Here's how it works (you can play along at home, too)…

STEP 1
Buffett started by asking Flint to write down his top 25 goals - the things that came to mind when he thought of success in his career and life. So, Flint took some time and wrote them down.

STEP 2
Then, Buffett asked Flint to review his list and circle his top 5 goals - the things that were most important to him and that he wanted more than anything else in the world.

This was a lot harder for Flint, since everything on his list was important to him (after all, that's why he wrote them down). But Warren insisted that he could only pick five, so after some time and thought, he made five circles.

"Are you sure these are the absolute highest priority for you?" Warren asked. Steve confidently replied that they were.

STEP 3
At this point, Flint had two lists. The 5 items he had circled were List A and the 20 items he hadn't circled were List B.

Warren now asked Flint when he planned to get to work on these top 5 goals and what his approach would be.

Flint explained, "Warren, these are the most important things in my life right now. I'm going to get to work on them right away. I'll start tomorrow. Actually, no I'll start tonight."

Flint went on to explain his plan, who he would enlist to help him, when he expected to complete each item…

And that's when Buffett asked him about the second list, "And what about these other 20 things on your list that you didn't circle? What is your plan for completing those?"

Flint replied, "Well the top 5 are my primary focus, but the other 20 come in at a close second. They are still important so I'll work on those intermittently as I see fit as I'm getting through my top 5. They aren't as urgent, but I still plan to give them a dedicated effort."

To which Buffett replied:

"No. You've got it wrong, Mike. Everything you didn't circle just became your 'avoid at all cost list.' No matter what, these things get no attention from you until you've succeeded with your top 5."

Semper Fi
Gunny Mike
zilchworks.com

Monday, March 5, 2018

Embarcadero Discontinues the Sale of Upgrade Products

I received an email today informing me that as of April 1, 2018 Embarcadero will discontinue the sale of upgrade products for Rad Studio, Delphi and C++ Builder.

My first reaction was "OMG here we go again." Bailey didn't do a very good job at explaining what this means to me, a non-subscription owner of Delphi 10 Seattle. Fortunately, Malcolm Groves put out a fantastic video that explains what this means and what it will cost going forward.


I also found out from Bailey that Embarcadero is offering a 25% discount until March 31, 2018. So, for a non-subscription Delphi Enterprise user like me, that means $1,824 US. Ouch!

After listening to Malcolm describe what is really going on here, I don't feel as panic stricken as I did when I first read the email. $1,824 will get me up-to-date with Delphi 10.2.2 and give me a 12 month update subscription. Next year when my current subscription runs out it should cost approximately 23% of the new user price or $809 which works out to be $68 per month.

Delphi Enterprise Non-Subscription Upgrade Cost

Year Annual Cost Monthly Cost
2018 $1,824 $152
2019 $809 $68

$809 is 23% of $3,514 (Current New User License)

Semper Fi
Gunny Mike
zilchworks.com

Saturday, January 13, 2018

Playing With Fire(Monkey)

If you are like me and have been apprehensive about using FireMonkey let me offer you a renewed sense of hope. It's unfortunate that this hopefulness comes as the Delphi community morns the loss of Pawel Glowacki. However, Pawel will continue to influence at least this Delphi programmer, perhaps you, and undoubtedly many, many more.

I discovered the existence of Pawel's "Expert Delphi" book while reading one of the many R.I.P. blog posts. I sent myself a reminder to go purchase his book. And, this weekend I did purchase his book. I'm glad I did. I look forward to "Playing with Fire(Monkey)"!

In August I blogged "Why My Next Software Product Will Be Windows VCL Only". Well, this book is not about the VCL. Makes my VCL statement kind of ironic, don't you think. This book is about using Delphi FireMonkey to create cross-platform Mobile Apps from one code base. I did not know this about his book when I wrote that post. Taking on a new coding platform is a daunting task. I'm stepping up to the plate and taking on this task with the help of Pawel's book. I welcome you to join me in discovering how to "Play with Fire(Monkey)".

Expert Delphi - Preface


The world of a mobile app developer is getting more and more complicated. The technology is not standing still. Every day, new versions of mobile operating systems are released to the market. Mobile devices are getting new capabilities. User expectations are constantly growing, and it is becoming increasingly harder to meet them.

The only way to meet and exceed all challenges in the contemporary world of mobile development is to become a developer superhero! Super heroes have super tools. In this book, we are going to embark on the journey of mastering Delphi development. We will learn how to gain amazing productivity powers and rapidly build stunning cross-platform mobile apps from one codebase.

We will start with getting comfortable with using the Delphi IDE. Then, we will review the key constructs of the Object Pascal language and everyday programmer tasks, so you can easily understand and write solid and maintainable source code. Over the course of this book, the fun levels are only going to increase. We will start our adventure with mobile development with Delphi from building small projects that will make you feel like a real Delphi developer. Having mastered simple things, you will be ready for doing more serious stuff. We will go deep into understanding the concept of FireMonkey styles, which is the cornerstone of building stunning cross-platform user interfaces that will make the difference in the end user experience of your apps. The rest of the journey is all about gaining practical knowledge of using more complex Delphi frameworks. We will get down to the metal and harness the full power of mobile hardware and operating systems. We will be working with sensors, extending to the Internet of Things, building data-driven user interfaces, embedding mobile databases, integrating with REST web services, architecting scalable, multiuser backends, and more.

This book is packed with practical code examples and best practices for you to become an excellent mobile developer!

Expert- Delphi - Table of Contents


1: FASTEN YOUR SEAT BELTS

  • Delphi installation
  • Delphi compilers and toolchains
  • Hello World app
  • Deploying to mobile devices
  • Summary

2: MIND YOUR LANGUAGE

  • Do you speak Object Pascal?
  • Object Pascal Phrase Book
  • Summary

3: PACKING UP YOUR TOOLBOX

  • Parallel Programming Library
  • Working with files
  • JSON
  • XML
  • Summary

4: PLAYING WITH FIREMONKEY

  • Drawing in code
  • Get moving with timers
  • The power of parenting
  • Touch me
  • Game of Memory
  • Summary

5: FIREMONKEY IN 3D

  • Cross-platform 3D rendering
  • Using Context3D
  • Custom Wireframe component
  • Objects 3D
  • Moving Earth
  • Building an interactive 3D scene
  • Using 3D models
  • Starfield simulation
  • Mixing 3D and 2D
  • Summary

6: BUILDING USER INTERFACES WITH STYLE

  • Working with built-in styles
  • Using custom styles
  • Embedding styles as resources
  • Customizing styles
  • Using frames
  • Working with inherited views
  • Previewing forms on devices
  • Summary

7: WORKING WITH MOBILE OPERATING SYSTEM

  • James Bond's toy
  • What I'm running on?
  • The life of an app
  • Sensing the world
  • Taking photos
  • Using share sheets
  • Camera, light, action!
  • Working with address book
  • Notify me!
  • Navigating the web
  • Working with maps
  • Creating and consuming Android services
  • Delphi language bridges
  • Summary

8: EXTENDING TO THE INTERNET OF THINGS

  • Communication protocols
  • Understanding BLE
  • Connecting to things with ThingConnect
  • Getting close with beacons
  • Proximity solutions with BeaconFence
  • App tethering
  • Summary

9: EMBEDDING DATABASES

  • Architecting data-driven apps
  • Modeling data
  • Choosing a database
  • Accessing databases with FireDAC
  • Building data-driven user interface
  • Using visual live bindings
  • Fast user interface prototyping
  • Summary

10: INTEGRATING WITH WEB SERVICES

  • Understanding web services
  • Native HTTP client
  • Consuming XML SOAP web services
  • Integrating with REST services
  • Backend as a service client
  • Integrating with the cloud
  • Summary

11: BUILDING MOBILE BACKENDS

  • Delphi and multi-tier architectures
  • Getting low-level with WebBroker
  • Do it yourself with DataSnap
  • Easy REST API publishing with RAD Server
  • Summary

12: APP DEPLOYMENT

  • Deploying to App Stores
  • Enhancing your apps
  • Summary

13: THE ROAD AHEAD

  • What we have learned
  • Staying on top of everything
  • Your next Delphi mobile app
  • Summary

Expert Delphi - Prerequisites

You are expected to have a basic knowledge of Delphi and an interest in building crossplatform mobile apps for Android and iOS.

The Delphi IDE is a Windows program, so you will need a physical or virtual Windows installation. In order to develop for iOS, you will need a Mac computer. You will also need an Enterprise or Architect license for Delphi itself. In the beginning of the first chapter of this book, we cover the installation process of Delphi in a great detail.

Purchase Link:

https://www.packtpub.com/application-development/expert-delphi

Semper Fi,
Gunny Mike
zilchworks.com

Thursday, January 4, 2018

I've Been Telling the Wrong Product Stories

This post has nothing to do with Delphi other than it's the software development tool I use. In November of last year I finally purchased Microsoft Office 365. A couple days later I received a promotional email introducing me to Microsoft Virtual Academy (https://mva.microsoft.com/).

I visited the MVA site, signed up for a free account, and by pure dumb luck stumbled across an amazing set of videos designed to teach you how to create stories. The video series is called "Crash Course: Analytics Storytelling for Impact". (https://goo.gl/oFEc9F) This video series was put together to teach people how to present data analytics in a very impactful way. Although it's focus is on how to present data analytics, it has a very unique set of videos all about stories and storytelling.

The storyteller is Mario Juarez and he is phenomenal. The third video "Definition of a Story" (https://goo.gl/L5e1g8) hit me like a ton of bricks. It was as if everything all of the sudden fell into place. All the previous stuff I had read or heard about marketing such as; don't sell features sell benefits finally made sense.

In the past no matter how hard I had tried I always wound up telling what Jaurez refers to as "transactional stories". The description of the thing I did. The transaction or process. What I built, how it works, the sequencing of events. Sound familiar.

The stories I need to tell are what Juarez calls "transcendent stories". These are stories of how human life changed because of the interaction with your product. Transcendent stories go to the place of human experience and human values and human meaning.

Watch this video series. They will change they way you talk about your products.

The first story I'm working on is for my Credit Card Math product. I've created a fictitious customer persona called Kate. The story I'm creating is "How Credit Card Math Saved Kate's Marriage." The story model I'm using is defined by Kurt Vonnegut as "Man in hole". (https://youtu.be/oP3c1h8v2ZQ)

Here's a sneak peak at Kate:


My first video is taking me longer than I expected. Hopefully it will be completed soon. I'm very excited to see how this whole process goes.


Semper Fi,
Gunny Mike
zilchworks.com

Sunday, December 10, 2017

The Lazarus Effect

I haven't been focused on much software development lately, I've been working on some marketing material which I hope to have completed soon. Then I will get back to software development.

Last night I was prodded by my friend Jeff Duntemann's post on Facebook regarding the release of Lazarus 1.8 (with FPC 3.0.4). He mentioned this stuff to me a few years back and said I should check it out. I have always been a die-hard Delphi fan so I gave it a casual, glancing thought and moved on.

Well, now may be the time to give Lazarus a throrough going-over. I downloaded Jeff's book this morning and read through the first 30 pages and then skipped ahead to the "Installation" chapter. I'm always leery of installing freeware stuff, it's never as simple as point, click, and install.

I had no idea that FreePascal was the compiler and Lazarus was the IDE. had always thought these were two competing products.

Hopefully before the end of the year I will get Lazarus and FreePascal installed and give it a whirl. I'll let you know what I think.





Lazarus
https://www.lazarus-ide.org/
http://wiki.lazarus.freepascal.org/

FreePascal
https://www.freepascal.org/
http://wiki.freepascal.org/

FreePascal From Square One by Jeff Duntemann (free book)
http://www.copperwood.com/pub/FreePascalFromSquareOne.pdf


Semper Fi,
Gunny Mike
zilchworks.com


Saturday, August 5, 2017

Why My Next Software Product Will Be Windows VCL Only

I started this blog back in 2009 as I slowly emerged from a severe case of burn-out. From that first day I've been consistently saying I'm working on an update to one of my software products. And I'm still saying that today. I'm like the Rip Van Winkle of Delphi programming. I basically dropped off the face of the Delphi coding world, woke up from an 8 year technology nap, and have been in a learning fog ever since.

I have been procrastinating at every turn, about every tool, and every methodology. The bottom-line is... I can't make a decision. Check out this common theme among some of my posts going back quite some time.

How do you get past the Analysis to Paralysis when working on a new project?
https://softwareengineering.stackexchange.com/questions/155621/

What is The Best Database for Delphi Desktop Applications that Supports Stored Procedures?
https://stackoverflow.com/questions/1619887/

I Took A Little Walk-About - But I'm Back (Shit or get of the pot)
http://capecodgunny.blogspot.com/2011/08/i-took-little-walk-about-but-im-back.html

Last week I heard about Warren Buffett's 25-5 Rule.  I've never heard it put quite that way before. Anyway, it got me to change my attitude about decision making.

For example:

Should the new release of my Zilch software be Windows?
Windows and Mac?
Windows, Mac, iOS, Android?
What about the Web version?

ENOUGH!

I'm going Windows VCL Only! Period. I made the decision and it's final. Making decisions is so liberating.

  • I am the most proficient with Delphi VCL.
  • I have a distribution channel and payment gateway for Windows already in-place. 
  • I have 25 years worth of Windows customers I can market my software upgrade to.
  • I can use the current development tool chain I already have.

2017 is the 25th anniversary of my original product launch. I need to get busy working on the things that matter most and ignoring everything else if I hope to get it released this year.

I don't care if the Warren Buffett story is true or not. It's a good thing. I encourage all of you to have a look at it.

Cheers!

Semper Fi,
Gunny Mike





Error: Cannot Restore Form State--No TRzRegIniFile Component Specified

It's been a while since I fired up Delphi, about three months. And you know, it's true what they say "If you don't use it you loose it". I love my Raize Components now called Konopka VCL Controls, they make a lot of things very easy. For example, automatically remembering the size and position of form windows. I've used this dozens of times. It's a no-brainer.

So today, I was playing around with the DBGrid, trying different things. I created a new project with a Form and a Data Module. Added a lookup field to the grid. Just having fun and experimenting with stuff. One of the things I wanted to do but haven't got around to yet, was save the column widths of the grid after they've been resized. I find it annoying always having to resize the columns every time a program runs. That will be for another day.

Anyway, I decided I wanted to start by saving the state of the Main form window, just like I've done in the past. Drop a RzRegIniFile component on the Data Module. Drop an RzFormState component on the Main form. Set the RzFormState.RegIniFile property to the DM.RzRegIniFile component. And Voila... Done! Right!

NOT!

I kept getting the following error: "Cannot Restore Form State--No TRzRegIniFile Component Specified".



I'm going back and forth like a madman, checking things on the Data Module and the Main form. I tried dropping and re-adding the components. Nope. I started googling the error... nothing. Then it hits me. It's got to be a timing thing.

Yup! I opened the source file for the project and sure as shit, the Data Module was being created after the Main form.
begin
  Application.Initialize;
  Application.MainFormOnTaskbar := True;
  Application.CreateForm(TForm4, Form4);
  Application.CreateForm(TDataModule5, DataModule5);
  Application.Run;
end.
I moved the creation of the Data Model before the Main form and bingo... works like a champ!
begin
  Application.Initialize;
  Application.MainFormOnTaskbar := True;
  Application.CreateForm(TDataModule5, DataModule5);
  Application.CreateForm(TForm4, Form4);
  Application.Run;
end.
I'm amazed how quickly I lost sight of this little detail. I was only away from Delphi for maybe three months. Gee Whiz.

Enjoy!

Semper Fi,
Gunny Mike