Categories
News podcast Video podCast

Join us for a LIVE Video Episode of the Podcast at Delphi.org

Tomorrow will be a live episode of the Podcast at Delphi.org

You can join us live on YouTube with your questions and comments, or catch the replay posted here. Stay tuned tomorrow for details on how to join.

This is our first time with this new format and would love to get your feedback. We’ll also appreciate your patience as we work out the technical details.

Categories
Article News

Get Ready for the New Programmers!

U.S. News an World Report just ranked Software Developer as the best job for 2018. They use data from the U.S. Bureau of Labor and Statistics to rank jobs based on pay, job security, mental engagement, stress, room to advance, satisfaction, and work-life balance. Since you are here, you most likely agree with that ranking and are surprised it took so long for someone else to recognize it.

Software Developer #1 Best Job

This means we will see a lot of people interesting in software development. Anyone looking for a better job is likely to start at the top of that list and work their way down until they find one they are interested in. Not to mention everyone who sees the headlines about Software Developer replacing Dentist as the #1 Best Job. Whatever the reason, software developers will get a lot more attention.

Everyone is Focused on Software Developers

When I’m talking to people about career advice I think it is more important to choose a career that suits the individual (internal factors) than basing the decision purely on external factors like pay, etc. That being said, I honestly believe Software Development is only going to get more important. Going forward, software development and related jobs (many of which aren’t even invented yet) will consume the many of the other jobs as automation and artificial intelligence take over more aspects of our life. It all depends on which side of the automation revolution you want to be.

 

When I was really young (like 3rd grade) I knew I wanted to program computers for a living. A family friend told me that I should look for a different job because by the time I entered the career market computers would be programming themselves and there would be no jobs. I remember thinking once that happens there would be no jobs, and someone would need to teach the computers how to program themselves better.

Just recently I was in Tokyo for the 10.2 launch event. I was talking to members of the press, and one of them made a similar assertion “What is the point of releasing better developer tools when soon computers will be programming themselves?” I shared the story from when I was a kid and said that “Yes, AI is automating and consuming other jobs, but the programmer will be the last to go. Once AI’s no longer need humans to make them better there will be no jobs for anyone!”

Congratulations, you choose wisely.

So what does this mean for you, as a software developer today? Congratulation’s you choose wisely! But be prepared for a lot of people to come to you for career advice. Remember that Delphi offers a great Free Starter edition, and Embarcadero Academy is full of content for people learning to program.

Categories
Article News

Law of the Instrument and Curse of the Programmer

If you aren’t familiar with the Law of the Instrument, otherwise known as Maslow’s hammer/gavel, or the golden hammer it is often expressed as

If your only tool is a hammer, you treat everything as like a nail.

My understanding is that the law of the instrument means you are limited by instruments or tools you know how to use. For example, if you have a screw, some wood, and a hammer, then you might successfully get the screw into the wood, but a screwdriver would be a better alternative.

Law of the instrument
Image from Pixabay by Steve Buissinne

The law of the instrument also means an obsession with the perfection of the instruments you know. I remember back in the day when I was convinced there was no reason to bother with any other programming languages because Delphi was the best. Now I’ve spent some time using a lot of other programming languages, and so I can confidently say Delphi is the best, while I can see the value and use of other programming languages.

I believe it is worthwhile learning about new technologies, frameworks, languages, or methodologies. Then you can pick the correct one for the job. This doesn’t mean you need to be an expert in all of them, but you should know enough that you are confident in your choice.

The reverse of this is the obsession to chase new and exciting technologies and recreate things every few years. This keeps the developers entertained, but doesn’t really provide business value. Again I believe Delphi does a good job with this as it respects your existing code while moving forward to new platforms, features, and frameworks.

So what is the Curse of the Programmer?

When I’m talking to other programmers I see two behaviors. The first is, every problem they encounter in life (at work and beyond) they respond with “I could write a program to do this,” or some variation. By extension, they also cast a critical eye toward any software system (even those developed by themselves) to see how to do them better. This results in a huge backlog of projects that they create to fix problems, fix a problem better, or just out of curiosity to see if they can.

This is similar to the Law of the Instrument, but I see it more as your learning the flexibility and power of programming results in your seeing many opportunities to apply it. I’ve talked to people in other industries, and I think the general tendency is fairly universal, it is just that programming is (in my opinion) so much more powerful and flexible than many other applied technologies.

The second behavior, which is something to be more cautious about falling into, is the urge to create a “library” or “framework” instead of finishing the program at hand. For example, you are creating a program to solve a problem, and in the process, you create series of libraries just in case you need to solve similar problems.

There is value in having reusable libraries, functions, components, and frameworks. The trick is to not let the creation of them get in the way of shipping. The best way I’ve found to deal with this is to only create the library when you need it. Write your code with the appropriate level of coupling to solve the problem at hand. When you need to reuse a bit of it elsewhere, consider refactoring it into something reusable. Then as you use it in more places you can keep refactoring it and expanding it until you have a full blown framework.

How do you see the Curse of the Programmer in your life? What do you use to prevent every project from spawning a series of reusable frameworks?

Categories
News

Some of my New Year’s #CodingResolutions

The joke goes that, when asked, the software developer responds that their New Year’s Resolution is “7680×4320” or 8K. Joking aside, tradition has it that at the turn of the year we evaluate our lives and look for areas of improvement. Here are a few of my software development related New Year’s #CodingResolutions!

  • Unit Test More: DUnitX and TestInsight being my tools of choice. Most of the code I write is integration code, integrating component A with control B, and I use that as a justification to not unit test it. But when I do write library or component code, I try to create a unit test for it. I find it very useful to do so and am always working to be more consistent.
  • Take a course on Embarcadero Academy: There are a few free courses, as well as some premium courses from the top trainers in the community. Something there for everyone to learn from.
  • Get better at using version control on personal projects: Version control is a must when you are collaborating with others on a project. I remember the first development job I had where I was working with other developers. We emailed code back and forward. We used the archived history of emails if we needed to roll back to an earlier version. The lead developer maintained the “authority.” Needless to say, this was a mess and didn’t work very well. RAD Studio has a great history feature that automatically backs up the last few versions of your files when you save, and you can set it to save on execution (a great idea), so it might seem like version control isn’t as necessary on non-collaborative projects. This just isn’t true. The IDE will integrate into today’s top version control systems, so there is no excuse not to. I signed up for a paid Developer account on GitHub, which is where I keep all my projects. BitBucket is another popular choice, which offers private repositories for free, but charges you for collaborators (the opposite model of GitHub). BitBucket offers Mercurial too. Which system do you use?
  • Setup my own Continuous Integration server: If you don’t have an automated, repeatable build process, then you don’t have a release. Designating one of your developer’s computers (even if that is you) as the build server is not a valid solution. If you are going to have a Build Server, then you might as well have CI (with automated Unit Tests!) so you know your build is always good. Craig Chapman provided a recent webinar on setting up your own Continuous Integration system with SVN & Jenkins. Jenkins is a popular solution for CI that even offers a RAD Studio plugin, but if you want to simplify things, take a look at Continua-CI from VSoft.
  • Automate more with DevOps: Version Control and Continuous Integration are the first steps in DevOps as a developer, but there is more. Everything that can be automated should be automated.
  • Pay attention to Warnings, Hints, Static Code Analysis, Audits and Metrics: One of the beauties of using a compiled language is we have a compiler that will immediately detect a huge number of errors, which we must fix if we want to even use or test our programs. The compiler also provides a number of Hints and Warnings that frequently indicate your program might not function exactly like you intended. I have a policy of always addressing Hints and Warnings too. I’m also a big fan of FixInsight, which really expands these compiler messages in so many useful ways. Our favorite IDE also includes more options to keep your code fresh and maintainable: Code Toxicity and Audits and Metrics. The Code Toxicity is available in all editions and provides some simple static code analysis for things like Cyclomatic Complexity. Keeping an eye on these is a good way to make sure your code is maintainable and less likely to have unintended behaviors. The Audits and Metrics takes this to the next level with a lot more detail. And it’s included in Enterprise and Architect editions.RAD Studio Audits
  • More focus on best practices and software security.
  • Do more with RAD Server. I’ve done a lot of building REST clients and they are great. I’ve done some basics of building REST servers but would like to do more. RAD Server is a great solution for building REST services.
  • Deploy RAD Server to the Cloud. I’ve done a little with Amazon Cloud Services and that is what I am thinking about doing, but there are a lot of other great cloud hosting options out there to consider.
  • Keep Exploring the Amazing 3rd Party components from all the great Technology Partners. The GetIt Package Manager makes it easy to install a new component or library. 
  • Build some Neural Network and Artificial Intelligence solutions with Delphi. This is something I’ve always been interested in but never implemented. There are so many advances in this field right now, which makes it even more exciting. Additionally, there are so many promising libraries available for Delphi. Boian Mitov of Mitov Software has IntelligenceLab. Dew Research has a great looking math engine. And then RiverSoft has a serial of libraries for Genetic AlgorithmsFuzzy Logic, and an Inference Engine. You can check out a video about IntelligenceLab today. I’d love to see an IDE add-in that uses neural networks for static code analysis and help with writing code.
  • Beyond all of that, I want Blog, Podcast, and create more training videos.

How about you? What are your New Year’s #CodingResolutions?

Categories
Conferences News

Robert “Uncle Bob” Martin is Speaking at CodeRage XII

Here in the Delphi community, we all know Dr. Bob Swart, and CodeRage wouldn’t be complete without him (he has a session this year on Customizing DataSnap Method Output, don’t worry.). This year we are also hearing from Uncle Bob, the author of Clean Code – A Handbook of Agile Software Craftsmanship. This is one of those “must reads” that all software developers should have on their bookshelf.

I had an opportunity to see Uncle Bob speak a few years ago, and it was very memorable. This session will be like no others you’ve seen. He is speaking on “The Clean Coder – An Introduction to Software Professionalism.” His session and the live Q&A will be available only during the live CodeRage session, so be sure to join Uncle Bob for this amazing session!

Register now!

Robert "Uncle Bob" Martin

Categories
FireMonkey MVP News VCL

Why I Keep Choosing Delphi

Turbo Pascal

Early on I learned Turbo Pascal, which was a huge step up from the Basic and Batch File programming I cut my teeth on. When Delphi came along I thought it was brilliant and fell in love immediately. I had no interest in learning other programming languages or tools. Delphi did it all, and that was great. I found myself plenty of work and enough to keep my interest.

C++Builder

I was curious about other programming languages, from an academic point of view. I took a night school class in Assembly. I had a smattering of C & C++. Looked at some Ruby (back before it was hip), Java, JavaScript, etc. Eventually, I found myself spending a few years debugging laser printers, which ran a combination of C/C++/COM all on a Linux platform.

C#

From there I went back to full-time Delphi programming, but the new company I was working for bought into the “there aren’t enough Delphi developers” myth and decided to move to C# & WinForms. We immediately were able to hire some new C# developers, but as we got to know them we found out they had more Delphi experience than C#, but they bought into the “there are no Delphi jobs” myth and rebranded themselves as C# developers. (This is what we call a circular argument or self-fulfilling prophecy.) In the end, the project took 4 times longer than it should have, despite having more developers, and “more modern developer tools.” They really should have stuck with Delphi.

Ruby

I moved to a new job doing Delphi development full time, and then that company bought into the C# & Silverlight are the future. Since I had C# experience, I started working on the new Silverlight front end. The back end and the desktop app remained in Delphi (with a little C++). We all know what happened with Silverlight (if you even remember it . . .)

JavaScript

From there I ended up really branching out. I did a lot more work with C#, Xamarin, Java, JavaScript, Objective-C, and Oxygene (known as Delphi Prism at the time). There was still some Delphi mixed in too. I taught a few classes and workshops on Android development with Java. I learned to appreciate some of the benefits, strengths, and qualities of each. I found things about all of them I liked (less so about Objective-C).

It was at this point I could see that most developer skills work across languages, tools, and platform. There is value in knowing and using multiple languages. The basic tenants of each language influence the way you do things in other languages, in a positive way, helping you to look at problems in a different way. There are some projects, platforms, and problems that are best suited to certain programming languages and tools. For example, if you are working with the web, you need to know at least some JavaScript, HTML & CSS (the latter two not being programming languages, but I digress), even if you are using some sort of abstraction layer.

Delphi Helmet

Throughout all of this, I still found myself choosing to Delphi for personal projects. Occasionally I’d try personal projects in other tools and languages as a way to get to know them better, but I still found Delphi to be a better solution for most general purpose projects. One of the defining characteristics of Delphi for why I keep coming back to it is that it makes the common tasks really, really easy while keeping the rest simple and possible.

Other tools that focus on productivity, make a small subset of tasks as easy as Delphi does, but also make anything beyond those tasks, or the that “ideal” scenario, hard or impossible. While other general purpose tools don’t do anything to optimize common scenarios, which makes simple tasks more complicated than they need to be.

Now with multi-platform development Delphi is more important than ever. The approach Delphi and FireMonkey provide make it quick and easy to do the most common tasks, while also keeping all the platform APIs and features within reach.

Delphi really invented the 3rd party component market as far as I am concerned. From the beginning, it shipped with all the source code for the VCL and also included a robust OpenTools API and component model making easy for others to extend the IDE, and build reusable components and libraries. All the technology partners are a huge part of why I choose Delphi.

Delphi also has a huge commitment to the code we as developers develop. I attend a lot of general software developer groups, and it is common to hear developers complaining about how they just finished porting their code to support a new version of their tools, only to have it all break again because a new release of their non-Delphi programming language or framework just came out. Often times they just throw it all out and rewrite to support a new version. Sure, Delphi it isn’t perfect, and sometimes there are incompatibilities or breaking changes from version to version, but by comparison, Delphi is so much better at this than any other language or platform out there that I have seen.

I started out choosing Delphi because it was what I knew. Now I choose Delphi because it gets the job done better than the alternatives. The fact it is faster for development is nice, but only part of the equation. I used to have a hat that said “Delphi does it all, especially Windows” and that is truer than ever today.

So why do you Choose Delphi? Share your reasons in the comments or on your blog #WhyIChooseDelphi

Categories
Audio podCast FireDAC podcast

Getting Technical with Cary Jensen and FireDAC (Episode 74)

In this episode of the Podcast @ Delphi.org we talk with Cary Jensen about his new book Delphi in Depth: FireDAC and the upcoming Delphi Developer Days which Cary puts on with Dr. Bob Swart. Nick Hodges, our co-host, was a previous host of Delphi Developer Days with Cary, and I’ve made a number of appearances there as well. They are highly recommended.

Cary’s new 558 page Delphi in Depth book tackles everyone’s favorite multi-platform database access framework: FireDAC. Cary gives it his unique treatment that only he can deliver. He gives special emphasis to all the configuration options available with FireDAC that can help you gain even more performance.

Delphi in Depth: FireDAC by Cary Jensen

For this year’s Delphi Developer Days, Cary and Dr. Bob are doing things a little differently. They are doing a special workshop focused on database development. You are encouraged to bring your laptop and follow along while you learn from the masters!

Just in case you missed it, Cary also put on a webinar on FireDAC recently that I recommend you check out.

Categories
Tools

Creating a Bootable USB Drive on macOS from an ISO

Creating a bootable USB drive from an ISO is pretty easy on Windows, but you end up going to the terminal on macOS. Not a big deal if you remember all the commands. Since it seems like I’m frequently installing something (Linux, Windows 10, etc.) on a different I thought I would make a quick blog post listing the steps for next time.

  • First convert the ISO into a disk image for macOS.
  • Then rename it to .img
  • Use diskutil to find the target USB drive
  • Unmount the USB drive and write the img file
  • Eject the USB drive
hdiutil convert -format UDRW -o targetfile.dmg sourcefile.iso
mv targetfile.dmg targetfile.img
diskutil list
diskutil unmountDisk /dev/disk4
sudo dd if=Desktop/targetfile.img of=/dev/rdisk4 bs=1m
diskutil eject /dev/disk4

I usually get an error from macOS when I’m done about not being able to read the USB disk. It is also fairly quick too.

Categories
News

4 Years at Embarcadero Technologies

This week I am celebrating my 4 year anniversary at Embarcadero Technologies. Time has flown by and a lot has happened. Mostly a lot of good milestones. One of my favorite things is experimenting with developing on new devices, so I thought I would list some the new platforms and devices I’ve developed for with Delphi since joining Embarcadero.

  • Android support was released shortly after I joined Embarcadero. This was and is a huge deal. I think when Embarcadero started down the path to add mobile support iOS was much bigger than Android, but now that has decidedly tipped. iOS is still very popular, but Android is the more popular platform, especially for line of business type development.
  • Google Glass is just an Android platform, but the fact it worked out of the box with Delphi is a pretty big deal. I still have my Glass and use them from time to time. If I had prescription lenses or didn’t need my regular glasses I would probably wear them more. I am a big fan of wearable technology and the Android platform.
  • Android Wear is another Android device, but still great to work with and develop for. This just worked with Delphi. I’ve tried with a few different Android watches, but different manufactures, round and square displays, and they all worked great. Despite the much lower power on Android Wear devices Delphi apps still performed great thanks to the native compiled binaries.
  • Amazon Fire TV, FireTV Stick, Ooya, and other Android set top boxes all just worked with Delphi’s Android support. I even made a simple game to play to play with them. Sometimes when I see these new devices I wonder if it will require some effort to make it work, but typically it just works.
  • Emotiv EPOC EEG Headset is a Brain-Computer Interface that reads your thoughts and interfaces them directly to the computer. I toured a number of software developer conferences, including some keynotes, with my Delphi developed thought controlled Parrot AR Drone.
  • Bluetooth Heart Rate Monitors, Scales, etc. the scale was extra of fun because it didn’t have a GATT standard, so David and I spelunked it to get it to work. Found out the measurement was in some unusual metric measurement like decagrams, and had the high bit and low bit used to indicate something else.
  • Linux is the newest official platform to be added. Out of the box it is Linux server, but thanks to FMXLinux by KSDev you can build Linux GUI applications on it as well. Again it officially supports Redhat and Ubuntu, but most other common Linux distributions are reported as working as well.
  • Beacons are a cool new technology that provide proximity information, and thanks the triangulation between multiple Beacons you can do indoor location as well. The BeaconFence technology make it all even easier to work with too.
  • Raspberry Pi3, Beaglebone Black, and other Single Board Computers were fun to work with. Since they have ARM CPUs it is simple a matter of loading Android on and they work like a charm. Sometimes installing Android was the most challenging part.
  • Arduino isn’t a target directly for running a Delphi app on it, but when I used Boian Mitov’s amazing Visuino and then his Communication Lab components it is really easy to build an app on the Arduino and then talk to it from an app running on Delphi.
  • Latte Panda is an Intel + Windows 10 based SBC with an embedded Arduino chip. This is like the best of both worlds when it comes to SBC projects. It is a full fledged Windows 10 computer, but you can dual boot Linux (which I did). In theory you could install and run Delphi on it, but I wouldn’t recommend it. I did install Visuino though, and it could talk to the embedded Arduino just fine. A real thing of beauty.
  • REST Services aren’t really a device, but a lot of devices expose their data via REST Services. The built in REST Client Library and the new RAD Server REST Server solutions make it really easy to talk to pretty much any REST Server you encounter.
  • Chrome OS is Google’s entry into the OS market running on Chromebooks, which are halfway between a tablet and a laptop. Google recently started rolling out Android support on the latest Chromebooks, so I picked up Samsung Chromebook Pro and sure enough, Delphi Android apps work great on it. While I was in there poking around I discovered Chrome OS is running on Linux at the core, and since the Samsung Chromebook Pro has an Intel CPU I decided to try targeting it from Linux support, and it worked too. Now I am thinking this might be my new favorite laptop!

That is a lot of new devices and platforms in four years. And I know I didn’t get all of them (like the Chromecast, the Kinect, Philips Hue Lights, etc.) Just take a look at our supported IoT Device list. I am looking forward to what the next 4 years holds in store for Delphi, C++Builder and RAD Studio.

What is your favorite new platform for Delphi? Or maybe you are a big fan of the fact we now have the free Starter edition?

Categories
Architecture Funny

Exceptionally Bad Exception Abuse

Nick Hodges' Coding In DelphiI was reading Nick HodgesCoding in Delphi again last night (insomnia). In chapter 1 on Exception Handling he opens talking about how not to use exceptions. It got me thinking about some of the atrocious exception usage I’ve seen. I thought I would share a few examples beyond the usual exception sins.

The Try / Except / Raise / Free Pattern

The documentation on the Try / Except pattern says that all the code after the Except block gets ran because the exception is handled. Additionally you can call Raise during the handler to send the exception further up the call stack.

I had just started a new job and was sitting with one of the senior developers to fix some bugs and get to know the codebase. He was creating a local object and so needed to free it. This is the pattern he used:

sl := TStringList.Create;
try
  // using sl
except
  raise;
end;
sl.Free;

I looked at the code for a minute quizzically, and then asked why he did that. He explained that everything after the except always gets ran, so he can be sure the memory is freed, but still let the exception bubble up to the global exception handler so it is logged. I told him that I was pretty sure calling raise in the except block prevented the code after the block from being ran. He assured me he had been writing code like this for a long time, and it always works.

I thought about it a bit more and then suggested we test the code. So we made a little test application with a message after the except block, and forced it to raise an exception, and sure enough, the message didn’t show. (Always test your theories and patterns with test code!)

There was a look of panic on his face. He’d been using this pattern for years, and it was all over multiple codebases. He claimed that the documentation must be wrong or it changed in a recent update, but I tried to assure him that is was clear and always worked that way, he just misunderstood.

Log ’em All and Let Support Sort ’em Out

This was using an early version of C# and WinForms.NET in Visual Studio. I took over a project and was having a hard time tracking down some odd behavior. Some code just wasn’t being ran, and there was no error messages. This was a project that was really, really early in the development process, and my first large scale project in C#, and I was getting really frustrated.

I finally discovered that an exception was being raised, but it was never showing up as an error. Even if the debugger was attached there was no exception message. The program just kept on running as if nothing happened, but the operation aborts. I started to question .NET’s ability to handle exceptions.

I dug and dug and finally figured out that the previous developer had setup a global exception handling and logging system that captured all the exceptions and logged them into the eventual support database with a detailed call stack. IIRC WinForms apps close automatically if there is an unhandled exception, so having an exception handler is a good idea, but silently logging them seems questionable. And then since there was an exception logging system in place the developer set the project options to have the debugger ignore all exceptions.

The result is an app running completely silent of exceptions, even while developing, but at least support will have a lot of debug information. I talked to the original developer, and he thought it was a brilliant idea, and said it is the first thing he does in all his projects. He just looks in the support database to see if things are working. His logic being users don’t want to see error messages. Not sure how hiding all the error messages is a good idea, especially hiding them from the developer during development.

Exceptions as Robust Return Objects

I was maintaining some code where a previous developer built this system where custom Exception were used to return a complex type system. He built this impressive hierarchy of exception classes, and then only certain types of exceptions were handled at different levels, where the data was needed. So instead of methods returning a result, or modifying a passed value, they all just raised different exceptions, with the properties set to different values.

There are really two issues here in my opinion. The first is raising and handling exceptions is rather expensive. A better option would have been to just create plain old objects (or even interfaced objects) and return them as results. You can still examine their types and decide when to handle them. You would just need to be aware of managing the object lifecycle (the automatic lifecycle handling was his justification for using exceptions).

The second issue is this was just one subsystem of a larger project. It was only this subsystem that used this bizarre data management system. So when you were fixing a bug here there was a mental tax of wrapping your brain around the different architecture. As soon as you figure it all out, fix the bug, and move on to other code you go back to the normal way of thinking. Again paying the mental tax of forgetting the atrocity you just witnessed.

I really believe that in a large project there should be some consistency in how the pieces are architected unless there is a compelling reason to do things different in one subsystem. That makes it easier for developers to work in different parts of the system.

So what are the craziest abuses of exceptions and exception handling you’ve seen?

By the way, Nick has a new book out on Dependency Injection in Delphi. You should pick up a copy.Nick Hodges' Dependency Injection In Delphi