Sunday, August 12, 2018

Delphi Book Collection

One week after I wrote about Warren Buffet's 25-5 rule I created my own "Top 5" list. However, this time I put a little twist on it. Instead of creating a to-do list of things I wanted to accomplish in the next six months, I created a list of the top 5 things I have accomplished within my lifetime. It took me about five or six days but I finally came up with my list.

#4 on my list: "Creating a software product back in 1991 that still generates sales today."

If you check the list of Delphi releases you'll notice that Delphi didn't exist in 1991. Turbo Pascal was the tool I used to create that first version of my software. Here is a picture of Zilch v1.11. Unfortunately, I do not have a copy of my very first version 1.0.

Zilch Version 1.11 (Version 1.0 not available)

Learning Turbo Pascal was fun. I owe my passion and desire for computer programming to Jeff Duntemann. He wrote a book called "Complete Turbo Pascal". It was that book that taught me everything I needed to know about computer programming, and the Pascal language. In fact, the reports within my software are pulled using the double-linked list example in his book. Duntemann does a brilliant job of explaining this concept.

That book is by far my absolute favorite programming book. I used several snippets of code, and in some cases entire routines from the examples in his book. Like the linked list routines. I remember getting close to being done. My software was about a month away from being released as shareware. And it dawned on me, "Holy crap. I've used a bunch of code from this book and it's copyrighted. Can I do this?" So I called Jeff and the conversation went something similar to this...

Me: Mr. Duntemann.

Jeff: Yes.

Me: You don't know me. My name is Michael Riley. I'm a US Marine developing software in my spare time.

Jeff: That's good. I like Marines.

Me: Mr. Duntemann, I've...

Jeff: Please call me Jeff not Mr. Duntemann.

Me: Okay. I've been using your book "Complete Turbo Pascal" to learn how to write my software. And I've embedded several of the code snippets into my software. The're all over the place. I've even used the complete linked-list code routines. Am I allowed to do this? Can I use your code in my own software?

Jeff: Of course. That's why I wrote the damn book.

Me: Whew, that's a relief. You have no idea how worried I was. I really like how you explained double linked lists.

Jeff: I get quite a few calls from people telling me they have my book and asking to explain something. I remember the phone ringing at 1 in the morning one time and I was explaining linked lists to this guy. I remember using a kite metaphor. You see it's like a kite with a tail, and attached to that tail is another kite with a tail. And attached to that tail is another kite. Kites and tails with attached kites keep going on and on and on.

I love this guy. That was 1991 and Jeff and I have been friends ever since. One of these days I'm going to have to get Jeff to sign this book. I've completely destroyed the spine. I even had to use clear shipping tape to hold the spine together.

Complete Turbo Pascal Third Edition - Jeff Duntemann

My books have been scattered all over my basement office. When I want one I go searching from pile to pile. Moving stuff, looking around. It's frustrating and not very productive. Arrrgh!

It's been like this for a long time. It's not just books that are unorganized. It's me. It's everything. Besides, the older I get the harder it is to keep track of stuff. Stuff I need to do. When it needs to get done. Who I owe it to. Who owes me stuff. All that stuff.

So, I dusted off my old Franklin Planner that I haven't used since 2010. Inserted the new planner pages on Wednesday night and started using it the next day. Life is so much better now. I set a task for organizing my basement home office on Saturday. Then I decided to gather up all my Delphi books and put them on one single bookshelf. Wow, I have quite the collection.

Click to enlarge image

And guess what? All those books are tied to my #4 lifetime accomplishment: "Creating a software product back in 1991 that still generates sales today".

However, it not about what I did. It's about people. The people who helped me while I was in the midst of doing the thing I did. Like I said, I owe my #4 to Jeff Duntemann. Without him this never would have happened. Look what it's lead to. It's because of Jeff that I stayed enthused, and stayed passionate. Passionate enough to buy 32 Delphi books over the past 28 years. Not to mention the eBooks sitting on my computer. Thank you Jeff.

Don't worry I've told this to Jeff already. He's not hearing this for the first time reading it here. What kind of guy do you think I am.

I have a challenge for you! I want you to create your own "Top 5" list of lifetime achievements.

It doesn't matter if it takes you a week, or two weeks, or longer. Just do it. Then sit and think about your accomplishments. Think long enough about them until you discover who helped you get there. And then, reach out to them and let them know.

Enjoy,
Gunny Mike
zilchworks.com



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


Sunday, August 6, 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





Saturday, August 5, 2017

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

Saturday, May 13, 2017

Program to an Interface and not an Implementation

I have been struggling with trying to understand what it means to "Program to an interface and not an implementation." Nick Hodges said if he could teach new developers one thing it would be "program to an abstraction, not an implementation". This is the same thing. (wayback machine link)

So I asked Hodges to explain this to me. Instead of trying to regurgitate some sort of answer that might come up short of what I was looking for, he sent me a link to a fascinating thread on StackOverflow (https://goo.gl/PNq7bY). This really is a great read. After reading it I was close to understanding but still not getting all of it.

I have recently started reading Head First Design Patterns by Eric Freeman & Elisabeth Robson. This book does an absolutely fantastic job of describing the GoF design Patterns that Uncle Bob so bluntly told me I need to understand. To be quite honest, I never would have bought this book solely based on the cover. (Not buying this book would have been a mistake.)



Amazon: https://goo.gl/MVybeZ

On page 11 of Head First Design Patterns they point out Design Principal #2: "Program to an interface and not an implementation." They do an excellent job of explaining what this means. My ability to understand what they mean... "Not so much". This is even after reading page 11 three times and reading the entire SO link Hodges sent me.

Why am I so dim?
How come everyone else gets it but me?

Ah ha, it hits me.

Each Delphi Unit has an Interface section and an Implementation section. In Delphi these sections are like Public Scratch Paper and Private Scratch Paper. (https://goo.gl/B7U5RR) All Delphi noobs are taught to stick stuff in the Interface section that you want to share with other units and stick stuff in the Implementation section that you don't want other units to have access to.

That is NOT what it means to "Program to an Interface and not an Implementation."

I had to unlearn what I had known about Interface and Implementation because of my 25+ years of Turbo Pascal/Delphi. And relearn that there are different meanings associated with Interface and Implementation. Sometimes it takes the light bulb a long time to go on

My end goal in all of this "new learning" is to understand Dependency Injection and how to put DI to use when I design/redesign software. I'm slowly getting there. Delphi's Interface and Implementation sections have different usage and meaning than the OOP Design Principle: Program to an interface not an implementation.

So, what does it mean to "Program to an interface and not an implementation"?

You have to figure this out on your own. I'm not trying to be a smart ass here. Once you get it, you'll get it. Asking someone for a quick 5 minute explanation won't do it. You'll have to dig and keep trying until it makes sense for you. In learning this concept some people use widgets. Some use sprockets. Some use ducks. I like chess.

Think about the simplest piece in a chess game. The Pawn.

What's the same about every pawn?
What's different about each pawn?
If you forget about color, how many different pawns are there? 8, 1, 3, 4 ?
What about the pawn to the far-left?
What about the pawn to the far-right?
What about the pawn that reaches the last row?
How many different moves does a pawn have?
Do all pawns have the same moves?

Trying to understand what it means to "Program to an interface and not an implementation" requires a different way of thinking.

Here is my completely oversimplified chess example:
+--------------------------------+
| PawnMovement (Interface)       |
+--------------------------------+

+--------------------------------+
| PawnMovementImplementations    |
+--------------------------------+
ForwardOne 
ForwardTwo
AttackLeft
AttackRight
EnPassant

So to me learning how to "Program to an interface and not an implementation" means making sure your pawn has movement not what the pawn's movement is.

Think this:
Pawn1.PawnMovement.ForwardOne
Pawn1.PawnMovement.ForwardTwo
Pawn1.PawnMovement.AttackRight
Pawn1.PawnMovement.EnPassant

Don't Think this:
Pawn1.ForwardOne
Pawn1.ForwardTwo
Pawn1.AttackRight
Pawn1.EnPassant

Enjoy!

Semper Fi,
Gunny Mike

Thursday, April 20, 2017

Gunny Meets Uncle Bob - Part 1

The last few days have been very interesting. It started when my friend Jon Aasenden posted a link to a you tube video called "SOLID Principles of Object Oriented & Agile Design" by some guy named Uncle Bob. This wasn't the first time I heard about Uncle Bob. Nick Hodges made a reference to something called SOLID in his book which is supposedly Uncle Bob's principles of object oriented design.

I bought Nick Hodges book "Coding in Delphi" over two years ago. I actually bought two copies. My first purchase was the printed edition. I went back and purchased the pdf version a couple months later after I decided I didn't want to type the examples if I could cut and paste them.

Anyway, I made it to page 28 and no further. I had a mental block about something and never worked through it. It's been sitting on my bookshelf unopened for over two years. It's amazing how fast time goes by. I have since learned that Nick has two more books. "More Coding in Delphi" and "dependency injection in delphi".

So after watching the Uncle Bob's video I decided to buy three of his books; "Clean Code", "The Clean Coder" and the yet to be released "The Clean Architecture".

I came home from work yesterday and "The Clean Coder" had been delivered. I was so excited. I couldn't wait to read Chapter 1.

BOOM!

I haven't felt this inadequate in a long time. Thank you Robert "Uncle Bob" Martin. In less than twenty pages you humbled this US Marine.

I went on Facebook and whined about how inadequate Martin made me feel. To my surprise a couple of highly respected friends mentioned they too had felt the same way after reading his stuff.  That was a little comforting but I still felt like crap.

According to Martin I'm supposed to give my employer 40 hours a week and then spend another 20 hours a week on my career. Learning, reading, practicing.

I'm also supposed to understand and describe the 24 patterns in the Gang of Four (GOF) book plus have a working knowledge of many of the patterns in the POSA books.

I scrambled around and googled for the 24 GOF patterns. Found a clean, concise 8-10 page pdf. Read it real quick. Check - That's done. I'll do the POSA stuff tomorrow. It's late. I'm tired. I'm going to bed.

Day Two:

I woke up this morning a little early because I had to pee. I came back to bed and tried to fall back to sleep. But I couldn't get Martin and what he said out of my head. I kept thinking, "I haven't got time for all this crap, I need to learn Dependency Injection. That's what started this whole thing anyway."

Then it hit me.

I started thinking about chess, and how Jimmy O'hara used to kick my ass every time we played chess back when we were both twelve years old. That was forty-six years ago. He'd take my queen within the first four to five minutes. Oh did I get pissed when that happened. I now had to play without my strongest piece.

Then I thought. Wow, chess was a really complicated game. It took a long time to learn how to move them 16 different pieces around. Wait a minute there aren't really 16 different pieces there are only 6 different pieces. I spent a lot of time learning how those 6 pieces moved.

Then it dawned on me.

If I want to be good at my craft I have to identify the chess pieces of my craft and learn how to move them. Wait a minute. Didn't Martin just tell me last night that I need to understand the 24 GOF patterns. He did. Aren't those the chess pieces of my craft? They are.

How can I expect to be good at my craft if I only give a casual glance at the chess pieces I need to use in my craft. I can't. Bingo.

Then it hit me again.

What about the POSA books and those designs?

I like to play golf. I started playing golf when I was twelve. Yup forty-six years ago. Learning golf was hard and it took a long time to get good at it and to learn how to use of each club. Hey wait a minute. I see a pattern here. Why can't I treat the patterns in the POSA books like golf clubs. If I want to be good at my craft I have to learn what each club does and how and when to use each one of them.

But wait there more. What about SOLID? Hey Gunny, how do you reconcile SOLID like you did using chess for GOF and golf for POSA?

JJDIDTIEBUCKLE The twelve leadership traits.

I spent twenty years in the Marine Corps. It's all about leadership and leadership traits. I lived, breathed, taught, and honed those twelve traits. I need to do the same thing with SOLID.

This works for me. You need to find a way to make it work for you.

Gang of Four Patterns = Chess
POSA Patterns = Golf
SOLID = JJDIDTIEBUCKLE

This journey I'm taking with Uncle Bob is not in the least a passive journey. If I want to fully embrace my craft (software development) I need to dedicate myself to it the same way I did for chess, golf, and leadership within the Marine Corps.

Time to strap it on.

Enjoy!

Semper Fi,
Gunny Mike








Saturday, March 25, 2017

Google, Mobile, and You. Are You Good?

I put my Delphi development on hold a few months ago so I could work on creating a responsive website for my software. The hardest part for me was trying to find a layout I was happy with. I took a little inspiration from the Embarcadero Communty website. I settled on a Bootstrap 9 X 3 layout. And now it's done and I can move on.

It's only been a couple days but I have already seen a 300% increase in traffic to my website.

Dave Collins from Software Promotions has put together a 5 minute video that talks about Google's big shift toward mobile first indexing. I strongly encourage you to watch this video. Mobile-friendly isn’t necessarily mobile-friendly

I'm just an Independent Software Deveopler like many of you. I felt compelled to share what I have learned over the past three months. We all love Delphi and the opportunities it gives us to create software and apps. You can have the best software or app out there but if people can't find it, it's not a good thing. Don't let this happen.

I look forward to getting back at it. It feels good to know thay my development efforts will have a fighting chance.

Semper Fi,
Gunny Mike
zilchworks.com


Tuesday, December 6, 2016

EMBT Webinar: Overcoming Monetization Challenges Using Licensing

Embarcadero Technologies is teaming up with the Association of Software Professionals to bring you Jessica Dewell of Red Direction.

Calling all owners, founders, CEOs, and all leaders whose company has products for sale right now! You will receive actionable and immediately useful information to review, evaluate, and evolve your product catalog to stay competitive…and profitable.

When you finally figured out how to make your products fly into the hands of customers that want it … something changed, and what worked before no longer does. A very important, and often overlooked place to start is with the product catalog. (More)

Sign Up Today

Embarcadero Technologies Webinar:
Wed, Dec 14, 2016 9:30 AM - 10:30 AM PST
Wed, Dec 14, 2016 2:30 PM - 3:30 PM PST
Wed, Dec 14, 2016 5:30 PM - 6:30 PM PST?

Enjoy,
Gunny Mike

Friday, August 12, 2016

How to use the SET LOG MESSAGE Feature Within ElevateDB

The more I use ElevateDB the more impressed I get with this product. Last week I visited the ElevateDB support forum, most likely related to a syntax issue I was trying to resolve. As I read through some of the posts written by other users, I came across a very curious and interesting tidbit of information. A user mentioned the following:
"If you add a log message before the OPEN Crsr, you will see that the function is executed for each row."
This certainly got my investigative juices flowing. I had to find out what he meant. He was referring to the SET LOG MESSAGE statement. There were no pictures to show how to implement this log message feature so I began digging around and figured out how this works.

ElevateDB comes with it's own GUI called ElevateDB Manager. It's similar to the SQL Server Management Studio (SSMS) Microsoft distributes.

Here is a screenshot of a New.SQL script inside ElevateDB Manager


The SQL script is a simple loop from 1 to 100 that displays a log message each time X is a multiple of 7.



If you execute this script it tells you that "The script was executed successfully in 0 seconds". But where are the log messages?

You have to turn them on.



With the Explorer > Log Messages visible you see all the SET LOG MESSAGE statements. The log messages continue to accumulate each time you execute a script. There are two undocumented ventures available within the Log Messages pane: Save and Clear.

Simply right click anywhere within the log message pane you have an option to either Save or Clear the log messages.

I love the SET LOG MESSAGE feature and use it all the time. I find it extremely helpful and I hope you do as well.

Enjoy
Semper Fi
Gunny Mike

Sunday, April 24, 2016

A Better Way to Present and Organize Error Messages in Your Delphi Applications

I'm in the process of totally redesigning an application I wrote 25 years ago. Today, I decided to look for a better way to present error messages to my customers. In the past I simply littered my code with bunch of technical speak ShowMessage('bla bla bla technical speak bla bla bla'); code fragments.

With the help of Google, it didn't take long to find out that the best approach is to use "Apologetic" language in error messages. This has a positive effect on your customers.

http://ux.stackexchange.com/questions/31359/should-error-messages-apologize
http://www.faqoverflow.com/ux/31359.html
http://freshsparks.com/user-experience-tips-best-error-messages/

I've never liked the idea that the standard ShowMessage gets positioned centered on the screen. I'd rather have a messaged display centered on the window where the error occurs. I also don't want my error messages scattered all over the place. So, I set out to do two things;
  1. Display error messages that are centered on the form where the error occurs
  2. Centralize all the error messages in one place
I created a separate unit for the express purpose of managing and displaying error messages:



This makes it very easy to keep track of all the error messages. It also lets me easily create similar but slightly different error messages for any given situation. I can also group related error messages by using a simple number scheme.

I'm a big fan of code completion Ctrl+Space. When I need to include an error message I simply type zmsg Ctrl+Space and up pops the code completion window with all the available error messages that I can choose from.

zmsg Code Completion

Enjoy,
Semper Fi
Gunny Mike

P.S. As far as using "we" inside the error messages. I asked my wife if she was okay with an application giving this type of feedback and she said it was fine with her.

Sunday, February 21, 2016

Real World Justification for Purchasing Component Source Code

I'm working on a database project using Delphi 10S Update 1. The database I'm using is ElevateDB, which is written with Delphi. I licensed the ElevateDB VCL Standard version without source code back in 2011 and maintain my annual subscription. I'm very happy with this product.

I ran into an issue where inside the IDE both the 32-bit and 64-bit platforms display data in a grid when all the components are connected and active. However, when I run the application the 32-bit version works great but the 64-bit version gives me an Access Violation.

I read that the initial Delphi 10S had a problem with the 64-bit compiler. I figured that since I upgraded to Delphi 10S Update 1, I didn't have an issue with the 64-bit version of the compiler.

What I failed to realize and only realized after three or four days of frantic postings on the ElevateDB support form, was I was using compiled DCU's. These DCU's, both 32-bit and 64-bit versions, were compiled using the initial Delphi 10S release. Therefore, the 64-bit DCU's were built with the initial flawed Delphi 10S 64-bit compiler.

Shame on me for not understanding and realizing this in the first place. If I had, I would not have acted the way I did.

This brings me to the topic of this blog post. If I had purchased the source code version of these components I could have simply done a build all and the problem would have been solved. I don't remember my reason for not purchasing the source code version. Perhaps it was the added expense. Perhaps it was my thinking "I'm never going to monkey with the code and didn't need it".

The thought never entered my mind that I could wind up with flawed DCU's because they were built with a flawed Delphi compiler.

Lesson Learned!

Semper Fi,

Gunny Mike

Wednesday, February 3, 2016

Poll: What type of Delphi shop are you?

Back in November I conducted a poll to find out what kind of Delphi shop people belonged to. From these results 70% of the Delphi shops have 5 or less employees.

Here are the results:

Poll Results

Here is the link if you'd like to cast your vote.

Enjoy - Semper Fi
Gunny Mike

Saturday, January 30, 2016

A few minor "out of the box" tweaks for Delphi 10 Seattle

I recently upgraded to Delphi 10 Seattle Update 1. The first thing I noticed when I fired up the IDE was the font size of the Object Inspector and Tool Palette looked oddly larger. Then I remembered I had tweaked these settings a while ago when I first installed Delphi 10 Seattle. Of course I couldn't remember how I did this but I did remember there was a discussion about it somewhere.

The "out of the box" font setting for Delphi 10 Seattle is Segoe UI with a font size of 10. I prefer a font size of 9. Embarcadero has a nice wiki on how to change the initial settings.

http://docwiki.embarcadero.com/RADStudio/Seattle/en/System_Registry_Keys_for_IDE_Visual_Settings

I made one minor adjustment to EMBT's recommended settings:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Embarcadero\BDS\17.0\ModernTheme]
"FontName"="Segoe UI"
"FontSize"=dword:00000009
"MainToolBarColor"="clGradientActiveCaption"
The only other tweak I made was to the editor font. I prefer "Consolas" mainly because it formats zeros with a slash which makes them stand out from the letter "O". The editor font is located here:

Tools > Options > Editor Options > Display

Share your "out of the box" tweaks for Delphi 10 Seattle in the comments.

Enjoy - Semper Fi
Gunny Mike

Wednesday, October 14, 2015

Create Professional Installs for Mac OS X

I'm just getting started with learning cross-application development. One of the many issues that's crossed my mind has been how do I get the Mac OS X version of my software installed on a customers machine.

Well that question was answered yesterday during the "Prototyping an Object Pascal Code Editor with FireMonkey in Delphi for Windows and OSX" object pascal CodeRageX session.




Eli M. from Peacekeeper Enterprises, LLC presented a slide for a product that lets you create installs for Mac OS X. The product is called Packages and can be found at the below url:
http://s.sudre.free.fr/Software/Packages/about.html

I have not tried Packages yet. However, it appears similar to the Inno Setup tool for Windows.
http://www.jrsoftware.org/isinfo.php

Enjoy - Semper Fi,
Gunny Mike

Monday, September 28, 2015

FireMonkey Under the Hood: How FireMonkey Does What It Does

Here are two great videos from ITDevCon 2012 by Ray Konopka that talk about how FireMonkey does what it does. Ray gives an overview of the high-level differences between VCL and FMX. In part 2 he shows how to create custom FMX controls.

I love the way Ray gets frustrated. He's just like us.

Creating Custom FireMonkey Controls Part 1
https://www.youtube.com/watch?v=m0NeWCmKAnU

Creating Custom FireMonkey Controls Part 2
https://www.youtube.com/watch?v=ufCKmYAxyCA 

Update: 10/03/2015
I spoke with Ray and he gave me the link so we can download the source code he used in the demo. Thanks Ray!
http://www.raize.com/Sessions/CustomFMXControls.zip

Enjoy - Semper Fi
Gunny Mike