Category: Programming

Lean Code and Productivity

Writing code can be a very time-consuming process and finding ways to be more productive is typically welcomed by professional programmers.  While many new programmers are anxious to learn their language of choice, few spend any time learning about the Interactive Development Environment or IDE they are using to write their code.

Programmers can increase productivity by taking advantage of the many keyboard shortcuts that are built into their IDE or editor of choice.  Many IDE’s are designed to work on any platform and makes learning them that much more valuable.  In this context, choosing the right IDE can be just as important to your productivity as knowing the language itself.

A short list of the primary IDE’s I use includes:

  • IntelliJ IDEA HelloWorldMicrosoft:  Visual Studio 2017 (C, C#, C++),
  • ActiveState:  Komodo IDE (TCL/Tk),
  • JetBrains:
    • CLion (C++),
    • PyCharm Professional (Python),
    • IntelliJ IDEA Ultimate (Java),
    • PhpStorm (PHP),
    • RubyMine (Ruby),
  • NetBeans IDE:  NetBeans (Java).

Most of you reading this are likely familiar with the more common key combinations such as <Ctrl>+<s> to save a file, <Ctrl>+<c> to copy highlighted text, or <Ctrl>+<v> to paste text.  Many IDE providers have developed key combinations that provide much more functionality than typically offered by primitive text editors.  Extended features may range from basic editing and code navigation to code selection, code completion, code generation, code refactoring, and so much more.

IntelliJ IDEA SecretsVisual Studio 2017 (Microsoft), Komodo IDE (ActiveState), IntelliJ IDEA Ultimate and PyCharm (JetBrains) are just a few examples of IDE’s where key combinations exist to perform a wide variety of tasks.  Also knowing certain shortcuts that can be used while entering code can save a significant amount of time.

A premium IDE is well worth the investment in both money and the time required to learn it.  Extending IDE functionality to include automated code generation, code formatting, import optimization, and support for version control systems are just some of the reasons for using a premium IDE.

Once you discover the key combinations that are available to you, remembering them will be the next challenge.  Practice makes perfect and the more often you use them, the more likely it is that you will remember them.

CLionMenuDropDownIf you’re accustomed to working with your mouse when navigating the menu options inside your IDE, make note of the keyboard shortcut that may appear next to the menu option you are using as pictured in this CLion IDE drop-down menu.  If not this time, perhaps it may be worth trying the next time you find yourself reaching for the mouse to perform a task.

Aside from attempting to remember everything you read in the documentation, you can also perform a simple Google Search for “Cheat Sheets” on the language of your choice.  You will quickly discover that you are not alone when it comes to memorizing keyboard shortcuts and you will be presented with a vast array of options that are best suited for you and your specific IDE.

Increase your productivity and take advantage of all the power at your fingertips.  You will save yourself a tremendous amount of time and effort writing your code and developing your application.  By learning all there is to know about your IDE of choice, you may surprise yourself to see how much time you can save using a simple key combination that you never knew existed.

Until Next Time – STAY lean!

Versalytics - Logo (293x293)Related Content

Advertisements

Lean Code – Part 2

Our article on “Lean Code” strongly suggests that the principles of lean can also be applied to the realm of software development, applications, and more specifically, programming.

Python has evolved to become a very popular and powerful programming language.  However, as mentioned in “Lean Code“, the performance of your application or program is as dependent on the skills of the programmer as they are on the capabilities of the programming language itself.

An example of skill versus language can be found in “Python for Data Science – For Dummies – A Wiley Brand” by John Paul Mueller and Luca Massaron (ISBN:  978-1-118-84418-2).  Page 106 of the book states:

It’s essential to realize that developers built pandas on top of NumPy.  As a result, every task you perform using pandas also goes through NumPy.  To obtain the benefits of pandas, you pay a performance penalty that some testers say is 100 times slower than NumPy for a similar task.

The functionality offered by pandas makes writing code faster and easier for the programmer, however, the performance trade-off exists for the end user.  Knowing when to use one module over the other depends on the programmer’s understanding of the language as opposed to simply providing a specific functionality.

Python for Data Science provides sufficient information to decide the best fit case for either pandas or NumPy.  The relevance of sharing this is to stress the importance of continually reading, learning, and understanding as much as possible about your language of choice for a given application.

From the end user’s perspective, performance matters and everyone wants it “yesterday”.  So, the question is, “Do we code quickly and sacrifice performance or sacrifice delivery for quick code?  What would you do?

Until Next Time – STAY lean!

Versalytics - Logo (293x293)

Related Articles / Books:

 

Pro SQL Server Relational Database Design and Implementation

My copy of the book “ProSQL Server Relational Database Design and Implementation , 5th Edition” by Louis Davidson with Jessica Moss arrived this week.  I’m excited to work my way through it.

A well designed database will significantly increase the performance of your database and greatly improve your ability to write efficient and effective SQL queries.  From a lean perspective, an effective database design is equivalent to “quality at the source”.  Your ability to work with your data is inextricably intertwined with the design of the database itself.

Improving a car’s performance begins with the very engine that drives it.  The same is true for your database.  At 14 chapters and 791 pages, the content of the book is thorough and logical, covering the latest features and enhancements to SQL Server 2016.

Although many developers are inclined to control database activities from the client side “front end”, greater performance can be achieved on the server side.  SQL Server 2016 is a powerful relational database management system where the greatest benefits are reaped by implementing a well designed relational database.

For more information or to purchase your copy, just click on the link below!

Pro SQL Server Relational Database Design and Implementation – Fifth Edition – Louis Davidson with Jessica Moss, Apress

GUI’s, wxPack, and wxWidgets

The official wxPython logo
The official wxPython logo (Photo credit: Wikipedia)

wxWidgets and GUI’s

In our post “Where’s the Graphics? Learning from our Roots (Tcl / Tk)” we focused on Tcl/Tk as a primary GUI development language.  We also mentioned QT as a viable alternative.  QT provides a more powerful GUI development API when compared to Tcl/Tk, however, the licensing schema for QT is also more complex.

To paraphrase the description from the wxWidgets website, wxWidgets is a C++ library that includes bindings for C++, Python and other languages to create cross-platform applications for Windows, Mac OS X, Linux, and more.

wxWidgets is available free of charge and offers a comprehensive collection of widgets that make it ideally suited for advanced GUI intensive applications. By using the native platform API, wxWidgets provides a native look and feel to your applications.

The latest version of wxWidgets is 3.0.2 as announced in the latest news release dated October 6, 2014.

wxPack

Thanks to wxPack, we’ve expanded our list of cross-platform GUI’s to include wxWidgets.  wxPack greatly simplifies the task of installing and setting up wxWidgets on your machine.  wxPack is a full wxWidgets Development Kit, complete with wxWidgets source and binaries, wxFormBuilder (RAD Tool), and more.  Without wxPack, installing wxWidgets is a task best left to more seasoned developers.

wxFormBuilder

From a development perspective, wxFormBuilder is the tool that ultimately caught our attention.  More specifically, wxFormBuilder offers the following features that are ideally suited to our language base and development environments:

  • Visual design of wxWidgets dialogs, frames, panels, toolbars and menubars
  • Source code generation for C++, Python, PHP, Lua and XRC
  • Support for wxWidgets 3.0 widgets (wxRibbonBar, wxPropertyGrid, wxDataViewCtrl, …)
Python and Qt
Python and Qt (Photo credit: Wikipedia)

Selecting Your GUI Tool Kit

The wealth of information available to learn and implement Qt suggests it is one of the better supported GUI tool kits in general. TKinter (Tcl/Tk) is also well supported due to it’s inclusion with the standard Python distribution.  Regardless of the tool kit chosen, the initial learning curve can be rather steep for more complex applications.  The number of widgets and options available with each package only add to the challenge of which package to choose.

Keeping it Lean

Too many options can make for more complicated interfaces than are necessary to meet the needs of the application and it’s end users.  For Python, TKinter provides a minimal widget set that serves the majority of our requirements.  That it’s already included with the standard Python distribution makes TKinter an even more convenient and attractive option.

There are times where a higher level of complexity and sophistication is necessary.  Of course, to learn every GUI kit available isn’t an option available to everyone.  The wealth of information and code samples available for QT make it a highly regarded option.

wxWidgets may just be the Goldilocks solution, falling somewhere between simplicity and sophistication where the tools available make it “just right” to get the job done.  A quick review of the wxWidgets Class List suggests there are more than enough features to develop a robust GUI for your application.

Ultimately, the right choice is the tool kit that is both effective and efficient for the given application.  Simplicity serves the purpose best especially during rapid development cycles and iterations.

Your feedback matters

If you have any comments, questions, or topics you would like us to address, please feel free to leave your comment in the space below or email us at feedback@leanexecution.ca or feedback@versalytics.com.  We look forward to hearing from you and thank you for visiting.

Until Next Time – STAY lean

Vergence Analytics

ActiveState Tcl 8.6.2.0

Tkinter demo: many widgets
Tkinter demo: many widgets (Photo Leancredit: Wikipedia)

It’s hard to believe that one day after we published “Where’s the Graphics?” ActiveState released Tcl 8.6.2.0.  Though the link to the download page remains the same, we updated the context of our post to reflect the latest version number.

Visit the ActiveState Tcl 8.6 page for more detailed information.  ActiveState’s ActiveTcl Community Edition is a free, ready-to-install distribution for Windows, Linux, and Max OSx.

Though other GUI options exist, Tcl/Tk is a proven technology that has persisted for more than 25 years.  The latest release offers features that continue to keep Tcl/Tk relevant and at the top of our GUI toolkit.

In addition to the numerous resources listed in our “Where’s the Graphics” post, a wealth of information can also be found at wiki.tcl.tk.

Your feedback matters

If you have any comments, questions, or topics you would like us to address, please feel free to leave your comment in the space below or email us at feedback@leanexecution.ca or feedback@versalytics.com.  We look forward to hearing from you and thank you for visiting.

Until Next Time – STAY lean

Vergence Analytics

Where’s the Graphics? Learning from our Roots (Tcl / Tk)

Tkinter demo: many widgets
Tkinter demo: many widgets (Photo Leancredit: Wikipedia)

One of our “side bar” challenges is developing software solutions (applications) for our clients.  Simple or complex, they all have one element in common, a Graphical User Interface or GUI.

Imagine the surprise and disappointment on the faces of many beginning programmers and developers when they discover that powerful languages like Assembler, C, C++, and even Python start by teaching you how to write software from the command prompt!

We’ve been there too!  When we decided to learn Python – a powerful, high-level, dynamic interpreted scripting language that is quickly becoming the language of choice for new developers – we were just as surprised to be writing and running programs from the command line (C:\).  Even Python’s Interactive Development Environment (IDLE) uses a “prompt” driven interface.

Basic Fundamentals

Our journey with Python originated with our interest in learning C++.  When we discovered that Python is written in C++, we were curious to see how C++ could be used to create an even more powerful dynamic language.

Learning a language and creating a GUI are related but they are not necessarily the same.  Developing an application requires a solid understanding of the core language itself including its capabilities and constraints.  A GUI “simply” serves as a means of interacting with the core application without concern for how the program actually functions or performs internally.

By way of analogy, driving a car does not require us to understand the intricate functions of the engine and powertrain.  As drivers, we use a key to turn the engine on or off, a gear selector, the accelerator and brake pedals, and the  instrument panel – all of which are the equivalent of a GUI in terms of function – to control and monitor the vehicle.  As developers, however, we are more concerned with ensuring that the engine and powertrain function as expected.  In other words, the GUI can wait but it should still be a consideration during the development process.

Where’s the Graphics?

The result
The result (Photo credit: Wikipedia)

Is writing applications with a nice, clean, graphical interface a mystery that only professional programmers can master?  This answer may surprise you.  Anyone can create a GUI and there is yet another language for doing just that:  Tcl/Tkinter. Tcl is a general purpose scripting language developed by John Ousterhout in 1988 and was designed to enable communication between applications.   Tkinter is a cross platform toolkit that provides a variety of widgets for building GUI’s in many languages.

Most introductory books on Python are concerned with teaching the core fundamentals of the Python language itself, though some may provide a brief introduction to Tkinter.  It is significant that Tkinter is included as part of the Python distributions that are freely available for download from the Python.org website.  Including Tkinter in the Python distribution enables the development of simple to complex GUI’s for your application.

Back to the Beginning

Although other packages such as wxWidgets and PyQt are available, that Tkinter is included in the standard Python distribution makes it much easier to integrate and explore.

To fully understand the Tcl/Tk programming language, we decided to search for more information.  We discovered an excellent Tcl/Tk Tutorial at TutorialsPoint.com where we are served with a wealth of information for both Tcl and Tk.  This is certainly enough to whet your appetite for more.

The TutorialsPoint Tcl/Tk  Tutorial describes several features of Tcl and this is one that caught our attention:

 “You can easily extend existing applications with Tcl. Also, it is possible to include Tcl in C, C++ or Java to Tcl or vice versa.”

What seems like an overly extended tangent from our original pursuit of C++ has become a worthwhile journey.  One of our greatest frustrations while learning C (and C++) was the lack of information for developing a graphical interface for our applications.  It looks like we may have discovered something that will help us along the way for a variety of languages.

Tcl/Tkinter Resources:

If you are using an Apple computer, Tk and Python are already installed on your system as part of the OSx.  The versions installed depend on the version of OSx you are running on your computer.

We recommend visiting SourceForge.net and searching for the term “Tcl/Tk”, without the quotes, using the site’s search box.  You will be presented with the latest version of Tcl (8.6.2) and variety of other related tools including several Tcl extension packages and IDE’s.

To get the latest copy of ActiveState‘s version (8.6.2.0) of Tcl/Tk for your system (Windows, Linux, Mac OSx) visit the ActiveState.com download page.  The community version is free and will be more than sufficient to get you started.  Click here to see some interesting code snippets or “recipes” on the ActiveState site that demonstrate some of the key features of Tcl/Tk.

We already suggested that TutorialsPoint offers an excellent introduction to Tcl/Tk Programming, however, we have also discovered several books that are worth mentioning to get you started:

Python and Tkinter GUI:

Python and Other GUI’s:

C++ and Qt:

English: Screenshot Qt Designer Русский: Скрин...
English: Screenshot Qt Designer Русский: Скриншот Qt Designer (Photo credit: Wikipedia)

While some are comfortable to accept the tools at face value, we found it helpful to delve into the core of Tkinter and Tcl to fully appreciate and understand the underlying language and tools that are available to us.

Finally

As Operating Systems continue to compete for market share, it is good to know that we have cross platform GUI options that will allow us to write applications that will work on all of them.  To this end, we’re less concerned about “who wins” and more concerned about writing efficient and effective applications for our clients.

Your feedback matters

If you have any comments, questions, or topics you would like us to address, please feel free to leave your comment in the space below or email us at feedback@leanexecution.ca or feedback@versalytics.com.  We look forward to hearing from you and thank you for visiting.

Until Next Time – STAY lean

Vergence Analytics

Teaching with Analogies

Over the past few weeks we’ve been taking on the challenge of learning C++. We’ve made our way through the first of 7 books in the C++ All-In-One For Dummies 2nd Edition, by John Paul Mueller and Jeff Cogswell, and we’re working our way through chapter 6 of Sams Teach Yourself C++ in One Hour a Day Seventh Edition by Siddhartha Rao.

Analogies

We’re going through both books at the same time and it’s fair to say that the approach for creating a foundation of knowledge on which to build is unique to each of them. Both books make heavy use of analogies to explain and build on the concepts as a means to create a form of intuitive instruction.

Remember Goldilocks

Both books assume little or no prior programming experience so establishing a base line from scratch is clearly a challenge, especially when there is no way for printed copy to determine our level of comprehension. C++ All-In-One For Dummies tends to offer too much explanation for even the simplest of concepts – almost to the point of creating confusion.

C++, like C, allows comments to be inserted throughout the code to help the developer and others understand the code in real English. I question why the authors of C++ All-In-One For Dummies chose to formally introduce comments in Chapter 8: Using Advanced C++ Features. Introducing comments earlier in the book would’ve allowed the authors to use comments to explain the code as part of the program listings rather than resorting to a drawn out line by line explanation in the text.

The presentation of material in Sams Teach Yourself C++ in One Hour a Day tends to be more thorough and the progression of topics from one chapter to the next is not as aggressive. Though analogies are used, the introduction of concepts is seemingly more structured – concepts are followed by relevant program listings and analysis. Each chapter concludes with a Summary, Q&A, and a Workshop comprised of a quiz and exercises to reinforce the concepts presented.

Goldilocks reminds us that we should present content that is “just right” – not too much, not too little – and in the right context. Suffice it to say that analogies are an effective tool for teaching abstract concepts, especially when it comes to learning a new language.

Your feedback matters

If you have any comments, questions, or topics you would like us to address, please feel free to leave your comment in the space below or email us at feedback@leanexecution.ca or feedback@versalytics.com.  We look forward to hearing from you and thank you for visiting.

Until Next Time – STAY lean

Versalytics Analytics