Welcome back to the third week of our extension horse management webinar series. We are in three of four and so today we're going to be talking about hay management. And so we have with us today Kevin Sedevic who is our state range specialist. He's going to talk to us about hay management and then either Rachel or Paige will come in at the end with some hay sampling. And so we're just going to turn it over to Kevin and get rolling. So welcome Kevin. Alright, well thanks Mary. You know I wanted to talk about how to approach this presentation today on hay and I looked at two different approaches one we can look at hay management side but also I think a lot of people are purchasing hay or do a combination of both. So I'm going to put it on this twist of if you're going to actually put up hey how to better manage it what to get the best quality for horse hay.  That's kind of how I approach it when I buy hay for horses. So you know I get this question on horse hay or cow hay. You know are they different and it depends on if you're talking to a horse person or cow person because obviously a horse person knows that cow hay is not a very may not be very good horse hay but sometimes the cow boys go out it's just hey. So they are quite different and when you're looking to buy here put up hey you need to think about that product as it going to be fed to a horse. That's true of also if you're going to feed them to sheep. They're just different requirements different tastes. And so you want to put up a quality feed that that horses are going to like and actually get some quality out of it. So I'm going to break this up in a couple of different ways. Let's look at hay types first and you know we look at annual hay types versus perennial hay types and then in my picture here I have Timothy to the left. I have annual ryegrass to the right. And I would say when it comes to hay consumption by horses about 80% of it is usually going to be in a perennial form. It's just more available and that's typically what we'll find that that's available in the market. But there are options using annual forages as well especially when we dealt with the drought in 2020 and 2021 hay supplies were short. And you may have looked at some annual forages that might have put your need to feed your horses. So we look at annual forages you know there's a couple different options out there that I think are very good feed sources for horses on one that got a lot of press over the last five years is tough grass. Tough grass is a warm season small grain was kind of brought up north for the horse industry. The caveat with tough grass is it takes quite a bit of water and quite a bit of heat to get a pretty good hay crop. The beauty of it though is you can get multiple cuttings when you use tough grass so if you have the opportunities to either irrigate or have good moist soils. Tough is a great is a really good option especially in the eastern part of the state. The two forage cereals that tend to be used that I would recommend that could be used are forage oats and forage barley. I actually like to forge barley a little better than forage oats because it tends to be lower in lignin content and horses tend to be a little bit picky when it comes to fiber and lignin content. Oats can get a little bit higher in lignin especially if it's put up a little bit later. I think those are good options for producers. And in pearl millets one you probably haven't heard of, pearl millet is not a foxtail millet. It is a total different species, a very palatable high quality feed that's used commonly in the cattle industry for high quality feeds. But it's one that it's available that I think horses will do well on. Those are kind of my four that I would put on the top of my list for annual forages to use. Some of the ones that are questionable that doesn't mean you can't use them, but there's some things you got to think about and that's sedan grass. Sedan grass is not often used in horses but it was available the last couple of years during the drought. Sedan grasses can contain HCN or prusic acid. And so it's something you want to have tested before you feed. That's true of all classes of livestock if you're feeding sedan grasses. So one of those that it's a very palatable feed horses will like it, but tested for prusic acid. Even in the drought year we saw last year, sedan grass tends to not be, especially the newer varieties get very high in prusic acid like we normally see seen in the back in the 70s and 80s. And then ryegrass you'll see commonly used in Minnesota, Iowa, a little bit in the eastern Dakotas, tends to be a good quality feed as long as you get it put up without the heads in there. You can have some issues with ergot in the seed heads, but horses will like it if you put it up at the right stage. So it depends on you have to take a little bit more precaution on these two species and make sure that you don't have the seed heads in the rye and test your sedan grass for prusic acid and nitrates. One you'll see a lot in the market the last couple of years in particular is foxtail millet. And foxtail millet is not a horse quality feed tends to be high in lignin tends to be very unpalatable. And even when we feed it to cattle, we tend to grind it for cattle feed. It also contains a glucoside called sataria glucoside that can cause liver damage in horses. And so even though it's very common on the market to buy, I would stay away from the foxtail millet. Just one is not very palatable to begin with, but plus it also can cause some issues in terms of toxicity. So when I look at perennial forages, you know, the northern plains probably the two most common grasses that we see fed to horses are the brome grasses and Kentucky bluegrass. If you're actually going to put up hay or develop a hay field, I would not go with Kentucky bluegrass. It just doesn't have the production that the brome grasses will have.  You can get multiple cuttings off of this off of that mix. And it just seems it's a nice option for producers to look at. If you can buy it and find it, it's a great resource for four horses in terms of feed. That's what I feed my horses if I get a chance to is is a metal brome or a metal brome alfalfa mix. Kentucky bluegrass is a very palatable feed for horses, but it has to be put up in the vegetative state or when you just get the heading stage on it. Otherwise it starts to lose some palatability. The one is you get in the Western drier climate to the Dakotas, Montana and Wyoming. You'll see Crestor wheatgrass used a lot in hay mixes, and it is a very good hay feed type. It is typically one that you'd look at for cattle, but it's also a common feed for horses in the Western Dakotas. If you're going to seed it or you're going to purchase some of it or put it up, I would look at the fairway Crested varieties in the picture I have to the right. It shows a number of varieties. You basically have a standard variety, which is the clumpy one. The fairway Crestor wheatgrass in the middle is more of a sod type of grass, so it tends to give you a much denser stand. The negative to it is it also is lower in production, so you do give up some tonnage with the fairway versus the standards. The fairways tend to be higher in crude protein content and also higher in palatability. If I'm going to buy a Crestor wheatgrass, I'm going to ask if it's a standard or a fairway. If I'm going to seed one, four horses, I would go with the fairway types just because you know you're going to get a better quality feed for them. If you are feeding Crested wheatgrass or you're going to buy Crested wheatgrass, you want to make sure you put that up at that boot stage. The bottom picture there shows you Crestor wheatgrass in the heading stage. Horses will not like it, quality will be poor, palatability will be poor, and they're just going to not want to consume it very readily.  So ask those questions and when you put up Crested, make sure it's in the boot stage, which is going to occur really in about four to five weeks in the Northern Plains. So it's one of the earlier maturing grasses that we have out there in the industry. When we look at one that's commonly fed to horses is intermediate wheatgrass. You'll see that in a lot of grass mixes, especially when you're looking at cattle production, because it's a high producing grass. It will grow well on sandy soils, it will grow well on saline soils. So it's one of those grasses that's cheap, it's easy to put in and gives you production. But for horses, it is fair to good at best, especially if it's put up anytime past the boot stage. When you see a mature stand like you're seeing in the bottom picture there, horses will intake will go down because of unpalatability because of high lignin content. So make sure that these wheat grasses are put up at the boot stage. So the picture do you see in the top right? This is actually pre-boot. So it would be a perfect time to put up this grass for horses, and you'll see minimal reviews about the horses if you put it up at the right time. And so when you're buying it, it's also one to look at for intermediate wheatgrass. And of course, most horse producers know Timothy and orchard grass. They're usually probably the cats meow in terms of forage types, especially Timothy as a hay type orchard grass has normally been put into a pasture type of scenario, but you'll find them both in for hay production. The caveat to both Timothy and orchard grass is they make really nice hay when they're put up at the boot stage with not a lot of seed heads. So you can see in this Timothy picture here, you don't see very many seed heads at all. This is a very nice feed. Horses will do very well on it and you'll see very little refusal. On the orchard grass picture in the bottom, you'll see a few seed heads in there, but still that's a nice feed. And so it's just a really good feed if you can get your hands on it. The negative on these two species is they don't tend to do well in North Dakota. We tend to be a little bit too drowdy or we have a little bit too severe winners. And so you get some winter kill on both these species. They actually, Timothy actually has very well in Northern Canada, but they have a lot of snow up there and that protects that grass. So if you do have the snow levels, Timothy will do better. If you're in the western part of North Dakota, especially southeast, these two will do will do pretty good. If you get an open winter that gets cold, that's where you'll see some winter kill. So it's just something to think about. I've been talking to horse producers last couple of years and there's been a number of producers that are putting in Timothy, even in the western Dakotas, because it's such a high quality feed, they're willing to take the risk of losing that stand after three or four years and just coming back with another stand. And so it's just a function of costs in return when you're putting it in. I don't know if you have anywhere from down south, but most horse producers who travel a bit have probably fed Bermuda grass. That is Bermuda grass in the upper picture to the right, very nice feed. If you get your hands on it, the negative on Bermuda grass is that if it does mature out, it tends to be more refusal by horses. If you get way down south and you probably heard of Bahia grass, horse producers in Florida will feed this quite often. To me, it's probably in the bottom of my list because it gets pretty coarse. And then we also hear a lot about tall fescue and the negatives of tall fescue because of the endophytes that you'll see in there. And if you're further down in south and east, there are endophyte-free tall fescue down in the market that you can actually seed and use and mix a really nice horse feed. It's just you want to go at the end of endophytes free ones. The tall fescue, we do not recommend seeding in the northern plains, just not very winter tolerant. So we look at the other side of this in terms of grasses, we can look at legumes. And normally we think about alfalfa or we think about the clovers. I'm an alfalfa guy when it comes to horses. I do like alfalfa in my mix. I haven't been a big fan of the clovers. They tend to just not be quite as palatable. But when you get into Minnesota in particular, you get lower pH soils and alfalfa doesn't do well in those scenarios. And you'll see red clover planted more commonly in Minnesota and Iowa because of the pH soils. And so I would put the red clover as a moderate legume for horses. Else like clovers probably a little better. The white clovers you'll see, I just don't like to use white clovers. It's not very productive. But when you look at alfalfa in particular, I do like alfalfa, especially if I can get an alfalfa grass mix. And you'll see them anywhere from 25% in the stand to 100% in the stand. And it comes down to what you're feeding. If you're feeding young livestock like greenlings or yearlings, you know, the higher alfalfa level will always guarantee you some protein. If you're feeding geldings or mares, you know, you don't need as much alfalfa in the stand. And so it's just a preference. When I'm buying it, though, I do like to ask how much is in the stand because some horses tend to be a little bit touchy with too much alfalfa. And you'll see some foundering or you'll see, normally you'll see foundering more than anything else because of the rich feed. So just something to look at when you're putting it up or when you're going to put a stand in. Also, we saw this last year with blister beetles, you know, ask around and see what if there are blister beetles in an area you're going to buy hay from, or if you have hay you're putting up, see where you're at in those cycles and try and minimize that blister, or at least to be precaution about the blister beetles because they're quite deadly to horses. You know, it's cantheridian toxicity is what you see in the blister beetles. The one we saw in North Dakota last year was actually the gray one versus these more bronze colored ones. It tends to be a little less toxic, but any blister beetle if you get enough consumed by a horse will cause some problems and can cause death. So when we're looking at putting up high quality feed, we're talking about nutritional qualities forages, whether you're putting it up or you're purchasing, you know, with horses tend to be a little finicky and I like to get my hay put up in the vegetative state or with minimal seed heads. For cattle hay, we tend to kind of go a little bit farther beyond that and we'll see some seed heads, if not a lot of seed heads in the mix because it gives, we don't need to quite the quality with a cow. The negatives with you have seed heads in terms of horses is you increase the fiber content, you increase the lignin content, you reduce the protein content, and they also become less palatable. And so you'll see quite a bit more refusal with horses when you get seed heads in there. So picture to my left is a really nice vegetative stand. It's probably still a little early to put that up for hay. But what you're going to look for is lots of leaf tissue and minimal seed heads in that stand when you're putting it up. So if you look at, and I don't have any graphs here, I think I was the only graph I have in the talk, but I'm going to go through this for you because it kind of gives you a feel for what I'm talking about in terms of stage development when putting up hay. So to your left column is crude protein content and most horse producers will look for protein. Most forget about the energy side, but you also need to look at energy as well. And then the bottom side is the growth stage. So your far left is the three leaf stage, which is our turnip for raising redness for livestock. That's third one is your boot stage, and you got the seed set stage and regrowth. And you can see as maturation occurs in our grasses, the quality of protein also declines. You also get a decline in energy as they mature out. And so I like to look at a stand when I'm looking at grass to be about 11% protein, which is my lineup of the cross here. That will meet the requirements of almost most classes of horses you're feeding, unless you're feeding young, young classes of livestock or you're feeding a stallion during the breeding season, or those mayors during early lactation might be a little bit short, but it's kind of a threshold I'll use and I can blend something something off at that stage and I'll reduce my losses then at that time. I'll kind of optimize my production with my quality, if that makes sense. So when you're buying here, putting up hay, you want to stay away from this seed set stage, you can see, not only become quite deficient for a lactating mare, but we also become quite like quite deficient for just maintaining a gelding. And so just something to think about when putting it up. For horses, I like to put everything up at the boot stage, or just after the boot stage when that seed is about to pop through. That should optimize your production and quality of that grass stand. It does vary, you know, brooms is a little bit more forgiving. The quality stays a little bit higher up on the brooms versus the intermediate wheatgrass and crested they don't, you tend to really go poor quality and palatability. So there's something to look at when you're either putting up hay or you're purchasing hay. And of course, alfalfa, the beauty of alfalfa is even the lowest quality alfalfa at the late bloom stage, which is your far right bar is still above 15% protein. So you always got a high quality feed. What people forget about though is, if you ever fed a horse late bloom alfalfa, you see a tremendous amount of refusal. They eat a lot of the leaves. And when you get all said and done, there's a pile of stems in the meat. And that's a function of fiber and lignin content that's occurring at that stage. So I still even though the quality is there, I don't like to buy any hay at that stage. I usually go with either the early bloom or earlier to retain the palatability. And that way I can get almost 100% consumption of that feed and have high quality. You know, even though you can buy late bloom cheaper, if you're getting 30% waste, did you really save any money? So I like to put the alfalfa up at least at the early bloom stage for horses.  And they always will become deficient of nitrogen in that stand and nitrogen is critical for forage production. And so if you're trying to maintain production of not only a hay ground for pat for horse pastures, but also pastures themselves, that you're going to graze, add some nitrogen in that stand to increase or maintain your production. Nitrogen also increases the crude protein value of that hay as well as the energy content and reduces the fiber content. So you actually get a higher palatable, higher quality feed by fertilizing those stands of hay or pasture that you're using for your horses. We typically will put on fertility by about mid-April to early May. I like to get it on, you know, once the snow is off, this year would have been great to have fertility down before those lizards came through and the snow came through because you'd have got really good incorporation of that fertility. You want to do it when the temperatures are below 70 degrees, otherwise you'll see some volatilization and time it with your rain events. You want to have rain follow that fertilizer program to get it incorporated in the soil profile, and then you'll get really good intake by the plants. We typically recommend about 40 to 60 pounds of actual nitrogen every other year, and that's usually in the form of urea, which you can buy at almost any elevator or any dealer will have bags of urea. The urea is about 44% nitrogen. So if you're going to put on 40 pounds of actual nitrogen, you're actually going to spread about 100 pounds of actual urea, if that makes sense. The studies that we've seen at North Dakota State is you can do that every other year and maintain production of that grass stand. And this is just some slide out of a Mandan where there is some work on crested wheatgrass, which you can see on that red line that shows crested wheatgrass as it ages with no fertility. You lose about 50% of your biomass by year seven. And if I carried this trial out to 20 years, that red line stays about the same, about 2000 pounds give or take. And that's a function of being nitrogen deficient in terms of plant growth. And you can see when the added fertilizer in year six, normally the first year you're fertilized, if you haven't fertilized at all in the past, a lot of that's eaten up by the microbial population. So you only see about a 20% bump. So you want to fertilize for two consecutive years, if you haven't fertilized in the past, and you can see you can double your production on that second year. Then you can maintain that production by fertilizing every other year. So it's almost like getting twice as many acres of hay or pasture by maintaining a strong fertility program. And this includes crested wheatgrass, this includes bromegrass, Timothy, orchard grass is really inefficient production and you should almost fertilize orchard grass every year because of its use of nitrogen. And as well as all of those exotic grasses are benefited by fertility. So I'm going to end by talking about purchasing hay and this is true when you put up hay because if you're going to put up hay, you're going to feed it yourself or you're going to sell it. And so these three issues of concern fall, whether you're putting it up or you're purchasing it. And the first thing I look for when I purchase hay, and I purchased basically 100% of my hay for my horses, is I look for molds and dust. If they pass the molds and dust test, then I can look at the next layer or next consideration. So molds and dust need to be properly dried, stored and tight bales. Those are the three things that I look for, or I ask. When I look at palatability and all palatability is taste, you know that will depend on the plant species. What grass did you put up? Courseness, leaf to stem ratio. Obviously, you want more leaves and less stems. And then once I look at the molds and dust and I have a nice leafy hay, then I look at nutritional quality. Do I have the protein? Do I have the energy in the diet? And one thing I look at that most people forget to look at is lignin content. And it's listed as ADL or acid detergent lignin. And for horses, you want that value to be 3.5% or less, or you'll see a refusal of consumption by your horses. And individual horses themselves can be very finicky and you'll see a dramatic decrease in intake on some of these horses if your lignin content is high. And I look at minerals and vitamins as well, but this is kind of my step when I go through this. Molds and dust, palatability, nutritional quality. So let's start with the dust issues and what will drive dust. And so I'll check my hay, buy hay, I pull hay out, I look for dust and molds. Usually if it's white in color, it's a mold. If it's gray in color, it's usually then dirt or dust from a gravel road. Forges that are more prevalent to dust tend to be old hay, unless they're stored in a really good dry area. Bromgrass hay, especially smooth brome, if it's put up a little bit on the damp side can get dusty. And then of course, alfalfa, if put up a little bit off can also get dusty or with some age to it. And then of course, ditch hay. And I always tell producers is try to stay away from ditch hay, but most horse producers are looking for hay. And there's times you will have to buy ditch hay. And so they just make sure that if they're on a gravel road versus a non-gravel road, did it rain before they put it up, that reduced the dust off the roads. And just some things you need to think about because dust in itself will cause some respiratory issues. When we look at these dust issues, the one that I first think about is respiratory issues. They make it heavey. Once a horse can get heavey, they tend to maintain some kind of heaviness in their system once you kind of screw up the lung system in terms of respiration. The dirt and molds can be toxic. And normally when you have a toxic mold that they consume too much, it can lead to either colic and or abortions. And so molds is the first thing I look at. If I have molds, I tend to not buy them because they're going to be an issue. Then I look at dirt and dust within those systems. This is a picture of mold. It's usually white in colors. You can see in this picture, it doesn't come out really well in this picture. But that's just something I look for in terms of molds. Why do molds occur?  The reason we get mold just because the hay was put up too wet. There's times you'll see producers put up hay at that 18% level and can get by with it. Anything over 18% to me is risky. And you get about 20% that you can guarantee you're going to have some heating in that pile and you're going to get some molds. I look for my hay to be at the 14 to 16% level. And most growers, when they get their hay tested, they will show you what the moisture content was when it was put up or when it was sent to the lab. So you're going to have a pretty good feel by looking for that number. If that's going to store well and give you a good quality feed that will not mold throughout the winter months as you're feeding it. You tend to see also some of the molds on the first cutting up haze more than second cutting. That's usually a function because we have a shorter where we got more moisture in the spring. We get tougher conditions to put up hay. And so the first cuttings tend to be more at risk of molds because of poorly put up versus the second cuttings in the third cuttings. And of course, it's more prevalent in the wetter climate. So the Eastern Dakotas, Western Minnesota, because we have higher humidity tends to be tougher to get your haze dry. The Western Dakotas tend to have great times for putting up hay in most years. So I'm also a little bit finicky on bail twine tightness. I like my bales tight. If they're tight, they will shed water better. If they're loose, they will absorb water quicker. And so if you have to store your round bales outside, you want a really tight bail. It could be, especially a net wrap works the best, they will shed better than a loose tight bail. And then what's also important is where it's stored. So if you can obviously, if you can store it inside, you'll be able to retain the quality of that feed longer, because it's not getting exposed to sunlight as well as not getting exposed to moisture. The worst case scenario is buying hay like you see in the right picture there. You'll see producers will stack hay and they stack it for a reason. They don't have the area to keep them all single file on one at a time. So they have to stack them because of space. Whenever you see stacked hay that rain that comes down those crevices goes down those crevices and then it starts to absorb into the piles. So you'll see much more damage and much more risk of molds and then eventually dusts when they're stacked this way. And so I don't like to buy hay in this scenario, unless it's really early in the year. But just think about storage, especially if you're going to sell to a horse producer, they want it to be clean, dry stored inside is the best. And so when you look at palatability, the first thing I look at in terms of palatability and that is will the horse like it and will the horse consume it is how mature was that standard grass or alpha when they put it up. So that's a function of age. Look for this leaves to stem ratio obviously more leaves is better in my example here there's three different hay bales. Obviously that one to the right looks really green and lush and I don't see much for flowers. The one in the middle is very stemmy, obviously was put up more in a course way and that what I'd call that more of as a cattle feed. And the one to the closest to us is probably a grass up alpha mix that's kind of in the middle. I put up a little bit later and probably still make a good feed as long as there's not too many stems in there. Molds and dust will also impact palatability. And so you look for that and then the last one is weeds. When they put that up for hay, were there weeds in there that affected the palatability of that hay? So when you summarize palatability, look for the leaf to stem ratio. Obviously more leaves is better. The picture you see in my right here is I went into a bale I pulled it out, look for the green color, and I'll see a lot of leaves and not a lot of stems. This is a nice quality feed in my mind. The picture to your right on here is we pulled that one out. This is all Kentucky bluegrass. If you're going to feed Kentucky bluegrass, you have to put it up green. And when the seed heads are very young in the stage, so this would be a pretty coarse quality feed to your right that horses won't like very well. The picture to your left shows a lot of leaves. There's a brogue grass bluegrass mix here to your left. You'll see a few seed heads there, but it makes a nice little mix where you have a low, low, a higher leaf to stem ratio. And then the last thing I have here is actually looking for weeds. And when you get in some of these weeds, they can really impact intake if they're high in the bale. So the one I look for the most, especially in the Dakotas is Foxtail barley. That's a picture of Foxtail barley to your right. Tends to have a barbed flower. Horses do not like it. They would refuse to eat it if they had their choice. And when they, if it's part of a mix, those barbs can actually get in the mouth of a horse and kind of get stuck in their gooms and contend to have some issues in terms of pain in the gooms, as well as also then impacting intake. This is a hay bale that I broke open and you can see in this picture, all of them light yellow colors is all Foxtail barley in that mix. And this is just a poor quality feed that if you were to look at it, you would not buy this. If you're putting up hay and you have Foxtail barley patches within that field, I would go, I would not even put them up for hay or if you did cut them, try and bail them separately so that you don't feed them to horses. I actually don't like feeding it to cattle as well. We've had some issues with heifers feeding on this and having some problems with lump John in the mouth of cattle as well. One that's commonly a poor quality feed and it gets to be weedy as mature pigeon grass. So in this picture, you can see seed heads of pigeon grass, very impalatable horses will not like it. This pigeon grass seeds can also get lodged in the mouth. We've also seen it get lodged get it compacted because it's such a small area. You can get some compaction within within the colon large of the large intestine. This is one of them things that I stay away from in terms of horses is pigeon grass in particular. And I'll ask that question when I'm buying hay, is there much pigeon grass or Foxtail barley in that mix? The other one is pigweeds and horses do not like pigweeds. Pigweeds also can get high in nitrogen. And so when I'm buying hay, I'm looking for the pigweed and it's just if there's a lot of pigweed in there, try not to put it up and try and do not buy it. It's just going to be refusal in terms of life of horses in terms of consumption. And the last two probably don't take much to talk about, you know, Russian thistle and Kosha. Here's a field that's got a lot of Kosha in it. You know, if you're putting that up for horses, don't put it up at all. You can put that up for cattle. Cattle will actually consume that. Horses will probably not. And the last one of course is cocklebirds. And no one likes to see a lot of cocklebirds in a hay bale because they end up being in the main and the tail of the horses. And then you got to deal with that at a later state. So look for those weeds. So I'm going to finish up here by saying once you know the hay is a safe feed, then look at nutritional quality. When you're purchasing or feeding a hay, get the nutritional status. Most reputable hay producers will get their hay tested and will give you the quality of that feed as well as the moisture content of that feed. I do like to look at relative feed value. It's really used mainly to see for the marketing side of hay. But for alfalfa, I like to see a relative feed value of above 140 for horses. And for grasses, I like to see it above 100. You will rarely see 140 relative feed value on a grass just doesn't happen. But 140 relative feed value on grass is usually a really leafy grass that horses will have will really enjoy consuming. I look for protein value. Depending on what I'm feeding, you know, I look for higher quality, higher protein value if I have lactating mayors or young horses. Or if I'm using a stallion, if I have geldings or open mayors, you know, I can go a little bit less on that protein because it'll reduce your costs. Then, of course, I look at lignin content. Remember, 3.5% or less lignin content is what you're shooting for when you buy it. If you put it up for hay, you want to put it up in the immature stage or that boot stage to reduce the lignin content. There are certain grasses that tend to just be high in lignin content. The wheat grasses tend to be high in lignin content. And so this is something you have to deal with when it comes to feeding them. And so once you do nutritional quality, like we talked about, buy what you need. If you don't need to buy a bunch of alfalfa because you're feeding geldings, buy what you need to blend off to give the meat their nutritional quality. There's no reason to overfeed a horse.  From there, I'm going to stop and I can open it up for questions or we can go on and then we can take questions later. So I think we'll stop for just a second and let Rachel share her screen and go over a couple things and then we'll come back and open it up for questions for both Kevin and Rachel. So real quick, I'm just going to talk about testing the nutritional value of hay. So if you have bought hay that maybe the person selling it to you has not tested yet, and you want to get an idea of what it is or what you have just in case you need to buy more a supplement. Testing hay is the easiest and best way to do it. So what you can see here on the, for this right is a hay probe. The nice thing about this hay probe is, is like in the picture you can see this agent is coming from the side of the bale is pushing all the way through to the center of the court. So that core gives you an overall look of what's, what's going on in that bale, and hopefully what's going on in the field. Ideally, when you get a core sample or when you get a sample of a lot of hay, a lot being, you know, maybe a semi load of hay that you've purchased. You're going to want to either, if it's in lower amounts, if you have just 20 bales, probably test all of them to get an idea of what's going on in the, for nutritional value in those bales. If you have, you know, more than 20 bales or if you're upwards of 100, usually the rule of thumb is about 10% of those bales is what you're going to test. So you're going to take your core samples from each one of those bales that you test. You're going to put it into a bucket and you're going to mix it up and then you're going to put it in a plastic baggie and send it off to the, the place that you'll be testing. Now, a lot of times, if you don't have a place that you test, you can always talk to your local extension agent and they can, they can help you either find, find a location or help you get it sent off. If you don't have any experience in, in testing forages, you get a little bit of expertise from your local extension agent there. Usually you're going to send it one sample off for a lot, like I'd said, and that, that'll run you around 25 to $35, depending upon where you send it. And the results you get back, you'll be able to utilize your extension agent for that as well to see, see what it means. And a lot of the stuff that Kevin talked about today, crude protein, relative feed value, the lignin is all going to go into that as well, the energy value as well. So that'll, that'll determine, if you have met your needs, it also determine, you know, which kind of horses you'll be feeding that feed in specifically. So if you have some aged horses that aren't doing anything reproductively, you might be able to get away with some lower quality feed, or if you have some higher producing horses that are maybe pregnant or nursing or higher quality performance horses, those guys are going to need, you know, some of that better quality hay like, like Kevin had talked about. But that's just kind of a quick rundown of sampling your nutritional value and your hay, and maybe why it's needed. I know there is one question in the chat box, Mary, that I was going to maybe have you answer just a little bit of it or we can tag team it. Is that the manure question? Yes. Okay. My plan was to, I want to see what Kevin says about using manure on pasture, because we've talked about this before. So, Kevin, the question was, can you use manure on to fertilize your hayland or pasture and can it be spread in the fall? So I was just typing in there on that question. It's a great question because, you know, manure on pasture, especially hay ground or exotic pastures like crested wheat grass or brome is an option. It's a good option. The trick is you don't want to get too thick to where you actually impact sunlight and plant growth. So the next generation will be used by those plants and falls a good time, in my opinion, because it will break down over the winter time and you'll get the use of it in the spring. And so I would say as long as it's not too thick, it's a safe, very good option for that manure. Yes, to everything Kevin said. Same. Same answer here. And then, Kevin, let's address it as well on pasture using your own pasture. Oh, so I would, it pastures the same range as do not spread on virgin prairie or rangelands. So when I talked about pasture, I'm talking about a bromegrass pasture or crested pasture, then you're fine. But if you do it on native range, it really, the manure always favors cool season grasses. And so on native range, we have a mix of cool and warm seasons, you will actually start to lose your warm seasons, just like any fertilizer on range. So it's a good option on those pastures. And then if you are going to graze that after you spread per parasite video that we did a couple years ago, we say wait at least 14 to 21 days. We want that we want to spread thin again, because if it's thick, it's going to be harder for the sun to kill those parasites as we want it thin if we're using actual raw manure so for not composting it to kill those parasites. So we want to make sure that we're spreading it thin and leaving 14 to 21 days so that the parasites can go through their cycle, but also hopefully then it's warm enough that the sun will kill them as well. You read my mind, Mary. Yeah. So I still have another question. How late can you fertilize them because we just have one pasture. The horses are generally on it year round. But you know as it gets cold and and the, the grass kind of goes dormant we bring you know they start eating hay. Can we fertilize late late like that when they've started eating hay. It was just hard for us to keep them off for 14 to 21 days I guess is what I'm saying. So do you mean you mean in terms of manure. I mean, you can correct me if I'm wrong here, Mary, but if you spend your manure in the fall, you know, obviously you have a freeze so you don't have parasite issues anymore. In the spring when that it'll break down over the wintertime to some level, will you still have a parasite issue should you wait that 14 21 days. After certain temperature, so you can minimize parasite load. That's a hard question. I was going to say that that's a hard question I think I might have to defer to Dr hammer on this one in. And maybe Mindy answer you back or answer everybody when I send out the video. And so I can follow up on that just to make sure on that question. And as far as it's so as far as spreading though you said you know can we spread that late spreading, especially horse manure, because it's it breaks down really easily. It's less of a concern to me that you're spreading a little bit later into the season, or later into the spring as well. And so, as far as when you're spreading it I think you can spread at any time and still get those benefits. And then the one thing that Kevin had said with fertilizer, it goes for manure as well is, we need some moisture for that fertilizer value to become available. And so like last year where people were spreading manure but it wasn't raining. It was really hard to get that actual nitrogen to come out of that product and so we want to make sure that that's just kind of something we're keeping in mind to we don't spread manure during a rain event but right. Following a rain event or prior to where we know there's not going to be runoff issues. That's a that's a really good idea just like for fertilizer. And so Mindy I will follow up with Dr. Hammer on that question. Thank you. Kevin if you wanted to, I don't know if everyone's seen the chat. Talk about the, the low elf Elphamix with hay being fed to a donkey. That's a great question. I mean it's a, I don't give donkey questions very often. I think the important part of that question though is, is, is low Elphamix and a grass mix sufficient for donkey. And it comes down to what you talked about. You need to test that forage. So, and I do is what I feed a lot of different classes of horses from babies to yearlings to to breadmars. And so I test every one of my feed stuffs. And so if you can test whatever if you have a low Elphamix test that you'll know what the protein value is. You'll also know where your calcium and phosphorus levels are and you can get the lignin content. And so once you meet that, you can see, do you meet the quality of that donkey?  Once you meet that quality, then if you know it's a safety, I mean safe in terms of that donkey should be able to retain body weight or gain body weight depending on what your objective is on that donkey. So that's where it's important to test your feeds. Other questions on hey, hey management. Land management. Or testing for nutrition. If not, somebody had asked earlier if this is being recorded and yes it is so you can, you can show it to all of your, I believe Wendy said hey put her uppers. So they can make sure they're on the right page. And with this timely rains that we're getting in some parts of the state we might have some hey this year more available than it has been the last year and a half or two years so let's make sure we're putting it up good. Kevin or Rachel anything else to add. For me the biggest thing we're putting up good quality hay is getting it dry enough for you put it up. Make sure you're at that 1614 16% protein. And you don't want to get too low, you know something people go down to that 11% and they lose a lot of leaves and it gets shattered so that 1416% is a really good level. When putting up a good quality feed and look for the lower the number of heads the better the quality feeds you're gonna have seed heads. Okay, very good. Usually your extension agent local extension agent has the hate probe that you can borrow if you don't have one on your own or if your feed stuff is not been tested. Right. So with that we'll be back next week for our fourth and final webinar this spring. And so we are going to be talking about bedding management so Dr. Carrie hammer is going to join us and share some information that she has from a research standpoint on bedding management so come back then. Thanks everybody.


This is where we are stopped. We have written an expression for energy of helium atom in terms of the spin orbitals and the Hamiltonian. Actually, I should have written it using power point like I do but then it is too tedious. So, I decided that I should subject you to my bad handwriting at least once sorry about that. Now, let me do something. Let me try and expand this a little bit not all little bit. So, what are we trying to do here? We are trying to say what is the role of this spin part of the wave function? We have already given you the answer the expression for energy but there there was no spin part only the special part of the orbital was there. So, we are going to convince you now that that is okay we can take care of the spin part or rather the spin parts sort of take care of themselves we will see how. Now, here when we expand what will the first term be for the first term I can take this and H1 and this. So, the first time is going to be something like integral phi 1 alpha 1 phi 1 beta 2 H1 operating on the same wave function phi 1 alpha 1 phi 1 beta 2 plus there will be more terms we will perhaps write one or two of those but before that let me try to see and let me try to make sense of this integral. So, remember this integral is really not a single exponent a single integral. So, what are the parameters here there has to be something in terms of there has to be DR1 there has to be DR2 and there has to be DS spin also. So, it is actually a triple integral. So, in principle I should be able to separate it out into a product of maybe 3 integrals can we do that let us see. So, first of all I can take this spin part out I hope you understand what I am talking about this here is really integral integral integral whatever we have in terms of DR1 DR2 DS I can say. So, I want to write it as integral of the spin part DS multiplied by integral of the R1 dependent part with respect to DR1 and integral of the R2 dependent part DR2. It is just that we are using bracket notation nothing else. So, we can take the spin part out and write an integral for itself that will be integral alpha 1 alpha 1 star alpha 1 overall space that is gone because remember what is this phi 1 alpha 1 it is really phi 1 1 alpha 1 that means electron number 1 has alpha spin and resides in spatial orbital phi 1 this has gone out. Next what do I have the spatial part also I have coordinates of your well no that is all there is one more not spatial part I have another spin part that is beta 2 yeah beta 2 and beta 1 beta 2 and beta 2 my handwriting is so bad that I myself am getting confused. So, can blame you for getting confused here sorry about that. So, this is what we are talking about beta 2 and beta 2. So, second integral that comes out is beta 2 beta 2 beta 2 in bra beta 2 in ket what remains a spatial part is phi 1 1 h 1 operating on phi 1 1 how did I get this phi 1 1 from here let us not forget that what we have written here this phi 1 alpha etc these are spin orbitals. So, there are products of a spatial part and a spin part right. So, I have to write one in brackets in both. So, now just look at these look at these integrals spin wave functions are normalized this is equal to 1 this is equal to 1 and this what is this this is equal to i yeah j equal to 1 r j this small j is equal to 1 minus del j square by 2 minus z by r j this is equal to h 1 as we have defined and that operates on phi 1 j. So, this is basically i 1. So, the first term remember we are only writing the first term now first term becomes i 1 from here neglecting the we are not really working with the normalization constant we are just working with the remaining wave function that is fine. So, you see that we are actually getting those integrals which do not contain the spin parts the spin parts sort of take care of themselves by normalization right normalization that is all. Now what more can we do here let us take something else what is the second integral going to be second integral is going to be say I will take this one minus phi 1 what am I writing here. So, we will write here so, second one will be minus phi 1 alpha 2 phi 1 beta 1 h 1 then I will take this minus. So, minus minus it will become plus and the integral will be something like phi 1 alpha 2 phi 1 beta 1 what did I say I will take h 1 or h 2 let us take h 1 h 1 phi 1 alpha 2 phi 1 beta 1 I hope it is not very difficult to see that by similar treatment we are going to get i 1 once again because what do you have you will have phi 1 1 h 1 phi 1 1 same thing again you have alpha 2 alpha 2 that is 1 beta 1 beta 1 that is 1 so again you will get i 1 from there. So, you see how this expression i 1 comes in this in the expression for in how this integral i 1 comes in the expression for energy. Now let me clear this up a little bit well all the terms are there I am just not writing all the terms I am trying to just expand and see what happens. Now let us take a different combination of terms we have already written 2 terms.  So, what will that integral be now plus integral alpha phi 1 alpha 1 phi 1 beta 2 h 1 and now taking the second one so see this will not be plus this will be minus and the second one is phi 1 alpha 2 phi 1 beta 1. Now let us see if things get more interesting.  So, what I get here is well even for going there here we have alpha 1 and here you have beta 1. So, you get alpha 1 you get beta 1 multiply them together and integrate over all space what do you get you get 0 because they normalize. So, what I am trying to say is that lot of these terms actually become equal to 0 right and then when you go a little further when you expand upon this r i j term you are going to get what is called this j i j 1 1 term i equal to j here. So, there is no problem you just can take this j 1 1 right. So, this is how you can expand see just for helium it is so long that we are not having the patients to work it out. So, imagine what it will be for an n electron atom where n is a large number it is going to be huge. But we just demonstrated I hope this demonstration was not confusing for you you just try to work it out yourself you will be convinced that you will be able to write the expression of energy in terms of these integrals. For helium what happens for helium first of all I will write this i 1 i 1 so i 1 plus i 2 but i 1 plus i 2 are 1 and the same right. So, you can write what expression you get from there and here you will write k i j equal to j i j where well again i and j are 1 1 so you can write 2 j 1 1 minus j 1 1 that will be 1 j 1 1 and then you can substitute you will get the expression for energy for helium. But the story does not stop here we have learned variational method. So, you know that this expression that we have got now we have to minimize we have to find the minimum value of the energy that we get from this expression right. How you do that in variation method you just minimize it right and when you minimize you end up getting equations like this you get a Fock operator this is called a Fock I will show you the form of Fock operator or maybe I will not I will tell you what Fock operator is made up of if you want to know the form you are welcome to consult McQuarrie's book or Pillars book it is written there well Pillars book not very sure McQuarrie's book definitely. So, Fi operating on Phi i gives me epsilon i Phi i that is the kind of equation that we will get. So, these Fi's are made up of these integrals essentially it is something like an expression analogous to the expression of Hamiltonian but with the functions in it you just expand it and how many n values are there there are well 1 2 3 4 5 6 up to n i values that they are not n right. So, that is the number of orbitals that are there remember we had said that we have n orbitals and we can we can put in maximum of 2 electrons in them. So, you can accommodate 2 electrons in this n number of orbitals. So, what we get then is this this kind of equations using Fock operator for this again this is like an Eigen value equation Fock operator operating on a wave function gives me back the wave function multiplied by epsilon i I get n number of equations and these are n coupled equations because these wave functions are not really independent of each other are they right they are not. So, what do you do with these n coupled equations you solve them numerically by using your self consistent field method. What is the initial guess value that you use the initial guess value that you use is of your linear combination of stator determinants. So, essentially what you do here is that you write this expression get Fock operator how do you get Fock operator fix Fock operator will also contain this phi is remember. So, it is not a simple differential equation it is exactly well very similar to what we have done earlier. So, to generate the Fock operator you need the guess values and the guess values that you get are linear combinations of stator equations I thought I have read them written below here looks like I did not write sorry about that. So, start with the stator determinants start with orbitals start with hydrogen atom orbitals stator determinants involving hydrogen atom orbitals and construct the Fock operator. Let the Fock operators operate on the wave functions and write down the n coupled equations solve them numerically using the self consistent field method then you get the next set of Fock operator of these wave functions use these wave functions to generate the next generation of Fock operators and then go on until self-consistence is obtained and once again this becomes a computational problem. That brings us to an end of the discussion that we wanted to perform and let us not pretend that we have discussed everything that is way beyond the scope of this course in fact the course has become much more than what I initially intended it to be. So, we are not going to go into further detail let us hope that we will be able to have another NPTEL course on advanced topics in quantum chemistry if you are successful in that then we will start from here and talk about more advanced methods because you might remember I told you that a practitioner of quantum chemistry once told me that for him quantum mechanics begins where Hartree Fock ends but for the purpose of this course it ends well at least for atoms it ends where Hartree Fock ends. The reason for doing this discussion in the first place is that we wanted to make certain points which are useful not only for these many electron atoms but also for molecules remember the course is quantum chemistry of atoms and molecules. So, the points that we have made in this discussion are these first of all you have to use approximation techniques and the techniques we have learned are perturbation theory techniques and variation methods using variation method you can get upper limits of energies using perturbation theory you can actually do an accurate calculation if you go to high level well higher order perturbation correction terms and provided the perturbation is does not change the system too much from the ideal system and the problem here is that there has to be a system for which an exact solution of Schrodinger equation must be there that requirement is not there in variation method that is why it is so popular. But then you cannot do it at one go for most of the systems for initial systems that we tried for systems where we knew the exact solutions we did them at one go. But then gradually we learned that the only way out the only way to tackle the problem of many electron atoms and systems as complex as these is to resort to iterative techniques and the techniques that you use are called self consistent field methods in which you guess a wave function you construct an effective potential using those guess values of wave function then find the solution of that equation because the problem remember even though I am saying it many times I will say it again the problem with this kind of approach Hartree-Foev approach is that the operator itself contains the function. So, unless you start with some kind of a guess value of function you cannot really get going. So, to get going we give some guess value and that guess value or that guess cannot be any guess some sort of sense has to be there in the guess. But eventually we have learned that we do not have to stick to the exact solutions at all we can take anything. So Gaussian exponential many things we talked about different kinds of orbitals and finally what we have shown you very sketchily is that by using this kind of SCF calculation using Hartree-Fock method using variational method one can try and solve get energy values for complex many atom systems. What I am not going to say but I request you to read from Macquarie's quantum chemistry book or Prasad's book or Chandra's book any book that you like is what we have actually studied in class 11-12. Remember for many electron atoms we had talked about variation of ionization energy sawtooth variation we had talked about variation of electronegativity so on and so forth. Actually when you do this kind of a an SCF calculation you get results by which you can get very very close to the experimental values. So this sawtooth variation where you see signatures of this main shell and sub shell that can be actually modeled very nicely using Hartree-Fock method SCF calculations. So I would like you to read that part because that is just story more of a story than what the story I have told you over the last two modules. So please read those by yourselves and refresh your memories and also understand to a little better extent I hope I hope why you get that kind of a trend for many electron atom we are not going to discuss that explicitly here that brings us to an end of this part of the discussion that brings us to an end of the discussion of atoms but the concepts that we have generated here exchange integral uh Coulomb integral okay and remember something called S integral of phi i phi j overall space all these integrals are going to come handy in the subsequent discussion that we are now going to perform on quantum chemistry of molecules and there we are going to talk about two approaches valence bond theory molecular orbital theory I suspect all of you have heard of all this which is that we hope that we will be able to take our understanding to like one notch higher not complete but one notch higher than whatever it is at the moment right. So next day we start talking about quantum chemistry of molecules.


I think we're gonna go ahead and get started. Thank y'all all for coming. Welcome to RubyConf. Appreciate all being here. So my name is Megan Tew. I'm a senior software engineer at CallRail and I'm the co-organizer of the Atlanta chapter of Rails Girls. Yeah, Rails Girls is awesome. And you can also find me at Megan Tew on Twitter and on GitHub and most other internet places. So talking about finding beauty in the mundane, that could probably mean a lot of things. But what I mean as software developers, we can't love every part of our jobs, right, as much as we'd like to. Some things are just less fun than others. Some things are boring or tedious, but we have to get them done. But how can we love our jobs more? How can we love these parts of our jobs more? Well, I believe that in order to fully relish our work, we must understand the frustrations we have with these aggravating parts of software development and change our perspectives in order to better our teams and our software. And I believe the best change in perspective we can have is to focus on empathy. When we're constantly mindful of the people that are touching our code and our software and what their needs are, we'll build better systems for everyone. Because at the end of the day, all computer problems are people problems. And if we solve our computer problems like we solve our people problems, we'll build better software and develop better connections with our team.  One reason that's important for us to address our feelings about these mundane parts of development is to combat tech debt. So when you move fast and you create quickly, you're probably not doing your best work, things the best way, right, and things to the slip through the cracks. And much like financial debt, that tends to pile up when it's not dealt with. And the reality is we've all got it, but most often we don't have time to deal with it, right? And the way we emotionally cope with the reality of tech debt is a spectrum. So on the one end, it just doesn't faze you. You don't really think about it, you just know it's there. And on the other end, it gnaws at you with every waking moment and you're constantly thinking about the ways you need to improve. And unfortunately for me, I'm more of the latter. I've definitely spent sleepless nights thinking about untested code and classes that needed to be restructured. And that's because I know we can do better. All of us here, not just me and my teams. And we can be better at building software and being happy with our applications. But the reality is that it's really not that flashy, right? We can't constantly be churning out these huge, exciting new features. That pace just isn't sustainable. And we get hit with a good dose of reality when our applications start breaking under the weight of our tech debt. And as we grow as developers, it's important to learn the value of resolving tech debt. In the book, Apprenticeship Patterns, David Hoover, and Adelaide Oceanier, one of their most notable pieces of advice is what's the grungiest task that your team has been putting off for months? It'll be the one that everyone complains about and no one wants to tackle. Tackle it. Don't just hold your nose and force yourself to do it. See if you can creatively resolve the problem in a way that exceeds people's expectations and makes it fun for you. And at the end of the day, what we do is so much more than code, best practices, or prestige of any kind. It's about respect for our teammates, both current and future. It's about respect for our users. It's about respect for ourselves. At the end of the day, when we learn to love our work, hopefully our teams can be happier and work better together. So how can we change our perspective on these mundane tasks? I'm gonna cover five different things that we could probably all stand to like a little bit more and ways to enjoy them. So the first is updating dependencies, be it packages, gems, or libraries. All of our applications rely on other people's code to run. And but why do we often resist updating gems and updating rails? Well, maybe your gem file is better measured in feet in lines of code. Maybe running bundle update rails creates like a never ending cascade of red bundler text. Where would you even start with that? It could take days, weeks, months, maybe years for a big Rails upgrade, right? And if your code runs, why do it at all? Common concerns, right? For one, we get more secure applications. When we think about what our users want, they want their data to be secure, right?  There could be vulnerabilities hiding in an old version of a gem that you're using and you might not even know it. But updating patch versions is low risk and high reward. Because they usually only contain fixes, you can be pretty confident knowing things won't break. So you get that added stability that you wouldn't have had otherwise. And it's just a small amount of effort. Upgrading is also a great way to gain more exposure to the open source community. So as you are tracking down issues with new versions, you're reading change logs, you're finding out if support for a new Rails version is gonna be added to a gem that you're using, you'll become more in tune with where the community is gathering and how they communicate. And this process just gets easier over time. So it's easier for you to contribute back to OSS2 when you're ready. Upgrading also gives us valuable debugging experience. So you get to dig through your system and find breakages in a safe environment. So as you're upgrading and you see a test of yours fails, as long as you know something's broken, it's not going to production, right? So users won't see it and there's significantly less urgency in fixing the problem. It's a very safe way to gain valuable debugging experience that I often recommend for junior developers. And you get that valuable debugging experience without the stress of tracking down production issues with that temporal sensitivity. It also gives us use of supported versions when we're upgrading. So you don't wanna be in a situation where you find a bug in a gem that you're using only to find that the version isn't supported any longer and no one's gonna resolve the bug that you and you have to fork it and then you're stuck maintaining that fork and trying to update it on your own. It's a tedious process but keeping up to date with things means there's likely gonna be someone else there to lend a hand. And then especially like relevant thing is that Rails 4.2 right now is only receiving severe security matches, like not even minor or moderate. And that still doesn't seem like a very old version, right? And according to the Rails documentation, like 5.1 is the only one receiving bug fixes officially. Like if you're not up to date, you're not getting those fixes. And again, upgrading is, for some people, like pulling teeth and nails. But when I'm updating, I try to feel like I'm fighting a boss in a video game. So our application's health is the princess in the castle that I've gotta go save. And I like to take small steps when I'm doing it. Go gem by gem. And that's like knocking out the small guys first. And each gem that successfully bundles without any conflict, that's like a headshot straight to the boss. That's like really valuable damage that's going little by little. It's really important. And then finally, when I'm updating Rails, that's the boss itself. When all the bundler like dependencies resolve, I get all that green text, it feels awesome. This is a job well done and you can learn a whole lot in the process. It feels really good to be more in tune with your system and the greater community. So next up to tackle is writing documentation. Now this is one we all know we should have, but usually don't have enough of, if any. And so for the purposes of this talk, I'm referring to internal documentation for your code and your systems. So like comments in your code or a wiki. And like it has the express purpose of explaining the way that your company's technology works to the people that work there. Why don't we often like writing docs? Well, imagine like you're just finished writing a big feature and it's all tested and QA give the green light, but there's no documentation. So all, if like another developer wanted to come on the project and work on this feature, they'd just left reading code and there's not a lot of clarity there, right? You wouldn't want that to necessarily hold up the feature release, right? But we used to thinking in computer languages for the better part of the day, it can be like really difficult to transition into thinking in human languages to write documentation. I could really give like an entire talk on writing good documentation. So I'll try to keep this brief, but one of the many reasons they're great is they help spread knowledge. And like we know commonly like knowledge is power, right? But especially so in the context of complicated systems that we need to work together to try to understand. Docs also help prevent silos. So without good documentation, knowledge stays concentrated in the brains of those that built a feature. So with good documentation, anyone can go and read about how a thing works. It's empowering. They also help make onboarding easy so that developers that are new to your team spend much less time digging for answers and to certain questions or even worse clues to where those answers might be and then they just keep digging at Infinitum. But, and aiding and onboarding is really just one way that they help others. It helps them in a myriad of ways, including developers that are new to your team. So at any level of experience, like how can you navigate a new code base without direction, right? Docs provide that direction. They also help your current teammates work with the things that you've made so they know which end is up. They're not just going in blindly trying to fix things without any guidance. Docs are that guidance. Future developers too, they help. So these are people that you don't even know yet. Maybe everyone on your team right now knows exactly how the complex authentication system you've built works. So that's great. But what about when a new developer comes on? Will they be able to look at it and just instantly know? There's gotta be a way to share that knowledge and the best way is having documentation. They also help support team members at your organization, diagnose and fix problems so that they can go out and actually find out how something works instead of having to ask a developer all the time. They get that agency and they're more independent. And of course, docs will help you too. If I told you that I'd never written documentation so that specifically I would be able to answer the question, wait, how does that work again? I would definitely be lying. You in a few months will have as little context as someone that's brand new to the code base. You will definitely forget why you made certain development decisions. So documenting now will prevent lots of future frustration. As we see writing docs are a concrete way to help other people that are touching our code and using our systems. And we use a little empathy. We have direction and purpose in writing docs. By writing documentation, we empower other people. We say, here, this is yours too. You get to share in that knowledge. So maybe at your organization you don't have any docs or much at all, right? Where's a good place to start? I like to make a glossary of common terms. So usually business domain specific lingo at your company. So I like to include common acronyms. A good example of this is that our company, we deal with lots of telephony things. So there's a modal where users can purchase a phone number from us. We call that the new number modal, an NNM. But someone knew the organization's not just going to know what an NNM is, right? So we have that glossary defined, have it defined in the glossary so they know exactly what that means. Another good thing to do with this glossary is include links to the code base that use these terms heavily, things like database models. Where you can define the term in English and then define it in the code. And that's that bridge in the gap of knowledge, right? This makes it really easy for new folks to follow the conversation early and no terms that are relative to the system so they can understand what everybody else is talking about quicker and they can be more productive faster. Another technique that's really helpful is commenting your code as you write it. A lot of times when we think about writing documentation we think about going and documenting like entire systems or big parts of systems at once and that's the kind of thing that takes like a long time and that's what gives writing documentation a bad rap. But if you're writing code, if you're writing comments as you write your code it's a lot simpler. So if you're making a new class just add a top level comment describing what it does and how it's used. And you can do the same thing for new methods too where appropriate. And there are tools like Yard that turn your code comments into navigable documentation that are super helpful because when you can have a specific place to point developers that are new to your team they'll feel ecstatic. Because our jobs are to solve hard problems not spend valuable resources deciphering spaghetti systems. It feels really good to have those basics laid out for you so you can be more effective at your job earlier. Another thing new developers love seeing when they're entering an app for the first time is tests. So specifically you're writing on made tests as part of the software development process as our jobs as developers not leaving that up to QA. And this helps devs that are new to your team because reading tests is a really great way to find out how parts of a system work. Diving blindly into a code base without tests feels kind of like this. Like maybe if I make a change this will continue to work but I don't really know. And we can just hope for the best that it'll keep on spinning. But why don't we like writing tests? So as Rubyists often in the community like it's generally accepted we write tests right it's a big part of our time but I still run into the mindset a lot that it's like it's not worth your time I just gotta keep writing code I don't have time to write tests or I hear the argument that you can just test the code in your browser and verify that it works why would I need to write tests. For when we get more reliable software you will find the actual points of failure as you're building. You can only hand test so many like paths a user might go down but with automation it's so much easier. And you have a easy way to tell when something goes awry. Tests also allow for refactoring with peace of mind. So this is that red green refactoring model so that if you're starting refactoring with a green test suite you can make a change run your tests. If they're green great just keep refactoring but if they're red you can address a problem as it comes up and not wait until it goes to production and then fix it till it's green and keep going. And this acts as a safeguard so that we know we won't be breaking our software. And finally so far in my development career I don't think any feeling has matched the first time I made a test pass and that a group of test pass and it feels really good because you know that the thing you made works you can actually verify it. And as developers we're not the only ones that need testing. So chefs in fine dining restaurants don't just make up menu items on the fly. They do many rounds of meticulous tests first to make sure that the dish is just right and only then once it passes tests can that product be served to customers. And this is how we should be developing our software because we care about our users.  Properly tested applications make you calmer and make work more peaceful. This dog is like I am at one with my application. And you can make this feeling possible for your teammates when you ensure that your code that you're working on is properly tested. So another way we can build better systems for happier developers is linting. So if you're not familiar it's the automated process that goes through each file line by line ensuring your code conforms to a specific style. And it raises warnings when it doesn't so you can go fix them. Think tools like RuboCop for us or ESLint if you're using JavaScript. Why don't we like linting? I think it tends to get a bad rap because it's really tedious and you're making all these small changes. And it can be a lot, especially when you see something like this which is an actual RuboCop warning output from a project I've worked on in the past. And an amount of problems that large seems insurmountable. What benefit could we possibly have by taking the time to do this? Believe it or not I actually think this is an opportunity for a quick win. So if you go file by file step by step it'll feel like nothing. So I have a co-worker that when she's starting a new task she likes to check out every file that she's gonna have to touch and then lint all of them first so that she can have a clean workspace to start and she's already bettering the code base in the process. Just like when you're updating gems breaking it down into smaller parts it's totally doable. So you can just lint a file, PR that and then repeat and you'll have things shipping on a regular basis and you're constantly making things better for your co-workers. Linting is also an opportunity to learn best practices especially if you're just getting started with programming linters are a really great way to know how you're doing because they're built on community created style rules writing your code with the help of linters ensures that your work conforms to commonly agreed upon practices. And it also gives us a more consistent code base. So when all your code conforms to the same style rules it'll be much easier to read. Developers on your team won't get whiplash from going from one file to the next because they're written in totally different styles. Instead it will be seamless and your code can flow from one file to the next. When you finally get it your code base is cleansed. So something that really helps in the linting process is establishing a style guide. So you can sit down with your team and decide how you'd like your code base to look. New code won't raise nearly as many linter errors because you've decided to write your code in a certain way. And you can tune your linters to the team that your team agrees on. So if you don't like Rubikop's rule of that line it should be 80 characters long. Maybe they should be 160. You can put that in your Rubikop config. And to make linting more fun I like to think of it as playing Galaga.   With each linter warning you resolve you're making your code base better and better. And at the end when you beat the game you defeat all the aliens you feel free. And your code base is a lot more consistent. And it's so much easier for new teammates to get working in your applications because they'll know how the system is supposed to work. They'll spend less mental energy trying to figure out the styling that you've come up with, right? By using a little empathy. Knowing that our teammates want to read a consistent code base makes linting way more rewarding. So our final task for the day is refactoring. A lot of folks don't like refactoring but this is the goal, like something with the... All right. I guess we're doing that now. Thank you. Yeah, refactoring. All right, so I think we're gonna go back and get started. Thanks for sticking around. Never a dull moment at Rubikop.  Yes, exactly. My talk is actually on fire. All right, so thanks for coming back and sticking around. I wanted to talk about refactoring and how it's a great way for... It's our final task that we were gonna be covering. So refactoring, anything with the goal of making your code easier to understand. So this could be big or small within one file or across multiple classes. You could be changing syntax or actually changing the overall architecture of your system. Why do we not tend to like refactoring? Well, for one, it's hard, right? Especially for those bigger system-wide refactors. Why refactor a bunch of old, complicated code when you can be writing fun new features somewhere else? You can take a lot of time, especially if your refactor was to span tens of hundreds of classes with like hundreds to thousands of lines each. Well, for one thing, sometimes it's just necessary to do, right? And one sign of this is that you're spending all day staring at a couple files, just trying to figure out how they work and how they work together, what they're doing. At the end of the day, we all want readable code. Our jobs are to solve hard problems, not spend valuable resources deciphering spaghetti code. If possible, we should always take the opportunity to make our and our teammates' lives easier by reducing that mental strain that comes with having to process complexity. And I think refactoring's pretty cool. It's the closest we have to visual art, especially for backend developers like me that rarely, if ever, touch the front end. As we cut up, move around, and transform our code, we're artists. So the next time you're refactoring, picture your code as paint and your files at the campus and make something stunning. So let's take this method that finds the first n prime numbers when you pass n as an integer. So if we're starting from the top, you've got a couple different conditionals over there, unless this, okay, we're gonna do that thing, instantiate a new array, and then we've got a for loop. I thought this was Ruby. So with just a few small changes, we can make this so much easier to read, right? Clearly, lines five and six, return this if this, turn this if this, and then find the first n prime numbers. That's so much simpler. So that now the next person to come along doesn't have to sit for a while trying to decipher what this method does, right? By refactoring, we are showing respect for our teammates. And as Rubyists, we use a language optimized for human readability. Why not take advantage of Ruby's strengths? It feels so tangible. I can just take this thing and move it around and play with it and have something beautiful at the end. Refactoring fills me with this wonderful sense of joy. And when I finish a big refactor, it's kind of like everything is wonderful and I have to take a minute and marvel at the beauty that I created with my own two hands. I just took an ugly thing and made it so much better for everybody else coming after. This code is beautiful, I think, and software is too. And getting to make it is a real gift. And I feel really lucky to do this for a living and I hope you do too. So, let's wrap up. The question we originally set out to answer, how can we love our jobs more? Well, we updated gems and we defeated a boss in video game. We wrote documentation and made a glossary and commented our code as we went and it was pretty easy. We tested and we concocted delicious fine dining meals for our users. We lented and we played Galaga, right? And we refactored and became artists in the process. The thing is that this change takes time. This isn't some grand tale about forcing your coworkers to love upgrading rails because if I could do that in one spell swoop, I would be a hypnotist and not a developer. Instead, it's about gradually building habits. If we take a few minutes to do these things per day or even per week, we'll build better practices into our development routines. And a trait that's great to build into our habits is a common thread for reasons to do all the tasks we've covered. Empathy, we wanna help other people. When we're constantly mindful of who else is touching our code or our software and what their needs are, we'll build better systems for everyone and we and our teams will be happier to use them too. I'm a firm believer that we build better software through empathy. But that's not all. It pays to be positive. So these boring parts of development are actually my favorite because I can do lots of little things to help my fellow developers in countless ways. I choose to be optimistic about what we can accomplish, what kind of great change we can bring together through better development practices. And because I believe I can make these good changes, I go out and I try to do them. It's so much less daunting when you have a positive attitude about it and I encourage you to do. So go, spread these tactics to your team. You will be a hero when you tackle these tasks but you don't have to be the only one because together we can make big changes for the better step by step. So go out, love yourself, love your team and love your software. Again, I'm Megan Tew. I work with CallRail and we are hiring so if you're in Atlanta or would like to be, please come chat with me. You can find me at Megan Tew on Twitter which is where I'll be posting my slides online today and then they'll be up on the RubyConf website later. I'll be taking questions off stage and in the hall so feel free to please come chat, say hi. Thank you.