text stringlengths 0 2.35k |
|---|
[2747.32 --> 2750.84] But when I only have tests and I don't have good documentation or comments, then it's like |
[2750.84 --> 2755.64] I have to assume that the tests were also written to do the thing that was intended to be done |
[2755.64 --> 2759.68] or kind of try and make, like derive from those tests what's supposed to be being handled |
[2759.68 --> 2760.02] here. |
[2760.16 --> 2763.64] But I think just going through and being like, okay, here's a function with this name. |
[2763.70 --> 2764.42] Here's a type with this name. |
[2764.48 --> 2765.64] Here's a method with this name. |
[2765.98 --> 2767.50] Does this do the thing I think it does? |
[2767.52 --> 2770.42] And then writing that down and making sure everybody has an understanding of that. |
[2770.52 --> 2775.28] Real great way to actually like, A, start exploring and understanding a legacy code base, but also |
[2775.28 --> 2778.00] helps prevent code bases from becoming legacy. |
[2778.00 --> 2782.48] Because then other people can catch the bugs in what you intended versus what's actually |
[2782.48 --> 2783.66] written in the code. |
[2783.74 --> 2785.90] So that clarity of intent is a good one. |
[2786.14 --> 2791.08] Because that's also like comments, documentation, and even just the coding style as well can go |
[2791.08 --> 2792.34] a long way towards that. |
[2792.78 --> 2797.64] Because naming is one of those things that's really hard and people tend to just eventually |
[2797.64 --> 2800.20] give up on or get frustrated and be like, ah, whatever. |
[2800.36 --> 2803.08] But it is worth that time to take care of your naming. |
[2803.08 --> 2807.66] Because if you can structure your code in a way where the code declares its intention, |
[2808.00 --> 2813.24] that's even better than having to say comments about saying what it's going to do, what it's |
[2813.24 --> 2813.96] intending to do. |
[2814.42 --> 2818.76] I think that's another strength of Go, in my opinion, due to the packages and whatnot, |
[2818.92 --> 2822.78] compared to other frameworks and language that I worked with in the past. |
[2822.98 --> 2829.66] So you kind of already have a small sense of what something is going to do in terms of |
[2829.66 --> 2831.44] a business case and whatnot. |
[2831.44 --> 2836.56] Because they are probably properly placed into the right packages. |
[2836.56 --> 2839.22] I'm wondering if people have any examples of... |
[2839.22 --> 2843.50] Because everything so far, it sounds like having good engineering standards and protocols |
[2843.50 --> 2847.88] for your team and organization is a big help in preventing legacy code. |
[2848.02 --> 2856.62] I'm curious if others have examples of maybe not just good documentation or good tests and |
[2856.62 --> 2860.66] stuff like that that could help in preventing legacy code. |
[2860.66 --> 2866.34] Because a lot of times that comes from the whole team that has to kind of agree upon a set of |
[2866.34 --> 2869.52] documentation and a kind of coding style. |
[2870.20 --> 2874.46] But if there's maybe something like you as an individual can kind of take upon yourself to |
[2874.46 --> 2879.44] kind of improve yourself as an engineer, totally not trying to talk about myself. |
[2879.56 --> 2884.58] I've definitely found that, at least for me, what the outcome of this is usually writing better |
[2884.58 --> 2886.12] documentation or tests or whatever. |
[2886.12 --> 2890.82] But I think just taking some extra time to stop and really think about what you're trying to do |
[2890.82 --> 2892.96] and what you're trying to implement doesn't have to be a ton of time. |
[2893.04 --> 2894.64] I'm not saying take hours and hours and hours. |
[2894.80 --> 2898.62] But just sitting there and looking at the thing and then thinking about the problem you're trying |
[2898.62 --> 2902.94] to solve for even just a few minutes longer than you would have before, I think can really |
[2902.94 --> 2905.42] help you perhaps design something a little better. |
[2905.90 --> 2908.28] And I think also just many iterations of things. |
[2908.50 --> 2913.24] So if you write something and you budget your time and plan on being able to write it |
[2913.24 --> 2917.88] three, four or five times, that gives you the space to write it once, maybe quick and dirty |
[2917.88 --> 2921.52] and look at it and say, but is this the way that it should be written? |
[2921.82 --> 2924.58] I kind of get that feeling of if this is the right thing. |
[2924.64 --> 2929.90] So I think a lot of the times we wind up with legacy code or kind of the bad legacy code |
[2929.90 --> 2934.02] because we didn't go through enough iterations of thinking about something. |
[2934.44 --> 2938.94] And I think it can be very difficult to sit down and do that because we do have deadlines |
[2938.94 --> 2939.62] we're trying to hit. |
[2939.62 --> 2942.88] But I think that's one of the things that has definitely made me a better engineer is |
[2942.88 --> 2948.20] pushing back on myself and my team and saying, I'm going to take the extra few minutes here |
[2948.20 --> 2951.40] to think this through a little bit more because it doesn't feel right. |
[2951.74 --> 2957.04] And really just listening to your gut and developing your gut instinct over time to know, okay, |
[2957.08 --> 2957.84] I've written something. |
[2957.94 --> 2961.72] Okay, this is good versus I've written something and this is rough. |
[2962.16 --> 2966.16] And listening to that feeling inside you that's like, it's rough, but I don't know why. |
[2966.28 --> 2968.10] And then following that thread. |
[2968.10 --> 2971.38] And so I think a lot of times, once again, we kind of ignore that thread because we have |
[2971.38 --> 2971.90] things to do. |
[2971.98 --> 2974.60] We have features to develop and we have something that works. |
[2974.64 --> 2975.62] So why are we going to follow the thread? |
[2975.66 --> 2978.82] But I think really just following that thread at the end of the day has definitely helped |
[2978.82 --> 2982.94] me write code bases that are much more resistant to legacy. |
[2982.94 --> 2986.44] Even when I'm working with a bunch of people that are just trying to move really fast, |
[2986.48 --> 2991.14] at least the parts that I'm working on are a little bit more immune to that bad legacy |
[2991.14 --> 2995.34] at the end of the day, which can help quite a lot because that kind of thing tends to be |
[2995.34 --> 2999.06] contagious and other people tend to pick up on it because they want, like they're working |
[2999.06 --> 3000.70] in the code that you wrote and they're like, this is great. |
[3000.76 --> 3001.42] This is amazing. |
[3001.78 --> 3002.88] Like, I want my code. |
[3002.96 --> 3004.60] I want the whole code base to feel like this, right? |
[3004.62 --> 3006.22] It's very infectious at the end of the day. |
[3006.72 --> 3009.80] Do you think that pair programming could also do this effect? |
[3010.26 --> 3011.02] I think it can. |
[3011.02 --> 3015.48] If your environment is one that is, I'd say, opportune for pair programming, right? |
[3015.54 --> 3019.06] So like you're actually in person, you can actually sit at the same desk, you can actually |
[3019.06 --> 3021.80] work through things together at the same time. |
[3021.80 --> 3024.38] I think then, yeah, pair programming can be very helpful. |
[3025.00 --> 3028.54] I think also just group design, group thought processes, like whenever you can get like |
[3028.54 --> 3032.42] people in the same setting and you have enough psychological safety where people can just |
[3032.42 --> 3034.78] like ask those questions that they might think are dumb. |
[3035.14 --> 3037.70] Because at the end of the day, you know, that thread you have is like the very much a, |
[3038.32 --> 3041.12] I don't know what the problem is, but this doesn't feel right. |
[3041.24 --> 3044.74] So you have to be in an environment where you can express that and the people you're working |
[3044.74 --> 3047.68] with will help you work through that and have enough trust in you. |
[3047.98 --> 3050.88] So yes, I definitely think pair programming can be excellent for this. |
[3050.88 --> 3054.30] I think whiteboard sessions, if you can be in a space where you can do whiteboarding |
[3054.30 --> 3054.90] is great. |
[3055.00 --> 3058.70] But I think also just maybe not doing the pair programming part of programming, but just |
[3058.70 --> 3061.56] hopping on a call and talking through an idea with people. |
[3061.78 --> 3066.20] Maybe if we're a Google Doc, that also is, I think, equivalent and a very helpful way |
[3066.20 --> 3067.46] to kind of execute this. |
[3068.16 --> 3073.24] So we've talked a little bit about kind of you have this legacy thing and how do you make |
[3073.24 --> 3077.04] it so that you don't get to that final explosion point. |
[3077.04 --> 3084.28] But I'm interested to talk a little bit about when you, if you get that buy-in to rewrite |
[3084.28 --> 3091.22] a legacy code base or to change up a system and, you know, business for whatever reason |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.