Category: Editorial

  • Coding for the Future

    I posted a note on Twitter about some code. In this case, it was the start of a for loop, but with two things in it that I didn’t like. The code is shown here:

    for ($i = 2011; $i <= 2021; $i++) {

    Both the starting point and the ending condition were problematic for me. This code is used in a scheduling application, to populate a dropdown that I used regularly. It’s always worked, since about 2017 or 2018, and I had no reason to even think about the algorithm. I assumed the code was something like this:

    for ($i = 2011; $i <= year(); $i++) {

    In fact, when I had issues on 27 Dec, I assumed that things were coded to the current year and I’d be able to schedule things on Sunday night when I got home. Instead, things still didn’t work the first few days of 2022 and I had to get someone to come in from holiday to fix the code. Now it looks back a few years (likely unnecessary) and looks forward one year, as it should.

    I don’t know why a developer would bother coding anything like this. Get the need to perhaps test something expediently and limit choices, but hard-coding most anything is a poor idea. There ought to be some logic in how or why you choose values, and that logic often can be expressed in code that adapts to situations. I certainly could have lived with only the current year being available, though that still doesn’t think through the problem space well.

    I’ve seen lots of simple bugs in code over the years that are similar to this one. These often occur because the developers haven’t thought through how code might need to adapt to slightly changing situations. Something like a change in the year, or maybe the addition of a time slot for scheduling or a new location added, even a new tax rate. Often I find developers think they have considered the problem given to them, but a little too tightly. They haven’t thought about how their code might change if the user requesting the feature has made a mistake.

    Writing code that solves a problem and allows for adaptation to likely scenarios is a bit of an art. It can be hard to do, but great developers assume users will need some changes and plan for this in their solution. They also assume users make mistakes in their specifications and they don’t hard code anything.

    Steve Jones

     

    Listen to the podcast at Libsyn, Stitcher, Spotify, or iTunes.

  • Teams Security Issues

    At some point during my career sharing files and links in email became a security concern. There were all sorts of malware problems and issues that spread throughout organizations because someone unknowingly clicked on or forwarded a malicious item. At a couple of large organizations, we had to turn off email for days while we cleaned out systems. Fortunately, antivirus and other types of scanning software improved to prevent most of these problems.

    It seems that not all developers learned the lessons of the past. Microsoft Teams has a few vulnerabilities inside it based on link sharing in the chats. One of the issues is that the preview features aren’t well implemented, though Microsoft security doesn’t think this is a problem as a user would notice the link would be incorrect. I think that’s a huge leap and not a very safe one to make.

    I don’t use Teams often, and as a Slack user, I find it rather confusing, busy, and unintuitive. I know lots of others that like Teams and find it very productive in the Microsoft world, and I’m glad we can have the choice of a way to collaborate with others. However, no matter which type of communication mechanism is used inside of your organization, the security protections ought to be very strong. We are often busy with work and distracted. We are often expecting the information in Slack or Teams to be safer than browsing sites on the public internet. Perhaps that’s not the way things should be, but it is.

    Attack vectors that use code inside a webpage are very common, and I dislike many of the “preview” features that I’ve seen in various pieces of software. They slow down the application, especially on a mobile network, and take up unnecessary space. As someone that often can see bandwidth constraints, I’ve prefer that all of these features were optional. Let me decide if I want a preview.

    The trend to build richer experiences in applications and pre-fetch data can make the experience better, but there is a tradeoff. There are potential security concerns, but apart from those, these features can make the experience more enjoyable or unnecessarily slow things down and interfere with the way we use an application. More isn’t always better, especially when the pattern for an individual user might not match what the majority does. If 51% of users often use a feature, I’m not sure the other 49% view this as a positive way of architecting the system.

    Steve Jones

    Listen to the podcast at Libsyn, Stitcher, Spotify, or iTunes.

  • What Were Your 2021 Wins

    LinkedIn sent me a prompt just before Christmas that asked me to write a post on my 2021 wins, using the #2021wins hashtag. I thought it was a neat idea, and I blogged on this topic before I left for my final vacation. I primarily had work items in there, though a couple of work-related things. To me, while 2021 was disappointing in some ways, it was still a great year for me in many ways, and I’ve tried to keep that in mind. Not focus on things that didn’t go well but those that did.

    It’s the first week of the new year, and many of you are likely starting to look forward at work and in your career. You might have made resolutions, or maybe you are just re-focusing after the holidays. Either way, on this Friday I’d like you to think back to last year, focusing on how your career might have changed throughout the second year of the COVID pandemic.

    What was a career win for you in 2021?

    That’s the question. It could be a change that you made, a skill you learned, a project you completed, maybe an award. Perhaps it was something that happened and you just experienced. Maybe an event or talk that inspired you or changed the outlook on something.

    I’d like to think that all of you had at least one good thing happen in your career last year. Take a minute and share in your win and congratulate others for theirs.

    Steve Jones

    Listen to the podcast at Libsyn, Stitcher, Spotify, or iTunes.

  • Challenging Trends

    I was studying for the DP-900 exam recently and in one of the Microsoft resources, I ran across this quote: “Historical data is equally important, to give a business a more stabilized view of trends in performance.” This was in context of looking at database performance, but it would apply to any part of your business.

    The world has changed dramatically in the last two years. In early 2020, at this point, I was finalizing work and getting ready for a sabbatical from work. I managed to get the last sabbatical before the world shut down and most people didn’t see the value of one during a pandemic. I returned from sabbatical, with a trip planned to the UK in early March that I canceled. Since that time, I can’t imagine the quote above applies to the airlines’ business. I’ve flown a bit across the last year, but rarely for work. I suspect most of their models and ideas about how to manage their business had to dramatically change.

    Is that quote still applicable to your business? I wonder how many businesses have started to see new trends and needed to abandon some amount of historical data from their charts and graphs. If that’s the case, then is it worth archiving some of that data away, rather than needing to keep it in an online database? Do reports need beginning default dates that start sometime after the pandemic affected the world? Interesting questions.

    For most of us, we don’t necessarily worry about a lot of business impacts. We’ll adjust to what the business analysts ask us to do. However, I wonder if the way you approach your job has changed? For DBAs, have you reset your baseline for how the performance of your systems ought to look during normal times?

    For software developers, many of you are working remotely, so how do you approach work and coordination with others, has that changed? Do you need more or less lead time to work with others and get code tested and deployed? I know many developers have found work during the pandemic, especially remote, to be more enjoyable.

    Lots of things in the world changed, but much of our work continues on the same path. Approaching things with the idea of adapting to change, but using the past as a guide is what has worked well for me. I have strong opinions on how I work and live, but I adapt when there’s a need or evidence to support changes.

    Steve Jones

    Listen to the podcast at Libsyn, Stitcher, Spotify, or iTunes.