Posts

Never been promoted? You’re not alone.

I was chatting with some other women in tech about career paths and especially promotions. Most have said they had to change jobs/companies for a title bump. What about you? For Women Devs Only: Have you ever gotten a promotion (or title bump) at the company where you worked? — Jenn Strater (@codeJENNerator) February 7, 2020 At first glance, you might think 54% is ok. After all, a majority of the women surveyed say they’ve been promoted. If you read it again and think about the fact that it says EVER, it’s depressing. Many of the women who said yes have also experienced discrimination in at least one review. So if this keeps happening and you’re thinking maybe it’s just you, it might not be! I’ve been hearing more and more stories from women like myself with 10+ or even 20+ years of tech experience who switch jobs every 2 years because they can’t seem to get promotions any other way. It’s just heart-wrenching and, frankly, bad for business to keep losing employees and paying mor...

7 Things I hope conferences change for 2019 and beyond

As a conference speaker, attendee, organizer for GR8Conf , and developer advocate for an organization that sponsors conferences, I get to see a lot of different sides of tech conferences from small, community-run events to large for-profit companies. No matter the size of the conference, there are some trends I've noticed over the years that I really hope we can change: 1. Stop making excuses for a lack of diversity There are now countless articles on how to make conferences more diverse. Really. Just search for it. Yes, there aren't as many women to speak/attend your event as men, but they do exist so at least make an effort. How much clearer do we need to be with conference organizers? Do not have an all male speaker lineup. It is not complicated. Don’t do it. Work harder to find women speakers. They exist, they are willing & able. There is simply no excuse for an #AllMalePanel #Manel @DianeSmithG https://t.co/eO0wuAgsbh — Dr Kirstin Ferguson (@kirstinfergu...

QuickTip (Spock): Remember to add asserts when creating helper methods in spock tests

This is very similar to my blog post about  using .each in Spock tests . The Problem Having helper methods in a large spec is generally a good practice. For example, we use this pattern a lot is in testing lists of results. def 'test that does some stuff'() { given: String someFieldName = 'someOtherValue' when: List<SomeType> someResults = service.someAction(someParam) then: someResults.each { assertResultContainsAllTheseThings(it) } } . . . private boolean assertResultContainsAllTheseThings(SomeType result) { result.someFieldName == 'someValue' result.someOtherField == 'someOtherThing' result.someList.size() == 3 } I've run into lots of problems with tests not failing when they should have because I forgot to do this. The Solution If you can already tell what's wrong with this code, congrats! If you can't, when copy pasting that original check from the then block into...

The journey to a BMI of 29

Image
If you are only interested in my tech blog, then skip this one. It's a personal story. Back Story A few weeks before I left the US for Denmark in the summer of 2016, I hit the highest weight I've ever been and a BMI of 37.4. I still thought I was pretty healthy though. After all, I was walking 5 miles (8 km) a couple times a week and biking 5 miles (8 km) to/from work once a week. 🤦‍♀️ Although there are no full body pictures from that time, I do have a picture from my first few days in Denmark(red shirt/left). I distinctly remember trying on several outfits that morning and those were the only pair of shorts I had that fit. And by this point, I'd already lost 5 pounds (2.25 kg) during the move. Moving to Denmark and living on a very strict student budget meant making some major changes to my life. I no longer had a car to drive everywhere. I had to walk to/from public transportation. I no longer had money for restaurants and fast food and had to buy my own groc...

Getting Started with Groovy Applications and the Gradle Init Plugin

Image
When working with groovy, there are several ways to get started.  Most tutorials, including my own workshops, use the GroovyConsole as a way to write small scripts and then save them to run later. What comes after that though? How can one build a slightly larger example without all the excess of a framework like Spring Boot or Grails? With this article, I will show you how to use the Gradle init plugin to create a small runnable, testable Groovy application. Before we start you should have a local installation of Gradle 4.0+. If you don't have Gradle installed or your version is less than 4.0, I highly suggest you manage your Gradle installations with  SDKMAN . In a clean directory run the following command:   gradle init --type groovy-application After running that command, you should see several new files. The Gradle files are for building and running the project and your project code will be in the src directory. To start working open the pr...

QuickTip (Spock): Stubbing with null

This is less of a problem and more of a code style thing, but I noticed recently that some of our Spock code has several instances of >> null. For example: ... then: result 1 * service.doSomething() >> new Blah() 1 * service.doSomethingElse() >> null ... It's nice to see that the interactions are written in the same style, but for many methods 1 , Spock returns null by default so writing the >> null is redundant and I prefer to remove it. Do you agree or not? Feel free to comment below. If this is something we agree on, perhaps it should be a new codenarc rule.

QuickTip (Grails): Grails LinkGenerator

The Problem Recently, I was using the Grails Link Generator in a service.  I was using IntelliJ so as I added the dependency at the top of the class using the same name as the class. It looked something like this: package com.example import grails.web.mapping.LinkGenerator class ExampleService { LinkGenerator linkGenerator String doSomething() { ... } } It took me a long time to debug this. Luckily, I had written a test. There was no compilation error, but the test picked up that linkGenerator was null. Of course, I was stumped. I tried checking the mocks in the service and various other debugging strategies but had no luck.  I looked through tons of other examples online until I noticed the one small difference between my code here and theirs... the name! The Solution To make the LinkGenerator work correctly, it needs to be called grailsLinkGenerator exactly. Hopefully, if you come across this post because you made the sa...

QuickTip (Spock): Don't use .each in a then block!!!

This happens time and time again. QA finds a bug and I swear I wrote a test for that condition. So, I go back to try to debug that test.  I see the original test I wrote and the condition that should fail.  It looks something like this: when: List<SomeType> someResults = service.someAction(someParam) then: someResults // assert the result is not null, empty list, etc someResults.each { it.someFieldName == 'someValue' it.someOtherFieldName == 1 } In this case, someOtherFieldName is empty but the test still passes... wtf?! right? Well, this is actually the expected behavior. Because each doesn't actually return anything from the closure but just returns the collection itself, Spock thinks it is fine.  It doesn't care about the lines within the each block and whether they fail or not. So we have a few choices here: use .every (only applies to the last line) when: List<SomeType> someResults = service.someAc...

QuickTip: Reversing Sort Order in Groovy

One of the great things about Groovy is that there are multiple ways to get **it done. This means people learning Groovy and especially those coming from other programming languages can use the same syntax and practices they are already familiar with. However, this may result in some small mistakes or inefficiencies. The first one I want to highlight today is reverse sorting. So given: class Person { String name Integer age } If we want to sort a list of people by their age, we would normally use: people.sort { it.age } To reverse the list, we have several options including: people.sort { it.age }.reverse() or: people.sort { -it.age } The first one, I see a lot. It's easy to write and to think about, but it's not as efficient as the second one. Why sort the list and then reverse it, when you can sort by the criteria you want in the first place? The next problem comes with the '-' notation. It works great for examples like t...

No, It wasn't just about the travel

I haven’t talked about this for various reasons. From the comments I’ve received in the last week, it seems like continuing to hint at what happened rather than talking about it, and embarrassing people(myself included) has actually made the situation worse so here’s a collection of everything that happened from my point of view. The First Blog Post (Early March) So let’s begin with a blog post I published back in March.  The version there right now is not the original.  Originally, I had included a case study based on a conversation from Twitter about the low number of women who were applying at Gradle, Inc. I thought I was helping by showing that it wasn’t just a problem with Gradle, but in the entire community and trying to think of reasons why the numbers might be so low. Within 45 minutes of posting it, I had three different people harassing me via various communication methods about how it might be viewed as an attack on Gradle, Inc.  I had a lot of respect for...

Isn't promoting women through these organizations, preferential hiring, and funding opportunities depriving males of the same opportunities?

Note: I'm publishing this now, even though I wrote most of it over a year ago when I was working on the Diversity 101 series. At the time, I was really burned out. I was struggling with issues at work and in the community, and the feedback I got from some of my readers was that they felt there was nothing they could do to help improve the conditions since they weren't doing anything wrong and every time I brought up the numbers, it was just depressing. The sentiment is still true today, but perhaps we can revive the effort and work together to change it. Introduction In short, it shouldn't be. The purpose of diversity organizations isn't to create an unfair advantage but rather for equality. In fact, I get rather annoyed when individuals or articles claim "Girls are better at .. X". I fall outside many of the generalizations about my gender and find that most stereotypes have little to do with that and more to do with personality traits or confounding v...

Women in Groovy Open Source Projects

Image
After many recent announcements about the abuse of women at different companies in our industry, I saw a thread on Twitter about encouraging and supporting women in tech.  There was one aspect of a tweet though that got me thinking about the percentage of women applicants at several companies who use Groovy and related technologies.  My first thought was that maybe it was a lack of applications in general or perhaps even an HR screening problem so I started to look for how many women might apply for a job based on prior knowledge and contributions to open source projects. For each project, I looked through the list of top contributors on Github. As I searched through the list, I saw a depressing pattern.  My prior work with company data shows that only about 5% of Groovy developers are women. That number is consistent with conference attendance at Groovy conferences. I also know that when we look at other programming language communities, we typically see an even ...

Using Spring REST docs to document a public API

Image
During my talks last year about Spring REST docs, I was frequently asked if I could use Spring REST docs to document other APIs. I always thought it was possible, but now I have a working example.  I was able to configure RestAssured to poll a public demo API,  JSON Placeholder, and use those snippets to form API docs. The demo repository is available at  https://github.com/jlstrater/spring-boot-restdocs-public-api-example , and the docs are published at  https://jlstrater.github.io/spring-restdocs-public-api-example The rest of the example is similar to any other Spring REST Docs example, but the configuration is slightly different: Figure 1: RestAssured Configuration In figure 1, the third line specifies the URL to run against.  This will also affect the generated snippets as seen in Figure 2. This shows how it will use the real address instead of localhost like it would for a local example. Figure 2: Example Snippet with JSON Placeholder Addres...