Author: Richard Seroter

  • I don’t enjoy these 7 software development activities. Thanks to generative AI, I might not have to do them anymore.

    I don’t enjoy these 7 software development activities. Thanks to generative AI, I might not have to do them anymore.

    The world is a better place now that no one pays me to write code. You’re welcome. But I still try to code on a regular basis, and there are a handful of activities I don’t particularly enjoy doing. Most of these relate to the fact that I’m not coding every day, and thus have to waste a lot of time looking up information I’ve forgotten. I’m not alone; the latest StackOverflow developer survey showed that most of us are spending 30 or more minutes a day searching online for answers.

    Generative AI may solve those problems. Whether we’re talking AI-assisted development environments—think GitHub Copilot, Tabnine, Replit, or our upcoming Duet AI for Google Cloud—or chat-based solutions, we now have tools to save us from all the endless lookups for answers.

    Google Bard has gotten good at coding-related activities, and I wanted to see if it could address some of my least-favorite developer activities. I won’t do anything fancy (e.g. multi-shot prompts, super sophisticated prompts) but will try and write smart prompts that give me back great results on the first try. Once I learn to write better prompts, the results will likely be even better!

    #1 – Generate SQL commands

    Virtually any app you build accesses a database. I’ve never been great at writing SQL commands, and end up pulling up a reference when I have to craft a JOIN or even a big INSERT statement. Stop judging me.

    Here’s my prompt:

    I’m a Go developer. Give me a SQL statement that inserts three records into a database named Users. There are columns for userid, username, age, and signupdate.

    The result?

    What if I want another SQL statement that joins the table with another and counts up the records in the related table? I was impressed that Bard could figure it out based on this subsequent prompt:

    How about a join statement between that table and another table called LoginAttempts that has columns for userid, timestamp, and outcome where we want a count of loginattempts per user.

    The result? A good SQL statement that seems correct to me. I love that it also gave me an example resultset to consider.

    I definitely plan on using Bard for help me with SQL queries from now on.

    #2 – Create entity definitions or DTOs

    For anything but the simplest apps, I find myself creating classes to represent the objects used by my app. This isn’t hard work, but it’s tedious at times. I’d rather not plow through a series of getters and setters for private member variables, or setup one or more constructors. Let’s see how Bard does.

    My prompt:

    I’m a Java developer using Spring Boot. Give me a class that defines an object named Employees with fields for employeeid, name, title, location, and managerid.

    The result is a complete object, with a “copy” button (so I can paste this right into my IDE), and even source attribution for where the model found the code.

    What if I wanted a second constructor that only takes in one parameter? Because the chat is ongoing and supports back-and-forth engagement, I could simply ask “Give me the same class, but with a second constructor that only takes in the employeeid” and get:

    This is a time-saver, and I can easily start with this and edit as needed.

    #3 – Bootstrap my frontend pages

    I like using Bootstrap for my frontend layout, but I don’t use it often enough to remember how to configure it the way I want. Bard to the rescue!

    I asked Bard for an HTML page that has a basic Bootstrap style. This is where it’s useful that Bard is internet-connected. It knows the latest version of Bootstrap, whereas other generative chat tools don’t have access to the most recent info.

    My prompt is:

    Write an HTML page that uses the latest version of Bootstrap to center a heading that says “Feedback Form.” Then include a form with inputs for “subject” and “message” to go with a submit button.

    I get back valid HTML and an explanation of what it generated.

    It looked right to me, but I wanted to make sure it wasn’t just a hallucination. I took that code, pasted it into a new HTML file, and opened it up. Yup, looks right.

    I may not use tools like Bard to generate an entirely complex app, but scaffolding the base of something like a web page is a big time-saver.

    #4 – Create declarative definitions for things like Kubernetes deployment YAML

    I have a mental block on remembering the exact structure of configuration files. Maybe I should see a doctor. I can read them fine, but I never remember how to write most of them myself. But in the meantime, I’m stoked that generative AI can make it easier to pump out Kubernetes deployment and service YAML, Dockerfiles, Terraform scripts, and most anything else.

    Let’s say I want some Kubernetes YAML in my life. I provided this prompt:

    Give me Kubernetes deployment and service YAML that deploys two replicas and exposes an HTTP endpoint

    What I got back was a valid pile of YAML.

    And I do like the results also explain a bit about what’s going. on here, including the actual command to apply these YAML files to a cluster.

    Dockerfiles still intimidate me for some reason. I like the idea of describing what I need, and having Bard give me a starter Dockerfile to work with. Full disclosure, I tried getting Bard to generate a valid Dockerfile for a few of my sample GitHub repos, and I couldn’t get a good one.

    But this prompt works well:

    Show me a Dockerfile for a Go application that has the main Go file in a cmd folder, but also uses other folders named web and config.

    The result is a Dockerfile, and it’s well explained in the accompanying text.

    Bard also seems pretty good at giving me Terraform, Java property file configurations, and more. As always, verify the results!

    #5 – Create sample data

    I build a lot of sample apps, which means I need sample data. That might mean input into a REST endpoint, or it could be data for a starter database. Instead of struggling to produce a bunch of fake records, generative AI solutions can give me all the structured data I need.

    In the SQL section above, I generated a SQL insert command that I could use for a database. But I can also generate some seed data for my app.

    For instance, how about this prompt:

    Generate a JavaScript variable holding a JSON array of five baseball players. Pull names from the baseball Hall of Fame. Each record should have an id, name, position, and age.

    I get back valid JSON that I could drop in my Node.js app.

    I can then ask Bard to convert that to XML, CSV, or any number of formats. I might want more records or fewer records. This also works if you ask for your favorite television characters, musicians from the 1990s, or types of potatoes. Generate data without taxing your brain.

    #6 – Explain code I come across in GitHub, blog posts, or StackOverflow

    Do you ever find some interesting code in a blog post or StackOverflow answer but can’t exactly figure out how it works? Happens to me all the time. Instead of going further down the rabbit hole to figure out what each line of code does, I can use generative AI to make some sense of it all.

    For instance, let’s assume I’m terrible at generating random numbers and stumble upon this StackOverflow answer that’s succinct and without any description. I can ask Bard to describe this code in more depth:

    What does this code do? Explain it to me as if I’m new to C#. public string RandomDigits(int length)
    {
    var random = new Random();
    string s = string.Empty;
    for (int i = 0; i < length; i++)
    s = String.Concat(s, random.Next(10).ToString());
    return s;
    }

    What I get back is a written description of each line. And then, helpfully, a restating of the code with comments added before each statement.

    If you’re learning a new language, consider using generative AI to explain code snippets to you. I acknowledge that I’ve had mixed luck pointing Bard at a code file or repo and getting a perfect explanation. I sometimes get hallucinations (e.g. refer to files to methods that don’t exist), but I expect this functionality to get better quickly.

    #7 – Convert code from one language (or version) to another

    Do you ever come across code that shows a useful pattern, but isn’t in the language you’re coding in? Maybe I found that code above to generate a random number, but want the equivalent in Go. Not a big problem any more. A prompt following the above prompt:

    Convert this C# code to Go code instead

    I get back Go code, and a description of what’s different.

    Consider the case where you find code for calling a particular HTTP endpoint, but it’s in Java and your app is written in Go. My colleague Guillaume just wrote up a great post about calling our new Google PaLM LLM API via a Java app. I can ask for all the code in the post to be converted to Go.

    The prompt:

    Can you give me the equivalent Go code for the Java code in this blog post?/ https://glaforge.dev/posts/2023/05/30/getting-started-with-the-palm-api-in-the-java-ecosystem/

    That’s pretty cool. I wasn’t sure that was going to work.

    With all of these examples, it’s still important to verify the results. Generative AI doesn’t absolve you of responsibility as a developer; but it can give you a tremendous head start and save you from wasting tons of time navigating from source to source for answers.

    Any other development activities that you’d like generative AI to assist you with?

  • Daily Reading List – June 23, 2023 (#110)

    Happy Friday! There’s a Google bias to the content today, but I can’t help it if we publish lots of good things at the same time.

    [article] A Comprehensive Guide to Building Event-Driven Architecture on Azure, AWS, and Google Cloud. This is not, in fact, a comprehensive guide, but it is a fairly good look at some of the core tech in each cloud for devs building event-driven apps.

    [blog] 3 Steps to Improve Developer Experience. Smart analysis from my friend Traverse who serves up some advice on getting better at developer experience.

    [blog] Developer experience: What is it and why should you care? Solid overview of what it means to offer a good developer experience.

    [docs] About Spanner Vertex AI integration. We just made this functionality generally available. Call ML prediction models directly from SQL statements in Cloud Spanner. It’s more performant, scalable, and usable when baked into the database process.

    [article] MongoDB integrates with Google Cloud’s Vertex AI models amid flurry of new features. The MongoDB gang made a number of product announcements at their dev conference this week. See here for more, and here too.

    [blog] Friday Forward – Survivorship Bias. This is an easy bias to fall victim to. I’m sure I do all the time. Question the takeaways from “best practices” and “success stories” before mirroring them.

    [blog] Trace exemplars now available in Managed Service for Prometheus. I now know what exemplars are, and why they help you troubleshoot latency issues.

    [blog] What’s new in Assured Workloads: Region expansion, TLS version restrictions, new supported services. Our Assured Workloads capability is a very modern approach to regulation-friendly isolation, without forcing you into a secondary environment.

    ##

    Want to get this update sent to you every day? Subscribe to my RSS feed or subscribe via email below:

  • Daily Reading List – June 22, 2023 (#109)

    Today I came across some solid technical content and a handful of how-tos that you might be interested in. Take a look!

    [blog] Letting our feature flags fly. Nice post from the McDonald’s Engineering team where they explain their need for feature flags in their mobile app, and their architecture for supporting it.

    [repo] grunner – Self hosted GitHub Actions runners on GCP using GCE. GitHub Actions is a popular CI solution, and you can host the main workers outside of GitHub. Here’s an example of hosting these runners on Google Cloud.

    [article] The 5 most essential technologies for enterprises today. There’s no single list of what you should care about, as it’s contextual to your own business. But this list of items represents a reasonable set of concerns for any enterprise.

    [blog] Using Google Cloud from Colab. Millions of devs use Colab to host Jupyter notebooks and experiment with Python. It’s also not too difficult to connect your notebook to Google Cloud to access a range of other services.

    [blog] Generative AI Learning Path Notes — Part 1. Why take the training yourself if you can just glance at the notes of a more studious colleague? Mete published his notes for generative AI coursework, and there’s some good knowledge to pick up.

    [blog] gRPC Service to Service on Cloud Run. I admittedly default to basic REST/HTTP requests when I build components that talk to each other, but really should try using gRPC more often. This post goes into some depth on setting that up.

    [article] Discord Migrates Trillions of Messages from Cassandra to ScyllaDB. Database migrations are no joke, and Discord doing a couple of major ones over these past few years is interesting to me.

    [blog] Go 1.21 Release Candidate. There are some good language fundamentals showing up here, as well as some new Web Assembly support.

    [blog] Analyzing Volatile Memory on a Google Kubernetes Engine Node. The Spotify team use a lot of GKE in production (hundreds of thousands of pods), but how do they look for malicious behavior on a given GKE node? Here’s their approach.

    [article] Treat Your CI System as a Product for Faster and Better Feedback. Dev teams spend a LOT of time waiting for builds and tests to complete. Investing in your CI platform and treating it like a product can have major rewards.

    ##

    Want to get this update sent to you every day? Subscribe to my RSS feed or subscribe via email below:

  • Daily Reading List – June 21, 2023 (#108)

    Some good content on the interwebs today, and some spicy perspectives floating around social media. I don’t put much stock in flame-bait perspectives about “product X was a a huge mistake” or “I can never trust vendor Y”, so you’ll hopefully always see more measured takes in the content I share here each day!

    [article] Businesses are too slow to embrace emerging tech, employees say. Are key technologies out of date by the time they get fully adopted? Many say yes, but it’s a hard problem to solve!

    [blog] Migrating Critical Traffic At Scale with No Downtime — Part 2. Here’s a good post from the Netflix Engineering team that explains some techniques they use to cutover to new systems.

    [article] Google Cloud Launches Anti-Money-Laundering Tool for Banks, Betting on the Power of AI. WSJ article that stood out to me because it talks about moving away from hard-coded rules and more into learning-based platforms.

    [article] Harness Brings Generative AI Capabilities to DevOps Workflows. Like with above, it’s less about the model, and more about the experiences you wrap around it. More.

    [blog] Bringing Transparency to Confidential Computing with SLSA. I think I understand what’s going on here. You’ll likely continue to see SLSA show up in places where artifact security is in play.

    [blog] Experimenting at Scale, the Spotify Home Way. Some advice from the Spotify Engineering team on the topic of running experiments.

    [blog] Exploring WebAssembly outside the browser. Will WebAssembly ever really take off? Maybe if more use cases become mainstream, including those outside the browser.

    [article] Total addressable market: Why it’s important, and how to calculate it. TAM is interesting, but if you use it to justify product development or a GTM plan, you’re cheating. Leverage more realistic numbers like SAM and SOM.

    [article] The five new foundational qualities of effective leadership. Most of these circle around the question of “how do you handle complexity?” From what I’ve observed, being effective at working in complex situations is what separates good leaders from average ones.

    [blog] Estimation Isn’t for Everyone. Check out this post from the tech team at the New York Times and learn about how they think of estimating agile projects.

    ##

    Want to get this update sent to you every day? Subscribe to my RSS feed or subscribe via email below:

  • Daily Reading List – June 20, 2023 (#107)

    I’m back after a restful vacation, and starting to wade through thousands of unread blog posts and articles in my RSS reader. Here are the handful that I consumed today.

    [blog] 5 Helpful Commands for Cloud Workstations. Nate shows off a few ways to spin up and interact with cloud-based dev environments. I suspect this will be increasingly useful for those using throwaway dev environments to quickly experiment with new technologies.

    [blog] What is platform engineering? Good post from Donnie that offers a practical take on platform engineering, why it matters, and how it works.

    [article] Reports of OpenStack’s Death Greatly Exaggerated. It feels like OpenStack peaked 7 or 8 years ago, but it’s plugging along and seems to have found it’s niche.

    [blog] 2022 State of DevOps Report data deep dive: Documentation is like sunshine. What’s one predictor of good (technical) org performance? From this data, it seems like if you simply show me your docs and doc processes, I can tell if you’re good at software delivery.

    [blog] Introduction to Firebase in .NET. .NET devs can have fun too! This post walks through using the Firebase platform and Firestore databases for .NET apps.

    [blog] Proven Practices for Developing a Multicloud Strategy. Solid post from our friends at AWS. I agree with everything Tom says here.

    [youtube-video] How Google Cloud reached 1 million subs. Fun video from our team that looks at the effort to earn one million subscribers to our YouTube channel.

    [blog] Version after version; how the open source project Kubernetes releases its software. With thousands of contributors and many components, how does Kubernetes ship software? This post goes into good depth.

    [blog] ​Change Fatigue In Digital Transformation: Where Has All The Value Gone? If you’re team is worn out from changes, maybe it’s not because of the effort, but because of mismatched rewards?

    [blog] Cloud CISO Perspectives: Early June 2023. Here’s another strong roundup of security + cloud news.

    [article] Kelsey Hightower Predicts How the Kubernetes Community Will Evolve. I’m always happy to hear thoughts from Kelsey, and this article doesn’t disappoint.

    ##

    Want to get this update sent to you every day? Subscribe to my RSS feed or subscribe via email below:

  • Daily Reading List – June 8, 2023 (#106)

    Tomorrow I’m heading off on vacation for a full week of no news, email, chats, or work-related things. Scary! The next issue of this daily reading list will come on June 20th. Read slowly until then!

    [blog] The Modernization Imperative: Shifting left is for suckers. Shift down instead. New from me! We need to find ways to stop shoving more onto developers’ plates in the name of “shifting left.”

    [article] Build a Strong Learning Culture on Your Team. Your team or company success won’t be dependent on adopting a particular technology or product. It’ll likely be solely based on how well—and how quickly—your team learns and adapts to things around them.

    [blog] Ten ways troubleshooting GKE apps is now easier in Cloud Logging, part 1. Application logs are a powerful part of your troubleshooting toolbox, but sifting through piles of data isn’t a ton of fun. I like these updates to our Cloud Logging experience.

    [blog] Crash Course on Go Generics. Good look at how to use this relatively new feature of the Go language.

    [article] Google’s Bard AI is getting better at programming. Yes, yes it is. Math too. The rate of improvement to our models and experiences is remarkable. Fun times.

    [article] Building StarCoder, an Open Source LLM Alternative. This model caught some attention, and I learned a few things by reading this.

    [blog] Document AI: Understanding invoices to passports and beyond. All these underlying AI models are amazing, but what matters is the interfaces into them. Here’s a look at modern document processing.

    [article] CIOs torn between innovation and optimization. It’s a polarity more than a “this or that” choice, but I’m sure it’s difficult right now to balance the need for both.

    [blog] Introducing Google’s Secure AI Framework. Very interesting! We’re kicking off this new framework and offer up some tangible next steps.

    [article] How New CEOs Establish Legitimacy. Very good advice for any leader coming into a team and trying to establish themselves.

    [blog] How to keep your new tool from gathering dust. How many things do you have in your house that you bought with great expectations, and then did … nothing? It happens at work too. This post has useful advice for not letting your new purchase gather dust.

    ##

    Want to get this update sent to you every day? Subscribe to my RSS feed or subscribe via email below:

  • Daily Reading List – June 7, 2023 (#105)

    I found some high quality reading material today, and I hope you take a few moments to flip through each of these and pull out a nugget or two.

    [article] Can DevEx Metrics Drive Developer Productivity? Here’s a good look at measuring dev productivity, and what goes into that effort.

    [article] Google Cloud and Salesforce team up to bolster AI offerings. I like integrations such as this. Make it easier to connect your center of data gravity (e.g. Salesforce) with premium analytics and AI services.

    [blog] Generative AI support on Vertex AI is now generally available. New foundation models and new tools ready to go. I’m excited to see how folks extend and use these in their own products and applications. Related news story, and great overview video of Model Garden here.

    [article] Do you know where your APIs are? Do you have zombie APIs floating around? Probably?

    [article] Debugging Outside Your Comfort Zone: Diving Beneath a Trusted Abstraction. This is an important skill, as there are many times where you have to understand what’s hidden by an abstraction.

    [blog] Return to the Code. Some skills come back to us after we re-engage them. Brian explains his journey to dusting off his coding skills. So much changes so quickly that even when you get back into coding, there are entirely new paradigms to learn.

    [blog] Finding The Best Go Project Structure – Part 1. Go developers don’t all use a single way to structure projects. I’ve seen many different recommendations. This post, and part 2, look at one approach.

    [blog] Introducing Remote Config real-time updates. Update model apps in real-time without forcing an app re-download? Some cool stuff here for Firebase.

    [article] Report Surfaces DevOps Challenges for Mobile Applications. I don’t know if it’s because of tooling, app characteristics, or something else, but mobile teams are not doing automated releases.

    [blog] Why I prefer trunk-based development. Should you work off a single main branch, or support individual branches for features, bugs, and so on? Trisha makes the case for the former in this detailed post.

    ##

    Want to get this update sent to you every day? Subscribe to my RSS feed or subscribe via email below:

  • Daily Reading List – June 6, 2023 (#104)

    I’ve got a vacation coming up starting Friday and will go offline for a week, but there’s still too much going on to think about it much yet. Until then, here are some great reads I came across today.

    [blog] Why Chatbots Are Not the Future. The chat interface helped many of us see AI as more approachable and practical. But I doubt most of us want to do all our work by chatting with a robot. There’s something better.

    [blog] Local testing Spring + GCP Firestore. Emulators are good for local dev and testing. This post shows off the local Firestore database emulator that Java devs can use.

    [article] What’s missing in your cloud optimization projects. If you’re a heavy cloud user, I’d be somewhat surprised if you didn’t apply all of these approaches. But a good reminder nonetheless.

    [blog] How to easily migrate your on-premises firewall rules to Cloud Firewall policies. Our cloud firewall protects resources, not the cloud perimeter. Make sure you evolve your firewall approach as you move to the cloud.

    [article] AI Prompt Engineering Isn’t the Future. The point here is to get better at problem formulation versus over-investing in how to ask questions to robots.

    [blog] Announcing the General Availability of Synadia Control Plane. NATS is a popular, lightweight open source product that makes it easier for distributed services to find and communicate with each other. Synadia is the sponsoring company, and has a new control plane product that looks pretty cool.

    [blog] Gotchas of Streaming Pipelines: Profiling & Performance Improvements. This is from Lyft’s Engineering team. Even if you don’t use Beam, Flink, and such, you’ll likely get some ideas about where to explore performance issues in your data pipeline architecture.

    [blog] Predict, personalize, and wow your customers with better analytics and AI. Looks like people really dig personalized online experienced. Even in financial services.

    [blog] AI software buyers more bullish on tech spend: report. Buyers looking for AI, which means vendors are going to give it to them.

    ##

    Want to get this update sent to you every day? Subscribe to my RSS feed or subscribe via email below:

  • Daily Reading List – June 5, 2023 (#103)

    Did you have a good weekend? I was able to get some sunshine and enjoy family time. Back to work today, and I came across some very good content that you’ll enjoy.

    [blog] Monoliths, Microservervices and Mainframes – Reflections on Amazon Prime Video’s Monolith Move. I love posts like this. Ian casts some skepticism on microservices and looks at the “benefits” of serverless that didn’t seem to play out for Amazon. It’s that constant reminder to not do something just because others are; do what honestly makes sense for your situation.

    [article] How to Take Better Breaks at Work, According to Research. Were you good about office breaks, but the work-from-home shift messed up your routine? Or are you terrific about taking a breather, regardless of where you’re working? Good article about being thoughtful about it.

    [blog] Announcing Dataform in GA: Develop, version control, and deploy SQL pipelines in BigQuery. I need to explore this service more deeply, as it seems like a simpler way to move and transform data that you want to use in the data warehouse. The unique thing here is that these are SQL-defined pipelines, and it all runs in BigQuery.

    [article] WordPress.com challenges Substack with launch of paid newsletters. I noticed this option last week when publishing this daily post. I can’t see ever charging folks for reading my nonsense, but it’s good to know that creators have an option on WordPress.

    [blog] Are you fluent in prompts and embeddings? Here’s a generative AI primer for busy executives. This is similar to something I shared last week, but this glossary is more oriented towards execs and leaders trying to catch up in this space.

    article] You’re Not Powerless in the Face of Imposter Syndrome. If you don’t feel some sense of imposter syndrome on a regular basis, that might be a problem. This post offers guidance to underrepresented folks, and can apply to everyone else as well.

    [blog] Kotlin vs Java: Which Language is Right for You? A lot of Googlers use Kotlin, so I like learning about how it differs from Java.

    [blog] AI-washing is taking over humanity… It takes extra effort to sift through the noise to find the signal on AI. I hope I’m helping, and not hurting!

    [article] Cloud-based generative AI won’t be cheap. Relatedly, be careful about spreading around your investments. You might want to go big with those who can help you use AI to do useful things.

    ##

    Want to get this update sent to you every day? Subscribe to my RSS feed or subscribe via email below:

  • Daily Reading List – June 2, 2023 (#102)

    Light reading day, but still a few things you should check out below.

    [blog] Friday Forward – They Say. It definitely seems easier to blame “them” or “the company” or “other people” than actually being specific about your opinion or what happened. Good article on owning the POV versus generically outsourcing it.

    [blog] Deploy multi-region application with Anthos and Google cloud Spanner. Good look at the architecture needed to have Kubernetes clusters in multiple regions accessing a multi-region database, with global ingress.

    [blog] A guide to Generative AI terminology. Reading this will help you decipher all the latest AI chatter.

    [article] Effective Test Automation Approaches for Modern CI/CD Pipelines. It’s easy to assume that topics like test automation and automated deployments are boring and mainstream. But when survey show that few companies are really doing this well today, it’s important to keep learning about it!

    [blog] Easily Implementing HTML Form with Google Spreadsheet as Database using Google Apps Script. Creative idea, that’s for sure. But do think carefully before using a spreadsheet as your backend database.

    [article] LangChain: The Trendiest Web Framework of 2023, Thanks to AI. Since “chat” is apparently the key interface for AI, frameworks that make it easier to build chatbots will be hot.

    ##

    Want to get this update sent to you every day? Subscribe to my RSS feed or subscribe via email below: