There’s a Method to My Madness

by | February 9, 2019

There’s a Method to My Madness

Jeff Summers

February 9, 2019

To a non-technical outsider, programming somethings looks like black magic or some kind of dark art that mere mortals cannot possibly understand. There are times that I think that it is the programmers that concoct this mysticism to impress those around them. There can be no other logical explanation as to why we purposefully make things so confusing and complicated.

Take for example the concept of Methods in the Swift programming language. They are referred to as methods but to create one you use the keyword “func” which stands for function. To the ill-informed there would be an assumption that a method and a function are the same but they are not. Well technically they are but they aren’t. See what I mean by programmers creating a smokescreen to make themselves look smart and the code reader feel confused?

The subtle difference between a function and a method is that a method is a function that is within a Structure (struct). Perhaps William Shakespeare was actually a programmer when he wrote his famous line, “a rose by any other name would smell as sweet.” We should remember that this line came from Romeo and Juliet where Juliet is basically saying, “Dude, I really don’t care who your family is or what they smell like I know guys like you” or something like that.

So like in Romeo and Juliet, the concept is the same. They are basically the same thing the only difference is their address. If you are inside a structure you are a method; if you are not in a structure then you are a function which as we learned using Schoolhouse Rock is used for hooking up variables and loops and constants.

The next time one of your programming friends tries to strut his knowledge about methods and functions and asks if you know the difference, just ask him if he is inside or outside the Structure and watch his jaw drop open in amazement.

Share this Article

Posted by Jeff Summers

Author, technologist, and baseball aficionado specializing in information technology and developing new and creative ways to interact with the world around us. My goal is to extend the boundaries of what is possible and find ways to make the world a better place while having fun.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Stay Connected

Search

More Articles

Pace Layered Architecture Categorization

Change is inevitable. Today’s computing environments are constantly in flux from internal and external forces that put demands on the systems and necessitate changes to maintain its value stream. Technology currency is a constant struggle that organizations must...

TBM, Another Holy Grail?

Technology Business Management or TBM as a term was coined around 2012 although many of the concepts making up this framework have been around for almost as long as there has been IT. In its simplest form, TBM represents the integration of business, technology, and...

Visionary or Dreamer?

Thinking back over your life you’ve met and worked with countless personality types. You have been a part of teams that struggled to complete simple tasks and the work felt meaningless. Perhaps your goal in these times was to just trudge through the mud hoping the...

Archives