Author: way0utwest

  • The Balanced Technical Manager

    I find there to be a lot of value in actively managing your career. This is part of a series of editorials based on advice I’ve read from Raylene Yung (Facebook and Stripe) on your engineering career.

    In the last few years I’ve started to see a number of organizations find ways to build technical career growth paths that don’t require someone to become a manager. A lot of technical people don’t want to manage others, and I’d argue that making the best technical person the lead or manager isn’t often the best decision. Those are two different skill sets and success in one doesn’t predict success in the other.

    There are technical people who would like to move into management. If you are one of those people, then you ought to tackle building skills in that area just as you might tackle learning Power BI, SQL window functions, or any other skill.

    Management requires a few different skills. Project management is important, as you will often be balancing a variety of work tasks for your direct reports. Another set of skills is people skills: leadership, listening, evaluating, and having hard conversations, none of which are easy.

    Part of the advice for technical people wanting to be managers is that you have to work on your emotional equilibrium, as the way your job works as a manager is different from that of an engineer. Your view of success, happiness, and your emotional takeaway from daily work is different. You also have to view the workings of your team at a higher level, understanding that your focus and goals can be slightly different than those of your engineers.

    I think you also have to learn to make hard decisions on what to prioritize or how to distribute your staff among the competing demands you face. Learning to make decisions and move forward, as well as apologize and change course when you realize you’ve made a mistake is something relatively few people do well.

    It’s also important to recognize that as your team grows, something will always be wrong. In any size organization, you’ll have a birthday every month and likely some sort of illness or other negative action. Have a large enough organization and someone will die on a regular basis. Keeping yourself balanced when something is always wrong (and something is always right) can be a challenge.

    Having done these jobs, I do think that one way to test the waters is to ask to lead a team on a small project. Getting a feel for balancing work, and learning that management is work that needs to be done differently, can help you decide if you want to go down this path. It’s not for everyone, but becoming a manager can be a good career path, though not necessarily easier than writing code or managing infrastructure.

    If you want to consider this path, ask others for advice, read books, and learn like you would if someone assigned you a new technology. I’ve enjoyed my time in some companies as a manager, and if I hadn’t been looking to move earlier in my career, I might still be running the technology organization at a previous company. It was one job I really enjoyed.

    Steve Jones

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

  • A New Word: Nighthawk

    nighthawk – n. a recurring thought that only seems to strike you late at night – an overdue task, a nagging guilt, a looming future – which you sometimes manage to forget for weeks, only to feel it land on your shoulder once again, quietly building a nest.

    I am typically not a night person. I tend to fall asleep early (avoiding late night movies or events) and I can often sleep through the night. I tend to awaken a bit more as I age, but in general I’m not plagued by any sort of insomnia and am not awake at night.

    Not often.

    However, I often to have various commitments coming, lots of travel, and a chaotic life. Often I find myself reviewing a mental to-do list, worrying that I’ve forgotten something or I didn’t complete a task. I do have a physical list, but often there are so many repeating items that I don’t always write them down.

    This usually comes before I speak at some event, and I find myself waking and worrying at night that I didn’t get something done before my presentation the next day.

    Interestingly, I almost never think about forgetting to schedule a newsletter. I do that sometimes, but rarely.

    From the Dictionary of Obscure Sorrows

  • SQL Prompt Tips–Using $surroundtext$ in a Snippet

    A user on the SQL Community Slack was asking about what the $surroundtext$ variable. This post looks at how this can be used in snippets.

    This is part of a series of posts on SQL Prompt. You can see all my posts on SQL Prompt under that tag.

    A Scenario

    I find that I want to convert some inline SQL to a stored procedure. We have a lot of code in an application that looks like this:

    SELECT 
         SUM(sod.OrderQty) OVER(ORDER BY sod.SalesOrderID, sod.ProductID) AS Total
      FROM Sales.SalesOrderDetail AS sod
      WHERE sod.ProductID = <somevalue>

    The application replaces <somevalue> with an actual value and runs this code. This potentially is a SQL Injection vector, but this also isn’t easily tuned on the server, and can get copied and pasted into different places in the code. It would be better to have this as a stored procedure.

    Make the Conversion Easy

    To make this a stored procedure, I would want this query to look like this:

    CREATE PROCEDURE dbo.GetGroupedSales
         @Id INT
    AS
    BEGIN
    SELECT 
         SUM(sod.OrderQty) OVER(ORDER BY sod.SalesOrderID, sod.ProductID) AS Total
      FROM Sales.SalesOrderDetail AS sod
      WHERE sod.ProductID = @id
    
    END

    I can create a snippet that looks like the skeleton of a stored procedure with this code:

    create procedure $procname$
    $param1$ $paramdt$
    as
    begin
    $SELECTEDTEXT$
    end
    go

    I’ve got a screenshot of this below, showing some default values for the various parameters. This makes it easy for me to build a proc. However, there is one variable that isn’t in the list: $SELECTEDTEXT$.

    This variable will take any text that is selected in SSMS (or VS) and put it inside of the snippet in that location specified.  That will help us wrap our query with the other code in the snippet.

    Here is my snippet:

    2023-11-10 14_17_05-SQL Prompt - Edit Snippet

    Using the Snippet

    Let’s see this in action. In SSMS, I have highlighted my query.Notice the little Prompt popup near the cursor.

    2023-11-10 14_23_22-SQLQuery2.sql - ARISTOTLE_SQL2022.AdventureWorks2017 (ARISTOTLE_Steve (71))_ - M

    When I see this, I can hit the CTRL key and I’ll get a drop down list. I will type “mp” which is my snippet code.

    2023-11-10 14_23_29-SQLQuery2.sql - ARISTOTLE_SQL2022.AdventureWorks2017 (ARISTOTLE_Steve (71))_ - M

    This finds my snippet. I can hit Tab and my snippet is inserted, with my default variable values and also the text I selected in the place where $SELECTEDTEXT$ was in the snippet.

    2023-11-10 14_23_58-SQLQuery2.sql - ARISTOTLE_SQL2022.AdventureWorks2017 (ARISTOTLE_Steve (71))_ - M

    Now like any other snippet, I can tab between the variables and change them. When I’m done, I hit Enter and I have my code.

    Now I just need to save this in version control and deploy it to my production system.

    If you haven’t tried SQL Prompt, download the eval and give it a try. I think you’ll find this is one of the best tools to increase your productivity writing SQL.

    Video Walkthrough

    I made a video of using $surroundtext$ that you can watch. All my SQL Prompt tips are in this playlist.

     

  • A Lack of Privacy in Smart Cars

    I own a Tesla, and I love having a bunch of data about my usage of the car. I can see how much I’ve charged it, what it costs to power, where I drive, aggregates of my monthly usage, and more. It’s especially cool when my wife is coming to pick me up, and I can see where the car is, so I know when to go outside if the weather isn’t great. I also like the ability to cool or heat the car in advance of going outside in extreme temperatures.

    However, all that data also means there are potential issues with privacy and certainly security. I am well aware that location and other data are being captured by Tesla as I use the car. However, it’s not just Tesla. Lots of modern cars are collecting lots of data. Mozilla had a report on data privacy in cars, and all the manufacturers failed their data privacy test. There’s also a summary at Engadget of the results.

    Reading through the report, it seems that many of the manufacturers of cars are covering themselves from liability. Cars are sold and used in many jurisdictions and often there can be a wide variety of regulations about data, even inside of a single country. It seems that the policies are often written just in case something happens and they collect data from your use of the car (or they record you using the car).

    A point I hadn’t considered in the article dealt with the deletion of data when a car is sold. That could get tricky as not only is your usage data in the car, some data might potentially be in a manufacturer’s database. Or it might be stored in devices at a service center. Who knows what gets stored and copied in modern cars as they are serviced. Will we potentially have issues with mechanics or other workers stealing and selling data from entertainment or other information systems in cars? The possibilities make my head hurt in this modern world where everything can, and often does, collect data.

    I don’t know what data is stored inside modern vehicles or other systems. In some sense, I think that companies ought to disclose what they collect, and include examples of what this data looks like. Even when I read policies, like this one from Microsoft, I’m not completely sure if I know what data they may be collecting.

    The world of data privacy is complex, and as I’ve written before, I’m not even sure exactly how I would like my data handled. I think the GDPR is a good start, but I hope that we continue to evolve protections that ensure humans have more control over their data than the companies that collect it.

    Steve Jones

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