Bingo! It's Monday, 12 o'clock rock. I'm Jay Fiedel. Happy to be here on Think Tech. And we have Mina Marco and me on Monday. That's our show. And the co-host here in the studio is Mina Morita, and the co-host who joins us by Skype Audio from what? Kona? Hilo. This is Marco Mangostore for Provision Solar. We're all together and we have Shelley Kimura and we have Commissioner Lorraine Akiba. This is a big show. That's why we're giving it 45 minutes today. Exciting, all right? So, and we're calling it Women in Power. Yay! It's that double entendre, you know? We're going to explore that. Yes. Okay, I'm going to turn it over to Marco now and he's going to introduce our three guests. Well, I want to tell you all sincerely how appreciative I am and thankful for being able to get the five of us together. And I'm so thrilled to have three of my good friends, four of my good friends and energy there to be able to sit down before you. So, thank you all so much for joining Jay and I and Mina today. And it is just really special, I think, to be able to get such a lustrous lineup of women in power in our little stage here. And I really look forward to this show over the past weeks and I think it's going to be fun, fun, fun. Shelley Kimura from Hawaii Electric Light Company. I'm very pleased to have joined us. Shelley is the Vice President of Business and Strategic Planning, Corporate Development and Renewable Acquisition. That wouldn't be Hawaii Electric Light Company, that would be Hawaiian Electric. Let's talk about the parent here. Excuse me, excuse me. Yeah, Hawaiian Electric Company and then we have our co-host and dear friend, Mina Merida, who has a long history of being involved in the energy field, first as a representative from the 14th District on Kauai, former chair of the House Energy and Environment Committee and then also chair of the Public Utilities Commission under Neil Abercrombie and then finally our friend, Lorraine Akiba, who is an actual serving member of the current commission with fellow commissioners Randy Oase and then Tom Gorak. So truly an all-star lineup today and I'm so pleased to be part of it. Great. Mark, we're going to take one second break to make sure everything's connected and we're going to come right back, okay? We're back, we're live. We have Mina Merida, a co-host of this program, Mina Marco and me and we have Marco, of course, the other co-host in Hilo and Provision Solar. We have Shelley Kimura from Hawaiian Electric, Vice President of Planning and Development and we have Commissioner Lorraine Akiba from the Public Utilities Commission, wow, an all-star cast. So, Marco, will you start the questions now? I guess my first question is kind of a general one to each of you, is what led you to decide to get involved in the energy field? You've kind of, each of you have kind of taken somewhat different directions and I'd just like to give you a chance to address that question and explain what kind of path you took in terms of getting involved and what has been predominantly for a long, long time, a male-dominated field. So, what led you to take this down? Yeah, what he wants to know is what fantastic event happened, what epiphany happened, Mina, in your life that you should get involved in energy, what happened that day? Oh, simple. When I got re-elected in my second term, I actually wanted to be chair of water and land use and I was totally happy to do with the environment, yeah. And I was told no because, you know, I've taken some controversial stands and nobody wanted energy and environmental protection and so I ended up with energy and environmental protection and the first year I was a chair, I mainly worked on environmental issues and it was a down economy at that time and all the programs were getting cut and so I didn't feel productive at all and during the interim I was trying to form an agenda and, you know, with oil prices up, economy down, you know, if I wanted to make a difference I had to fix the economy and the way to fix the economy was to address energy issues so that's how I got started. It all connects up and I mean I don't want to go too far on this point but this was 20 years plus ago, yes? That was in 98? 98, okay. Well, not quite 20 years. Almost. What about you, Shelly? So, you know, my path is kind of a windy path. I didn't set out to be an energy like Nina but it ended up being that way. I think early on, I mean I've always been very focused on environment and, you know, growing up in Hawaii and when I went to college very much focused on stewardship of our land and our environment that kind of angle but I ended up going into accounting and getting my CPA license. It's a great combination. A lot of likely combination. I was going to go back and get my law degree but, you know, life happens and I didn't do that and one thing led to another and I ended up at Kamehameha Schools working at Kamehameha Schools full-time as a consultant focused on land issues and endowment issues and then the opportunity came to go to Hawaii Electric or AGI, the parent company and, you know, as a woman I had my first child second one was on the way and so it was more of a work-life balance decision at that time to get out of consulting and do what I perceived to have more work-life balance which I didn't. So it took me down that path and then Hawaii Electric Company entered into the Clean Energy Agreement in 2008 and that was something that I had a lot of passion for. So we heard the sound of roar and world-changing November, I think it was, 2008. October, yeah. So that was something that I felt very passionate about and wanted to get behind and just kind of kept me there since then.  You know, I didn't. It never really fazed me that way so that wasn't part of my mindset as I went forward. Great. Marina Keeba, you started out as a lawyer. Yes, I did. And how did the path wind for you? Well, I think the path came from being a lawyer. I know that as a member of the community I've always been engaged and very much passionate about things to do with the environment, with sustainability, with climate change and issues. And in my law practice, I headed the environmental practice groups for both of the law firms where I was a partner at. But it really comes from being a young person here in Hawaii growing up and my parents influence those values of taking care of not just, you know, the land but also the creatures and species and the sustainable balance. It's probably from that Buddhist value of you're just part of a universe and the concepts that Shelley talked about stewardship. And I think what brought me into energy was really the opportunity to work with, you know, with the leadership at the time under Governor Abercrombie and Marina was chair at that time at a very dynamic time and so my passionate interest in the environment and, you know, the energy nexus with the environmental issues is so critical. Being able to be a servant leader and to continue to stay true to those values is why I ended up here in the energy space where it is very important right now a lot of critical issues. So it really does take women to make a difference. So you were practicing in energy law, environment and energy law. By the way, that's the common denominator, isn't it? Environmental stewardship, that's what I get from all three of you, which is really something. It's really different than, you know, say in the past when a guy would go to school, a guy, notice I said guy, a guy would go to school and study engineering and that got him into energy. This is different. So you were practicing energy law and then one day somebody called you and said Lorraine, how would you like to be a PUC commissioner? Did you snap that up? I had to think about that. Like what does that involve?  Actually my energy practice was in arbitration, mediation and in the courtroom context being a litigator in that area. So, and maybe that was good because I didn't appear before the public utility commission. So there was no potential bias or agenda or having any preset notion of what to do. I think just taking on the duties of my responsibilities and living up to what the charge of the job is is to decide things in the public interest to also not just regulate utilities but also to be part and parcel of the policymaking functions that fall to the commission. It's a very important agency, a quasi-judicial as well as policymaking and that's probably why I think the women that have come into the energy industry are so important because a lot of policy needs to be made at a critical time. Isn't that the truth? This is the policy time. Before it was the engineering time this was the policy time but I would imagine that when you came into the PUC it was like an immersion course in technology. Yes, it was. Definitely hit the ground running but I was used to that as a complex commercial litigation attorney so got to learn fast and absorb like a sponge like Mike Champley and then also immersed myself in the opportunities and getting involved with the National Association Regulatory Utility Commissioners to have a perspective beyond just our island grids and to see what's happening on the mainland with sister states that are doing some similar things that we can share best practices and also let them know what we're doing that's wonderful here. Yeah, because we have something to give, don't we? We do. Oh, wait a minute. That was my question and I think we reversed it. Marco, why don't you take the next question? So you've all brought various kind of taking various different paths to where you are now from the utility side for Shelley Regulatory for both MENA and the Lorraine legislative for MENA so this question is how do you find it's been different as a woman to participate in the energy field compared to men and kind of a similar question follow on to that is what particular challenges as a woman have you encountered in the energy field? Lorraine, why don't we start with you? Okay, well I think you know I've always been in a field where there's previously a man dominated I would say probably legal profession and being a partner in a major law firm I mean in years past you probably wouldn't see a woman partner You're breaking barriers all over town. Well, that's part of what women leaders do, Jay. Okay, okay, thank you. But I think what's important is that while there is a need to build off the past and the foundation and utilities especially in the energy industry area there are certain obligations for reliability safety, resiliency but there's also a need to break out of the box to look at innovation and to embrace innovation and technology I think an ability that women have so I believe that having more women in the energy space allows for that creative thinking and hopefully the egos don't get in the way that people can be open minded more flexibility, more ability to be open to new ideas and to also facilitate dialogue I think women have by virtue of the societal values that have been put on us we're able to facilitate we're able to mediate, we are able to listen and those are important skills that are needed in this energy landscape now especially if we want to move forward and face and address the challenges. Isn't that true? That's all true actually. So Shelly, you got into this how did you in a company that has been dominated by male engineers, may I say that for a long time or a hundred years how did that feel and how did you feel you fit and how did you feel the men were seeing you or did you see the men? Well, I think Hawaiian Electric might be unique in that Connie Lau is our CEO Ah true, lest we forget She's at the table but of HCI, yeah and when you look at Hawaiian Electric company itself there's a large number of executive women in the ranks and so I didn't really feel out of place. I don't know if it's more of being a woman or the fact that I didn't have an engineering background that was more of the challenge and being able to leverage both the men and the women with the engineering background on my teams to be able to put that together with the strategic and the financial concepts and how do we leverage innovation to be able to move forward and really lead the nation as we try to reach these nation leading RPS schools that we have. And when you add the environmental stewardship to the say the formula, the mix of elements that existed before I think women do fit very well in that as Lorraine pointed out Yeah, they actually have studies about when women succeed and women succeed more when they're fighting for a cause that's not there for themselves not promoting themselves but fighting for other people or fighting for a mission and so I think that's probably why women will do well when it comes to clean energy. I actually went to a national conference that was focused on clean energy and women and this was one of the things that they brought up which I thought was very interesting and also the fact that it's going to take lots of parties working together building on what Lorraine was saying to make this happen and because of the way that we're brought up as women you know part of it is genetic part of it is just the way we're brought up is to collaborate and find that common ground and be able to move things forward. Yeah, great and it's amazing, isn't it? I mean, would you say that as proportioned or more women in energy or at least in Hawaiian electric, in utility energy than the word say when you joined? Yeah, I would say that that's true Yeah. Lots of interest as well because of what Hawaii is trying to do. Yeah, right. It helps us recruit. We have much on our plate, yeah. Me and Marina, gee, I'm trying to remember if there was a woman on the PUC before you joined. Well, for that matter Yes, there was. Their names just escaped me but there were several. I mean, I think at least three before me. So how is it different for a woman in energy, on the PUC in the legislature doing energy? Let me tell you about a story in the legislature when I first started working on bills and I think this was kind of a primary difference between a male perspective and a female perspective. When you start off with bills people usually have think what they want at the end in the bill at the very beginning and so usually the guys would take that particular bill all the way to the end and at the last minute try to fix it and many women in the legislature improve the bills as they go along to come to a final end product. You're probably going to say that's a better way to do it. Personally, yes. I think so but what caught me off guard in the beginning was at the end I had nothing to negotiate out and the guys had lots to negotiate and so it was a very interesting analysis. So I think just how we process is very different and so how to accommodate those. So do we need both styles or will one prevail? I think you need both styles but just there has to be a real good understanding of how people come to decisions how people make decisions how people perceive a problem and I think before it used to be really easy because we're dealing with a lot of linear problems you're trying to find one solution for the problem but now we're dealing with really complex systems we're dealing with environmental, social and economic problems and engineering problems and so the problem solving is more complex it takes better understanding more education and better collaboration amongst all the stakeholder groups and that's going to continue for sure and I think women are just a little bit more patient in trying to achieve the best results to these problems. Okay now we have a more interesting question regarding the challenges or whether it's easier working with other women than working with men maybe we've touched on that already but I'm curious to see Okay well so now there are as we know there are more women coming into the field and that probably is going to continue because of the skill sets the approach, the cultural experience so is it easier to work with women who take their approach with men what is your experience of that we're really drilling down now well let me jump in here I think it is actually now a good thing how more women in there and I can say that from my personal experience of dealing with the National Association of Utility Commissioners a lot of the commissioners coming in into chair positions and into leadership positions in the committees for women and if any of the dialogue and I think it's a focus on team building and even though many of the women have the same concerns it's a different way of problem solving and that's definitely allowing a comfort zone for people to be able to express their opinions and that reasonable people can differ as opposed to it being drawing a line in the sand and being combative I think Shelly kind of alluded to it you know men are from Mars and women are from Venus we do have different skill sets and that's a dynamic a dynamic society we aren't all the same I mean there are strong women it's not a matter of being weaker or strong or passive I think it's just a different way of approaching and team building and I think women are very much focused on outcomes getting the job done improving the process making sure that everybody feels they are involved in that process because so at the end of the day even if you didn't get what you thought to be the actual solution you feel that you've been given the due process you've been involved in the dialogue so that when people have to make a decision and the consensus or someone individually makes a decision there is more buy-in so I find it's actually it's refreshing sometimes because we don't have to do all that ego testosterone thing on the table just get to it and if you only have 45 minutes for a meeting people know it's 45 minutes for a meeting let's get to it let's focus on getting the job done these women have things to do they have children to take care of husbands to take care of they're multitasking in their other parts of their lives so they get it done so at this point in time we all talk about collaboration all day long and collaboration has got to be one of the most important things in making energy happen reaching our goals because it brings people together it builds teams and all that what would you add to that Shelly? I have an experience with my daughter she joined a Lego robotics team and that team had been together for three or four years all boys from her kindergarten class and at one point maybe fourth grade they decided they wanted to add two girls to add some diversity to the group and help balance them out and so they added two girls my daughter and one other girl and the other parents who had been on the team for a while said how much the group improved with the addition of the girls and I think that that's just the dynamics of a team to have diversity on a team makes a team better because the more perspectives you have the better answer you're going to come up with so it's not just about men and women but it's just different experiences, expertise gender may play into it as well and coming up with the ideas and the answers and being able to move something forward is all important. But on the team the women have to be able to express themselves absolutely if you don't have your voice then you're not going to be heard so it's important to do that and I think it's important to teach our girls and our women coming up in the ranks to trust in their own authentic leadership style because our leadership style is not necessarily going to be the same as a man's leadership style but it's still effective and not look at what a woman is as a limitation but as a strength and I think that we have to embed that in our women coming up the ranks I love this show it's a great show, this is a very important show so much so that we're going to take a short break now we'll come right back and then we'll go to more questions that we have and feel even better and better about it. Aloha my name is Carl Campania I am the host of Think Tech Hawaii's Education Movers, Shakers and Reformers we hope you join us every Wednesday at noon right here Think Tech Hawaii as well as on OC16 our show covers a range of important topics regarding education, our educational system where we are where we're going, where we need to go and some of the important people that are working on that from state legislators to department heads to teachers and students, we bring in everyone we possibly can to have a comprehensive conversation about the educational system here in Hawaii. So we hope you join us again every Wednesday at noon here on Think Tech Hawaii. Mahalo Aloha I'm Marcia Joyner inviting you to navigate the journey with us we are here every Wednesday morning at 11am and we really want you to be with us where we look at the options and choices of end of life care. Aloha we're back, we're live, I'm Jay Fidel here on Mino, Marca Marco, Mina and me women in power, a very special show with Mina Morita Shelly Kimura and Lorraine Akiba current commissioner of the PUC and Marco it's your turn so why don't you ask the next question that we have in store for our guests so as as women in power here in Hawaii do you find that there is much of a difference working in the energy field here in our Aloha state compared to what you know or women that you know working in the energy field on the mainland well you know when I do travel to the mainland and also talk with colleagues from the mainland and meet with the utility representatives from the mainland I see the same diversity and many of these come from traditional utilities that were previously dominated by male executives, male engineers but the same trends that are Hawaiian Electric is not unique in terms of the issues that we face here in Hawaii and also the new wave and next generation of women engineers and men quite frankly that are coming in open to the different things that are happening in the energy space so I don't see it as necessarily being different I think what is a positive thing is that as more women have come into the energy space there is somebody's daughter there is somebody's sister there is somebody's mother in positions of responsibility and power are looking at some of these folks as they with their own family members and so it is more of again I think an awareness that exists and especially because some of these issues do touch on policy and many of the women are involved in those areas I think there's been quite a good synthesis of ideas from both men and women I don't see it as an adversarial thing at least not in the communities and with the utilities and regulators I've had contact with Shelly you know we have learned over the past couple of years that not all utility companies are the same and that the cultures in one company maybe the culture in one company may be different particularly when you're dealing with a culture in a utility company in Hawaii versus a culture in a utility company on the mainland and we've established that one of the baselines at least in Hawaii is the notion of environmental stewardship not all the companies on the mainland may feel the same way about it so in your travels how do you feel a woman's career would be different in a utility company on the mainland it's hard to say I mean I've interacted with a lot of other utilities I part of my career I was doing investor relations so I traveled a lot meeting with a lot of the investor community and it was mostly male in the utility and energy industry I think that and this is just my perception but on the mainland the culture is a lot more aggressive just overall regardless if you're a female or a male and so I think that women's style in general is not as aggressive in Hawaii it's not as much and it's more inclusive so perhaps it's a little easier for women to be accepted and integrate into the business world in Hawaii than on the mainland and it's a little bit more of a fight for some of my colleagues that I've spoken to interesting observation Mina how about you how do you feel it works you do a lot of travel these days and you go to conferences what's the difference between a woman in energy such as your own career versus a woman in energy on the mainland or in another country for that matter well first of all I just have to correct the record since I'm retired most of my travel has been but I think you know talking about leadership in general whether you're a man or a woman what you really want a leader is a person that can bring out the best qualities of their employees or individuals regardless of gender so I think that's the most important thing how do we get beyond the gender line but really what kind of leaders are out there that can bring in the best qualities of a person into the workplace in terms of supervising you know the team do women have an advantage over men or do men have an advantage over women who? you know hopefully we're getting to a point where both will be nurturing okay okay I think that's what I would like to see but you know again I think it's always been the primary responsibility of a woman to be the nurturer whether it's her household or within the workplace many times and so nurturing builds loyalty doesn't it trust I think trust transparency, credibility, respect fairness I think those are the leadership qualities that whether you're a man or a woman you should exemplify sometimes people aren't able to do that and therefore they're not as effective in being a leader but that's important and I think one more attribute that is important in the energy area especially for utilities when we talk about the utility of the future is the courage to be visionary and that is a trait that hopefully we're cultivating in both men and women and in the next generation of energy leaders because it is a very challenging time and I think to the credit of many women in the profession they've had to face barriers they've had to break through do 200% and maybe a colleague a male colleague only had to do 100% but I think that's the kind of grit the kind of courage the kind of tenacity that a lot of women who do want to contribute and do want to excel bring to the workplace so I've seen it and observed it so I think it's a positive thing Inherent in that is the willingness to take risks courage you mentioned I think the best leaders I've seen have been good coaches they know when to rebuild they understand what it takes to lay the foundation and when everything is going right they know how to step back and just encourage so whether it's a male or female I think we see some extraordinary women leaders of that of that nature in Hawaiian Electric actually Connie Lau is a good example so is Lynn Unimori Lennie you're listening Connie what would you add to that Shelley? we have a lot of women leaders in our company we have Sharon Suzuki and Darcy Endoomoto and we had Wong we have a lot of women in those leadership positions which I think helps both our executive team but also our workforce to cascade that diversity and appreciation for that diversity throughout the organization Marco it's time to ask the compensation question are you ready to do that? you want me to do it? well start it off anyway this is an interesting question I think for the three of you Lorraine, Shelley and Amina do you believe that the compensation the monetary compensation is comparable for women as it is compared to men here in Hawaii and how does it compare as far as you know with let's say compensation on the mainland? is there a disparity? have you ever noticed a disparity? I know that there are studies that women typically get paid less and it's interesting because they've shown that women won't ask and that's part of the issue that men will actually go and ask for the raise or ask for something more when they're negotiating in a new job and women won't necessarily do that and when you don't do that and that just compounds year after year as you're getting your whatever percent there's a huge difference at the end so it's hard for me to say whether it's an institutional issue or just what someone's willing to negotiate and ask for and that supervisors are shown to focus on those that are being vocal about it and not so much on those that are silent so I think that's just a lesson for myself and for all of us it matters speaking up I think we fare a little better in Hawaii than the rest of the nation I think the average for the rest of the nation for equal pay for equal work is about 75 cents to a dollar and in Hawaii I think it's around 82 cents to a dollar with having unions is helpful in creating more equality for pay but there still is this disparity and I think that's at all levels there is pay disparity I think that's a big issue in the last election nationally it's all resolved now I'm sure it's going to get much better even at the corporate level in terms of the glass ceiling we talk about that there are examples of corporate women who have risen to the top and if they continue to set the example I mean local economy I can thank for Kana and I mean out there really quite a visionary and a very articulate and a dynamic leader but those are far and few between so we need to do more I think as a society as a state it becomes an issue as Mina said who is the most effective leader maybe I come from a law firm you basically are you have to be aggressive about your compensation when it comes time to divvying up the partnership proceeds I'm used to that but most people aren't and especially in Hawaii where we're taught to be consensus building to be humble again it's encouraged but it is again a matter of courage to speak up if you don't think that somebody is doing something correctly or right by you as an employee then you should speak up the people who run the show whether they be men or women should not allow the disparity and they should come to you I noticed Shelly that you didn't ask for as much money as you might have last time around so I'm telling you because we think no matter what you ask for you're worth X which is the same thing we would pay a man the guy on top or the woman on top takes that point of view then you don't have to be too aggressive because they kind of do it for you and I was speaking generally at Hawaii Electric we do something that we call calibration that we look across all areas and make sure that we're looking at everything in an equal manner well we're at the last part of our show now we're at the part where we ask you to look into camera number one okay oh that's number one over there right straight ahead of you okay and address the audience whoever they may be men in energy, women in energy everybody in energy they may be from your constituencies they may be high school kids thinking about what to do with their lives in the environment in the stewardship in energy so Marko why don't you frame the question that you would like to see our three guests you know address in talking to the public Jay so the question is at this point in your your careers and at this point in your path in the energy field what candid thoughtful advice would you give to women in the energy field coming up behind you and do you think it's easier to be accepted and taken seriously now compared to a handful of years ago but I guess to really be interested to hearing what kind of advice you would give to those coming up the ladder behind you Nina why don't you start oh I guess I'll start with I have four granddaughters you know eleven, nine, nine and three and I would say the same to them they can do anything that they want you know the future is theirs to hold and there's no limits and you know the jobs that we have available now you know they're not limited by gender and so you know in order to get ahead get a good education you know be truthful work hard and you know the sky's the limit and ask for help a lot of people don't ask for help and especially for women entering the energy field right now in Hawaii we have a wire women in renewable energy which is a good support group you know and support groups are important mentors are important offering that and you know just the ability to socialize with other women in the industry Shelby let's see so I have two daughters and so you know whenever I'm in a situation where I'm trying to make choices you know I do think of my daughters and my children I have two daughters and one son and there's always those choices you're trying to make and you're always pulled career family you know husband children whatever it is and it's not easy and everybody makes their individual choices and you don't have to follow the path of any other one individual everybody creates their own path and figures out what works for them and again it's always just being true to yourself and what you believe in and what you value and I think that makes a stronger person and a stronger leader so you are able to be effective in whatever your passion is and whatever career that you end up choosing to go into and as far as energy for anyone that's considering any you know female or considering going into energy is such an exciting field right now and one in which you can truly make a difference in society in the world so I encourage folks to do that if they have an interest it's going to become more and more exciting as we go forward too Lorraine you're last you you're the anchor man on this I want to echo everything both Mina and Shelly say because it's true you know in terms of mentors support group which we have now and I think about my own manager which was my mom you know and she was a very strong and you know talking about breaking the glass ceiling back in her day being a Japanese American physician at her time was you know there was only a few and she had to deal with a lot of issues and challenges so I take a lot of inspiration from her and it is true that you have to keep true to yourself be strong and get the skill sets as Mina pointed out so that you can effectively demonstrate that you have the skills and I would I would say that it is important to be true to your own compass and to never doubt yourself I would like to encourage everybody to see a movie I just saw actually this weekend called The Eagle Huntress and it's a documentary about a young woman 13 years old in Mongolia in Kazakhstan she's the first female eagle hunter in her tribe her father was very supportive her grandfather was very supportive but the rest of the elders thought that this was not something that a woman should do she was phenomenal she's a strong woman, smart trained, did all the skill sets to become the most phenomenal eagle huntress and she won the competition and she also successfully hunted on her first hunt with her father so you have to see the movie because it's an empowering movie about girls can be empowered women can be empowered there are no limits you choose what you want to do and you live true to your own compass just like the Polynesian voyagers you keep true to your star and you find that course even in choppy and stormy waters women in power Lorraine Akiba Shelly Kimura, Mina Morita and I'm going to leave it to you Marco to close this you have the closing remarks so say farewell I think it's been a fantastic show Jay and Lorraine, Shelly and Mina thank you so very much for making time out of your day today and I do hope this is something that we can do on at least on my regular basis in the month and year to come because I think there's still so much more that we can talk about and I think it's just been a superb way to spend past 45-46 minutes so thank you all again, thank you Jay for being the host and questioner there with me you rock the world as you always shall so thank you again thank you Marco thank you ladies it's been a great discussion Aloha and Happy Christmas


My name is Joel Turnbull. I'm a developer for Gaslight in Cincinnati, Ohio. I also head up and coordinate a blog over there in case anybody ever wants to talk about that. But today, I'm here to talk about debugger-driven development with pry. Most Rubyists I know don't use debuggers. Rubyists I know, when faced with a problem, would prefer to ponder code to pop open a debugger and poke around. This is crazy to me. I've always thought it was. Because to me, trying to solve a problem by pondering code is like trying to find your keys in the dark when you're holding a flashlight, but you're consciously deciding not to use it. Um... So why is this? I used to think it might be about egos or culture or something like that, but really, it's pretty simple. I think we've had a lack of really good tools up to this point. But ultimately, my talk isn't about using debuggers in a traditional sense to fix software, but using debuggers as a tool in your workflow to build software. And so why do I think we can do this right now? I feel like we finally have a tool that we can use to explore this debugger-driven workflow. And that tool is Pry. Can I get a show of hands of who uses Pry? Awesome, like everybody. All right, cool. So I'm talking about debugger-driven development with Pry. Conrad Irwin gave a talk not even like six months ago called REPL-driven development with Pry. I swear to God, I had no idea. And both are accurate, I think. But I think both terms kind of undersell what the power of Pry is. So here's my favorite definition. Pry is an IRB alternative and runtime developer console. So if we take the first part of that and we think about Pry as an IRB alternative, anything that you can do with both are REPLs, right? And a debugger is a REPL too. Anything you can do in Ruby, you can do in IRB, anything you can do in IRB, you can do in Pry. What makes both of them powerful is they both leverage this idea of runtime. To me, runtime is all about immersion. It's about being immersed in a live system where you can play with code and you can look at your objects and all that kind of thing. You can validate your implementations, everything you need to do. And it's like looking for your keys with a flashlight. So given that Pry and IRB are both REPLs and they both have this idea of runtime, why should you use Pry instead of IRB? It's got a couple vital workflow features right out of the box. Syntax highlighting and tab completion, both super handy. But what I want to talk about today is some of the bigger game-changing features of Pry. The first one is enhanced introspection. Here's our friend again. Introspection is the ability of a language where you can ask a language questions about itself. And it's built into Ruby, and that's awesome. If you've ever asked a class what method you can call on it or you've asked an instance what class it is, you're doing introspection. What if you want to go deeper? What if you want to know what the class methods are versus the instance methods? What if you want to know what methods are inherited and from where? What if you want to know what state an instance holds onto during its life cycle? You can answer all these questions with plain Ruby and IRB, but the problem is that the amount of effort involved is non-trivial. I would classify it as daunting. So, given that, you know, I would classify this as DRTFM. This is what I point to. I mean, this is the workflow that I like. I like to take the things out of the box.  I like to play around with them. I like to try to put it together without reading the manual, and if I get stuck, then I read the manual, right? The second really game-changing feature of Pry to me is extendability through plugins. And the best way that I can show this is to just demo some of my favorites for you. So, I'm going to show you a Rails app. Instead of calling it in a normal way like Rails S, I'm going to call it like this, under the umbrella of Pry Rescue. And I'll show you why in a minute. But here we are. This is an app I've been working on late nights. Please don't steal this. This is a bowling-score tracker, right? You can push any number after you bowl, and it will record how many pins you knock down, right? So, the first thing I'm going to show you about Pry, for those who aren't necessarily familiar, is how you invoke a runtime at any point in your application where you're running Ruby, right? Here, I've inserted a couple of binding.prize, one into my controller action, and one into my template. On the lower left, we have our model, okay? So, let's rerun it with that in mind. Let's go back to our running server, and we'll see that we've halted our execution here, and we've been dropped into a runtime. We can do things in here like look around. We can play lines of code. Let's play the line that sets the bowling game. And then we can look again. When we exit from this, we've returned from our controller. We're starting to render our template, and we've hit our next binding.prize. You can put binding.prize inside your ERB tags, right? Same drill. We can look at bowling games. We can step into our implementations of our methods. Here, we've stepped into the frames method of our bowling game model. Same drill. We can look around here. We can look at ourself. We can go to the next, or we can continue. So, you can see how handy that will be if things aren't necessarily blowing up, but something's not quite right either. So, what if things do blow up though, right? So, here I am. I'm going to spark an exception here by trying to bowl the next ball of my next frame. I'm going to bowl a big nine. I'm going to come back here, and we've been dropped into a runtime because an exception was thrown. That's what being under the watchful eye of prirescue is going to do for us within this context here. So, some interesting things we can do here. We can call the show stack command of the price stack explorer plugin, and we're seeing the whole stack here. This is like caller, but it's alive, right? We can move up the stack. We can move up the stack nine frames. We can move down the stack. We can take a look at the state of any object here at any level of our stack trace. We can look at our stack again just to see where we're at. We're on frame 10. But this is a big hairy kind of rail stack trace, and we're not getting a whole lot of value out of that right now. So, let's call the CD cause command of prirescue and see if it can track down what caused this problem in the first place. There we go. This looks more familiar, right? Here we are in our template, and I will guess that on line 13, we have a problem with frame one, and that's true. So, we just need to add a little bit of a guard in here and say, you know, if we have pins on frame one, let's render that. Otherwise, let's just render a dash. And we get feedback that that's what's going to happen, right? We know that this is a working implementation. So, let's copy our history. This is another plugin called prieclipboard. That's going to copy that implementation into my clipboard. I'm going to edit a file where the last exception was raised. It drops me right where I need to be. I'm going to paste in that implementation, drop back in, and I'm going to ask prirescue to try it again. And we're back, and we've got our dash. So, and we can continue to bowl, right? That's legit, right? A five and a six? Okay, cool. So, what do we do here? We use binding.pri to invoke a runtime anywhere in our app where we're doing Ruby code. We use the pri debugger gem to give us our step next and continue functionality that we expect out of our debugging tools. We use prirescue and ran our Rails app under the umbrella of prirescue to drop us into a runtime when things go wrong so that we can poke around. We use the pri stack explorer gem to navigate the stack and explore state at any level. A few commands we saw were cdcause and prirescue that took us to the root of our problem. We used play and we used copy history to not mess around with copying things with our mouse and pasting them into our REPL, which can be a pain. We used the edit command with the eflag to take us to the file where the exception occurred so that we could fix it. And then we used prirescue try again, which under the context of Rails just replayed our request. We didn't have to reload our page or do any of that nonsense, reload the whole environment or anything like that, right? So it was fast. So that's great. And having demoed pry in a debugger context, I can show some of those things. But really what I find interesting is this idea of pry as a runtime developer console, right? So there's some really awesome aspects of Ruby, right? It's introspective, which we've talked about a little bit and we'll talk about more. And it's dynamic and it's reflective, which means we don't have to compile it and we can change things on the fly in its runtime. And I think we take advantage of these things a lot in the code that we write, whether we're doing metaprogramming or monkey patching or anything like that. But we haven't really taken advantage of these things in the tools and in our workflow yet. So when I talk about workflow and our problems with our workflow, I see big problems with the traditional workflow in Ruby development that I see, right? I mean, by that I mean we write some code in an editor, we save it, we pop over to a terminal, or we pop over to a web page and reload it and run it to see if it worked. And if it worked, we go back and continue on. If it didn't, we fix it, we save, we go back, we reload it, we run it, rinse, repeat, right? What problems do I see with this? First of all, it's disruptive and it's distracting to keep switching back and forth, right? Some amount of context switching is always gonna be eminent, right? But any effort you can make to reduce that is just gonna be a huge win for your flow and your focus. The second problem I see with that is it's just guesswork. We just write some code. Yeah, I think it's gonna work, we save it, we go over, we run it to see if it works. We're just taking shots in the dark, you know? You can ask this guy. Taking shots with a flashlight is much more accurate and recommended apparently, so do that. And to me, it just seems backwards, right? We're like solidifying and codifying our code into our code base just in an attempt to see if it works. It should be the opposite. Our code base should be the record of code that we've already validated, right? And I mean, these things are just kind of things that we accept and we take for granted, right? But I mean, I think other languages have been more effective and intentional about integrating this idea of a runtime into their workflow, you know? And blurring this line between static and running code. Closure comes to mind, right? But we've talked about the awesome aspects of Ruby and there's really nothing that restricts or limits us from doing the same, right? I mean, I think the Ruby language enables it, you know? It's just that up to this point, we really haven't had the tools to do so. So we talked about these workflow problems. How does Pry solve these workflow problems, right? I see that, you know, the introspection and the documentation and the source code browsing, which we'll see in a minute, that's baked into Pry, gives us 90% of the information that we need to write code right now, you know, in most cases. It has a runtime that you can throw your code against and validate it and get feedback on whether it works or not immediately. And it's smart about editing. You don't have to think about what file you need to open. Pry usually knows what file you want to edit and usually knows exactly where you want to edit it, which is really nice. So when I talk about this idea of runtime development, I'm really talking about being immersed in this environment that, you know, loves us and can give us feedback and is alive, right? So we want to spend the majority of our development time there and we want our editor to just be an afterthought. And that's just a place where we just push working code when it's done, right? So let me demo to you a little bit about how I see that working, right? So our mission is to write an empty class definition, okay? This is just a script, no brails involved here, anything. But given a class like name like bowling game, we want to create a file, bowlinggame.rb, and write a class definition to it, like class, bowling, game, empty space, end, right? And I've created a little skeleton here of how I think that might work, right? We're going to read in a string from the command line. We're going to pass that string into a method called file name for class and get a file name. We're going to pass that string into a method called class definition for class and get a class definition. And then we're going to create that class by writing that class definition to that file, right? So let's step out here and let's just run that. So we get an expected error, right? We haven't implemented anything called file name for class yet. So we could jump into our editor and start coding and all that, but why don't we see what this is like? Why don't we use prirescue and leverage that exception to drop us into a runtime and start this runtime development process? So we do that. We get the same error, but the difference is we're inside of a runtime now, okay? So the first problem is pretty easy. We know that we need to define file name for class and we do so, right? The difference is in here, I'm going to raise in the implementation of this class and drop back out and I'll show you why. When we ask Pry to try again, we get in here, we're right where we need to be to define the working implementation of this class. Although I already know that I have forgotten to pass in the bowling game string like I always do. Okay, now we have everything we need. So we have something like bowling game, right? And we're looking for something like bowlinggame.rb, okay? So I'm just going to preview my favorite Pry command of all time here, ls. When I call ls and give it the class or the object I'm working with, I immediately know I'm working with the string and I'm seeing all of the methods that are available to me on that string. And when I say all of the methods, I don't mean all of them. Notice that the object methods are not in here. And you know that if you've ever used IRB to get the method, you always do thing.methods-object.methods, blah, blah. That's just noise, right, in most cases. So the default is just to leave that out. The developer's a prior thought of that, right? So we can try to class down case, which gets us so close but yet so far away. We don't really know where to put that underscore. But as Ruby devs, Rails devs, we know we have things like active support that can help us out with that. So we include that. And now when we ls our class, we've got some extra stuff in here, right? Demodulize, deconstantize, that kind of stuff. And if that's hard to see, we can just ls active support and flector itself and see what's available to us there, right? So we needed an underscore. I see a method called underscore there. Tab completion is nice. All right, so now we're getting a lot closer. All we need to do is stick on our file extension and I think we're done, right? So there's our file name. So let's copy that. Let's drop back into our file. Right here exactly where we need to put the implementation. Let's put it in there. And let's save it and continue on. Okay, I'm not going to continue through this whole thing in the interest of time, but I do want to implement this last method inside of the create class so I can talk a little bit more about what I love about introspection, right? Let's just reflect on what we did there, though, with the workflow, okay? So we used pry rescue to leverage the power, you know, to leverage that exception to pop us into a runtime and we used the runtime of the debugger not to fix code but to drive our development process, right? So we're in here. We've raised inside of our create class method. We try again. We've got our file name and we've got our class definition. And we have this file class, right? And I know about this file class and I know this is exactly what I need to get the job done but I mean, this is exactly what happened to me. I don't really remember exactly what I need to do here, okay? So I can pop out Stack Overflow or I can pop out to Ruby docs or something and take a look or I can just ls file right here and just take a minute to look at this and think about all of the low level Ruby introspection acrobatics you would have to go through to get this brained up of information right here. We've got all of the methods that you can call on instances of file. We've got all the methods you can call on the file class. We've got all of the methods that file inherits from its superclass and we know what that superclass is, I.O. We also know all the constants involved and if there were state involved in class or instance variables we would see that here as well. So all of a sudden I'm informed about everything I need to know about this class and I have a pretty good idea just from a moment's notice of how I can use it or what I can do to play around with it. So let's... I see the right method and I don't really want to write anything or mess with anything right now so I'm just going to look at the documentation for it. Okay, it opens the file it optionally seeks to the given offset writes a string then returns the length written. Right ensures that the file is closed before returning this sounds like what I want I page down, I see some examples there Great, I'm ready to go. Alternatively, I can do the same and call show source, okay which isn't doing a lot for me here but when I'm in my own code base this is what I lean on more often, right? So let's get our bearings again and let's give it a try, right File, write File, name Class, definition Okay, something happened, it seemed to work, right? How do I know? Really easy to shell out in pry you get really nice output exactly what you would expect which is I can't say the same for IRB in that case I have this thing called bowling game in there and let's take a look at it that looks correct to me so let's just do that again I'm going to copy the history again and then I'm going to remove bowling game just to make sure that my script is doing what it promises, right? Oops, and it's not there anymore so let's go back let's put in that implementation and drop back in let's ask pry to try again no more exceptions, do we have our bowling game? We do, okay so what happened there, right? We used the debugger and the runtime as a tool for driving our development process and build our implementation not just to fix software, right? We validated our implementation before we codifying it and we reversed this traditional workflow that I've got so many problems with we explored and we informed ourselves about how to use our classes without context switching, right? We stayed focused in one tool and then we didn't have to reload our libraries and our environment every time we wanted to run code so it was fast and you know we're in the testing track here so I should probably talk about testing a little bit and that might have felt a little bit like TDD to you I mean it does to me, right? As practitioners of TDD I mean I love TDD I think most many Rubyists do but I mean what I love about it most is it keeps me focused and having a test suite allows me to aggressively refactor my code and have the confidence to do that and I'd rather do that up front than after the fact, right? But as practitioners of TDD we learned to love failure TDD is all about making something fail than writing the code to make it pass when we have bugs we want to exercise that exact piece of code that's giving us the error and get that error, you know before we then go because we know we're about to do something cool and fix it, right? So we love to see red and so a practice that's centered around failure is naturally suited to a debugging tool, right? I mean that's what a debugging tool does it's meant to handle failures catch failures and then give you the tools you need and enable you to fix them as quickly as you can and we've seen how awesome a debugger of Pry can be and so the promise of this talk is that I'm going to deliver a Pry-enabled TDD workflow but before I do that I mean I mentioned that I've had a kind of a specific experience that made me a believer that this workflow even happens I mean I've actually done this before I'm not creating this, right? and that specific experience was this Does anybody know what this is? Smalltalk, yeah this is a screenshot of a Faro Smalltalk IDE and I spent about a year or so in the 2000s writing a web application in the seaside framework in Smalltalk for a company in New York City with a team of guys and really delving into object-oriented programming and learning so much about it I really learned to love this, right? but what first struck me when I saw Pry and I saw the LS command was it reminded me of this, right? Right here we are looking at a ZN Client class in a Zinc HTTP package we see the class definition right there at the bottom with all of the instance variables that this class makes use of listed out on the right-hand side we see all the methods that we can call on an instance of this class and we can click on any of those to see the source code of that method that's all you need as far as I'm concerned that gets you 90% of the way there almost every time right? so I wanted to demo a Smalltalk TDD workflow because that's the other really cool thing about Smalltalk and different thing about Smalltalk is that it really enables this awesome TDD workflow and I don't think I'm going to have the time to do that unfortunately but the TLDR is this basically okay so if I write a test and I try to exercise a class that doesn't exist like bowling game here Smalltalk's, when I save this Smalltalk's going to say that doesn't exist what do you want to do? and the first option there is to find new class you just click it and it does it when I try to call a method on that class that doesn't exist Smalltalk asks me if I want to implement that method and when I say yes it drops me into a debugger a runtime where I have everything available I need to create the implementation to correct all the things I need to do so I'm not in the static code editor here this is like living system so I can do so I just want to return 0 when I save my test pass that's the idea and it's small but small changes in user interface can really turn like a daunting experience into a really motivating flow it doesn't take much when I talk about this power of pry and we've talked about some of the plugins and how powerful they are and how pry is so easy to extend even I can do it so I've kind of gotten the ball rolling I've pushed a little code up to github it defines a new command called define it in pry right now it's just a pry RC and you can define pry commands in your pry RC or you can do gems or whatever and that's where I want to move it but this is my attempt to kind of get this workflow going in Ruby right? so alright so here it is here's my pry RC I'm creating a command called define it and then I'm implementing every pry command implements this method called process and that is what is going to happen when you call the command from within the pry repel right and so I'm kind of using this idea that we demoed in the last demo of when I hit a name error I just want to automatically generate an empty class definition and move on what it will also do is when I hit a no method error it's going to generate an empty method definition and put you right in there where you need to be to implement it right? so let's take a look so once again real quick though so here is a spec and a set of tests that exercise this bowling game class right? the first test just verifies that bowling game is a thing the second test says if I ask a new bowling game for its score it should return zero the third test says if I bowl a four then the game score should reflect that and the last test says the price the score should reflect that sum so when I run our spec under pry rescue pry rescue it does different things in different contexts so just like before pry rescue is going to break on unhandled exceptions just like it always has done but in the context of the spec it's also going to break on assertion failures so you can poke around and get those fixed so here we are we we've got our first exception it's the name error an initialized constant bowling game so let's define it alright didn't see it but it did it next believe me alright so next we've got our next exception here undefined method score for bowling game are no method error so let's define it you guys didn't believe me but there it is alright there we go we're in our empty method let's TDD we just need to make the test pass so we'll return zero out of there ask pry rescue to try again another exception here no method error undefined bowl for bowling game so let's define it now I feel like we're going to need to keep track of a little state so let's we want to make that the fix num we want to return score out of here now instead and let's initialize score to be zero when you create a new bowling game let's save that let's try again alright that worked we're in our last test here and we've hit our first assertion error right and expected nine and it got five because we're not doing any of the the totaling yet so let's this is another way you can call edit you can just ask it to edit the class and it'll know what file to drop into and I feel like we're going to want to keep track of our scores now so let's just push those fix nums on a scores array let's get our score by reducing those values that's how you keep scoring bowling right just add everything up alright cool and let's let's initialize it with an array with an initial value of zero as well let's try again what was our own there alright for example zero failures our spec thought we didn't fail at all you know it's pretty cool so what happened there alright I mean basically we again we use pry to drive our development process we used our own pry plug in there to kind of make that a little bit easier and within one runtime we fixed all of our assertions exercised our class and implemented the whole solution right no reloading, no nothing like that so in conclusion embrace your runtime and all things don't read the effing manual use a kickass flashlight if you're fixing software use a debugger and when you use a debugger use pry thank you very much