Det är bra att vara tillbaka och se så många familjelfäser och så många nya. Jag heter Ted, för du som inte vet mig. Jag jobbar nu som VP av engenering, men jag har en bakgrund i läge. Jag har tidigare att lägga till högskoliga barn, mat och fysisk. Jag jobbar nu för en startup som heter Engaged Rocket. Vi bygger HR-produkt-svets utav Block 79. Om du tittar på en jobb som en junior-developer och är intresserad av att lägga mer om det particulara som vi har i vår company, kan du inte tala till mig efter presentationen eller kan du pinga mig på många Singapore-slekt-channelser. Jag är också intresserad av lokala kommuner. Vi tittar på speaker för Ruby SG. Om du är intresserad av att tala kan du tala till mig eller William eller Daniel efter presentationen. The Tech Ladies Bootcamp är tittar på mentor och coacher. Om du är intresserad av det kan du tala till... Inte Elischa, men det är en gädda för honom. Jag är också på teamet RUBOCOP som är en städig kodanalysisk tool för Ruby. Vi tittar på nya kontributörer. Om du är intresserad av open-source, men du vet inte hur det börjar och du vill hjälpa dig ut, kan du också komma och tala till mig efter presentationen. Det här talet är om hur inte att bli en senare utveckling. Det är inte att bli införd med hur inte att bli en senare utveckling. Det är... Just inte att göra det. Det här suggests att det finns många rapporter och att de kanske blir bättre än de andra. När jag skrev den här presentationen, kom det ut som en sorts stream av konstnössing. Det ville inte vara någon annan format eftersom idéerna innebär lite intervjuad. Jag försökte att göra det som möjligt som möjligt. Och vad jag vill göra är att röda lite om hur jag reagerar på mitt jobb som en vp-ingenjörer och på jobb av våra programmer och vårt field i generell. Och några av dessa idéer kanske inte ska användas direkt och det är okej. The point is not in the details of the ideas really. It's in the reasoning about the ideas. And I'm hoping to help you get a bigger picture of whatever context you're working in right now and your journey to becoming a senior developer. So the talk might be slightly mislabel because I will only talk very briefly about how I think you should not become a senior developer. So one of the most popular and according to me probably the most incorrect way is just list out a number of technologies that you should learn and then once you reach the bottom of the list you are a senior developer. So I understand that the idea is extremely compelling because it becomes a journey that is bite-sized and gamified and it's just about memorizing new tools and because we are developers we tend to have high learning capacity and a keen interest in what we're doing so the prospect of just learning some new frameworks or tools is very compelling. And I'm not saying you shouldn't learn any technologies. Of course you need to know something to be able to do work but I think about it as a prerequisite so I like to say that it's required to know these things but it's not sufficient to do a good job. And I don't place too much confidence in better tools. History has shown that better tools tend to allow us to be bigger and more complex software just as poorly as we were able to build smaller and more simple software previously. And the only thing that creates better software is improving the people. So as a disclaimer this is some repo that has a developer roadmap and I don't know the person who created it and it's a great thing because it works as a reference for sort of what the ecosystem looks like right now in terms of technologies. So you can use this to get an overview but I wouldn't treat it as a roadmap to becoming a senior developer. It's probably a roadmap to something else if you follow it blindly. And that is a trap. And that trap is called expert beginnership. So if you've been in teaching or education the bottom part is the Dreyfus model of skill acquisition. And when we reach the advanced beginner stage and this is a stage of just accumulating facts and putting them inside us. We sort of see a fork in the road and one of the paths leads on to be more competent and beyond to become an actual expert. And that path involves getting the bigger picture of what we're doing. But there is also another path which is the trap into expert beginnership and that is treating it as ourselves as sort of a bucket that just needs to be filled with more and more low level implementation details. And I think that this simple accumulation of facts is not really enough. It has been talked about in the terms of just more and more content but just letting the ideas pass through us without interacting with any of our reactive parts isn't that hard. And we need to let the ideas sort of transform our understanding of what it is we're doing. So I show hands who knows about continuous integration. Who does continuous integration at work. So continuous integration is the act of bringing the teams systems together and making sure they work together. But what is it we're actually integrating out? It's not really code because that's just making the characters work together. We could argue that we're integrating our systems but when we do continuous integration I like to think of it also as an integration of ideas and I extend this concept to myself as well. I constantly need to integrate the ideas of others with my current latticework of ideas. And I like to think of this as laying a latticework or weaving sort of a web of ideas. And I think as a junior developer you have an advantage here because you can look at your seniors and you can look at this web and you can see these are the really nice parts. I'm just going to take that and integrate it into my own. But you can also see the thorny parts where the ends don't really meet in my understanding and in my integration of ideas. So you can use that as a counter example and say oh, Teddy is really contradicting himself on these things so I'm going to avoid ending up there. Whereas for me who has been doing this integration of ideas for a very long time, changing that part might take a lot of work. So just be critical. And by critical I don't mean being close minded. I come across junior developers who tend to reject everything until they have sort of experienced it themselves or inferred the things from first principles. But I think this is a bit of a waste of the potential of having mentors and having seniors around you who have experienced things and who can warn you about certain missteps. And then of course pick up the ideas that are the best ideas you have heard of so far knowing that you will come across something better and then be ready to drop it. So that is actually everything I will say about what not to do. So the rest of the talk I will dedicate to talking about things we can do instead, how we can reason about our work and I think reasoning about our work is how we can get better at it. And this will hopefully eventually allow juniors who are at the advanced beginner stage to graduate the competent stage. And I like to start this part by asking a question. So the question is how long is a string? And if you have, if you think that this question is nonsensical, that is on purpose, this particular question is a rhetorical device that's used in my home country, which is Sweden. And we use it as a retort when someone asks a question that doesn't have enough information or enough context to be answered in any meaningful way. And it's often paired with another saying which is the way you ask the question is the way I will answer it. And although we all can seem to agree that this question without any supplementary information is quite absurd, we see people ask questions like this seriously and people trying to answer them seriously. But this question is equally absurd. We could approach it with sort of an empirical mindset and say that well if there was a best programming language one would be using it and there would only be one, right? Which is not true. Or we can approach it with a rational mindset and see that programming languages seem to necessitate certain trade-offs and how we value those trade-offs determines how good it is or not. That is to say it is a subjective valuation. And the third and absolute, the worst option approach it with an emotional mindset where we value our own attachments or affiliations with certain programming languages. And to me it seems like the first option is the best one. Having the empirical mindset we can look at outcomes which is a very powerful mental model to have to reason about the outcomes that we're looking for. A lot of times we don't really have enough data to make an empirical judgment and we need to resort to the rational mode of reasoning about things. But reasoning about things is a very thorny place to be because human reasoning is fundamentally very flawed and especially when the emotional part comes in as well. So be very careful that rationalism can very easily turn into sort of religious dogma as well. But if we're given the choice I prefer to never have feelings about code or feelings about ideas because it seems to be a dead end to me. It sort of locks me in. So whenever I find myself typing in a code review I just tend to stop myself and say why am I feeling anything about this very objective piece of the system. Because it probably means I had some unexplored things there. So be candid and question things objectively whenever you can. I'm going on with the questions here. Is JavaScript a bad language? Who has ever proclaimed that JavaScript is a terrible language or made jokes about it or used it as an icebreaker? Okej. So most likely the reason for that was emotional. We had some bad experience. Either first hand or we heard a story from someone else about how bad their experience was. But if we tried the other mindsets empirically JavaScript is a great language because tons and tons of people are using it successfully for tons and tons of things. If you try the rational mindsets we can sort of start to articulate what are our gripes with JavaScript. So we can look at what it's used for. We use it for UI. So it's evented, that's cool. We have events in UI. But it's general purpose and UI is sort of a specific application. We do with something more specialized. It's imperative which is not so nice because UIs tend to lend themselves to a declarative approach. So then we can revise our judgment that it's a bad language into it's probably a bad philosophical fit for UIs for the web. But it could be a great language if you are building a heavily evented and streaming system for example. So it sort of unlocks the trap of that emotion where we look at a word or a name and we have a negative emotion and then we just try to avoid it. And I think abandoning these emotional valuations and resorting to reasoning or empiricism can yield some very important insights. So if we look at this question and we start exploring it it leads to a very important insight that programming is not really one single homogenous discipline. And just because the different disciplines share the common denominator that we write code doesn't mean that they have the same challenges and constraints. And I think we should consider them different disciplines as a whole. And if you are a games programmer maybe you need to know linear algebra by heart. If you are a web developer maybe you don't need to know any linear algebra but you need to understand the business domain and you need to be intimately familiar with user behavior. If you are building embedded applications maybe you need to be on top of memory management and CPU cycles which is wasted effort in other applications. And I like to even say that programming is not about code that much and that might be heresy. Who is this guy saying that programming is not about code. There is this t-shirt that says that programmers are people who turn coffee into code and all true wisdom is found on t-shirts. But I think programming is about code in the same sense that writing is about words. It's just a means that we use to express our ideas and what is important are those ideas themselves. And I think programming is about systems in the same sense that writing is about stories. So just when we're at it this is not really a junior developer question this is like I want to be a developer question. So which language should you learn first? Any takers? Is there one question? It could be yes. Who said that? Just send me your resume after. You should learn English because really we're translating problems and ideas from natural language into code. And if we cannot articulate those problems or ideas in natural language then we have a really bad starting point. It doesn't matter how good we are at writing code. So after you learn your first language English and your first program language what should you learn next? Maybe, maybe. If you are into 3D programming then that might be a good idea. But as William pointed out it might be the wrong question We need to ask what I want to do what problems am I solving what kind of programming do I want to get into. And don't accept run of the mill universal answers to questions like this because there tend to be none. To explore this a bit further we do a show of hands again Who here would say they work in a technology company? And who would say they work in a product company? I have no idea what the rest of you are doing. There are no more options. What I like to differentiate between the two and by technology company I tend to mean a company where new technology is invented and where the primary constraint is the technology and by product company I tend to mean companies where we take existing technology and we assemble it into a product that solves particular problems for some field. Yes! So some large companies do both so Google is the most prominent example right? They create the technology but they also build products from it because they are large enough to be able to do everything. But because the constraints and the challenges are different what's required from you as a senior developer is different. So there is no one path to senior developer ship. And anecdotally I think this means misconception that programming is a single discipline can lead to a sort of lack of work satisfaction. So I met a lot of programmers who are quite unhappy and they are jumping from product company to product company and they are very into deep technology and they don't realize that these companies that they are joining are not like gated playgrounds where you can work with deep tech they are doing something else they are solving other problems. And these product companies tend to be rather open business almost arenas that have human context that might not be interesting to those purely interested in tech. So I'm going to go on and talk about product companies so if you work in a technology company feel free to follow along. So I like to think that all product development is integrated and that is because products have many interfaces so a product interfaces at least with different markets and with different users and with technology. Which is why we have different teams for dealing with those different interfaces. So we can have a product owner who interfaces with the market we can have engineering team that interfaces with technology and design team that interfaces with users. And these tend to answer different questions so the product owner the designer can answer what should it look like and the developer says what is the best approach to building this. And that work is sort of done in isolation but I tend to think that the real magic happens in the intersections or what I call the arenas. So for example if you have product and development come together product knows how valuable something is and development knows how hard something is to build and then suddenly we know what is the return on investment for building a certain thing which informs when we should build it or in what order. But this requires us to understand the objectives and constraints of the other functions as well. Because if we don't understand their objectives then we cannot make the right compromises or we cannot negotiate when it's appropriate. But of course we should obsess about our own objectives the most because those are the ones we need to defend. So what then is the objective of the development team we could be misled to think that it is value because value is our deliverable but products are already obsessing about value so that seems wrong if our objectives are the same there wouldn't be any need for negotiation in the first place. And I tend to think the objective of the development team is flow that is we deliver value today and we deliver it continuously and indefinitely. And I think we should obsess about that. And the biggest threat to flow and the greatest enemy of the development team is complexity and I think all complexity added to our codebase needs to be thoroughly examined and tested for necessity before we commit to it. This means that solutions to four problems are big no-no and that applies even if it means adding our own favorite technology to pattern to the problem. Because we all have pet solutions and technologies but as professionals we need to sort of stuff them into a drawer and wait until the right problem calls for it. Because all solutions also come with their own problems and there are no such thing as a free feature or a free framework. So I use this chart with business people to illustrate practical trajectories for flow. The red line sort of illustrates what happens if we cut a lot of corners early on in order to achieve some short-term delivery. Maybe we're not writing any tests we're not really doing any modeling we're just focusing on grinding out features. But if we ask the product owner in one month from now would you like eight units of value or one unit? They're gonna say eight units. And it's important for us to protect our objective of flow and explain to the product owner that if we do that we're screwed already. Which brings us to another question I'm doing these questions just to make sure you're awake. Assuming we took the red pill and now we're knee-deep into the complexity depth and everyone is miserable is it better to rebuild the project or to salvage it? So we can do a show of hands How many think it's better to rebuild? How many think it's better to salvage? I've tried both several times and I will tell you the answer. So the answer to the question is it better to rebuild or to salvage is no. I can tell you that both are extremely miserable experiences and they are demoralizing and soul crushing It's not something you want to go through. So the answer is for us to sort of maintain our professional integrity and defend our objective before it can happen. And this is extremely hard and it can't protect us from legacy code bases that came in from elsewhere but I think it's the only way to be part of the solution. So in practice this involves deciding on some what is our maximum tolerable depth level and make sure we don't exceed it. And I think this is mostly done by making good decisions in our day to day work and I am a strong believer in the compounding effects of small improvements and the compounding effects of small regressions is equally powerful in the other direction. And there might be short stins of cleanup but don't buy into the don't buy into the myth of the big bang refactoring because it never works. Because refactoring requires very deep contextual knowledge of the parts of the app you are working on so you can't do like bread refactoring. You have to go depth wise. And it requires to have all the details loaded into your working memory We need to ask ourselves when we accrue depth why are we doing it? And this is Martin Fowler's blog So it sub divides depth into reckless or prudent and inadvertent and deliberate. So you can see reckless deliberate is saying things like we don't have time for design which is abandoning our objective in favor of some other other objective. There might be reckless inadvertent as Junxi said this is where we need to ask questions to our senior developers because we don't know what we're doing really. It can be prudent and deliberate saying we must chip now and deal with the consequences and the keyword there is deal with the consequences which means we need to negotiate with the product owner. Yes we can deliver next week but then we need some time to recover from the depth that we incur. There's prudent inadvertent we didn't know that it was going to go so bad to this approach. And as I mentioned product development has an acutely human context and at some end of the chain humans will interact with the product and even if those humans are other developers they are still humans as well. So if you look outside your own product team there is a sea of stakeholders that usually our product owner will protect you from by being the authority on what to build when. And these stakeholders they provide their candidate problems for us to solve. It doesn't mean that we will solve all of them. But what they do having common is that they are human problems so they tend to be unconstrained or any form of logic or reason because that's the nature of human problems they tend to be fuzzy. And this matters a lot because getting the problem right is the hardest and most important part of the job. And getting it wrong often means imminent defeat regardless of how beautiful the solution is or how flawless the execution because we were not solving the right problem in the first place. I don't think you need to think like a computer so there was this trend in computational thinking and algorithmic thinking I think mostly you need to think like a human and define them and frame them properly so we can solve them. And is to take ideas from the natural language that you use and turn those ideas into code. Mostly we need strong conceptual thinkers so focus on that. And because we are solving human problems which are fuzzy and not well isolated and defined like the problems we receive in school there is no magic formula really to follow and it doesn't really help to learn algorithmic thinking and in a way this is very nice because if programming was deterministic it would be a paradox in itself programmers tend to automate things so if programming was deterministic we would be able to automate it and we would have automated it and we would be out of jobs. So I like to show you this mental model which I use to make sure that we are solving the right problems which is the most important part so I consider three parts of any effort I consider the diagnosis definition and the framing of the problem the prescription how we intend to solve that problem and the execution which is just typing on the equivalent and I consider them in order of importance this is like orders of magnitude from the left to the right and I think it again it shows the relative insignificance of code it's just committing the ideas that we already generated in the previous steps into code and it's those ideas that matter but you should be fluent with your programming language which is not that hard compared to all the other things we do so it just means read up on the standard library and on the language syntax so they can use it fluently to express ideas just like you would in English but don't be tricked into thinking that is what makes you a good developer so just like learning the entire English dictionary doesn't make you Hemingway learning Ruby's standard library does not make you brilliant at coding and execution is still important and this has to do partly with credibility so Ken talked a bit about spelling errors in the newspaper and it doesn't kind of doesn't matter how relevant the story is if it's all with spelling errors the credibility is already heard so don't abandon it try to improve your execution with every task and this is usually people can get a bit annoyed with sometimes oh it's just an implementation detail and what I mean by that is we have already gone through the process of diagnosis and prescription which are the interesting parts how we type out the code is not that interesting to me ok in the interest of time my own guidelines as I just discussed I think better humans beats better tools every time and I think technical competence is required but it's not sufficient I think what lies beyond technical competency is what sets you apart as a developer always think about constraints if you do web applications and you're thinking should I do this language level optimization to my Ruby code the answer is no because the constraints of performance is I.O and the constraint of your team is developer resources if you're trading very valuable developer resources for very non valuable work but also think about constraints in your organization and your team especially if your team is the bottleneck because then we need to utilize our effort wisely obsess about flow make sure you're solving real problems this is probably the most important one and don't have feelings about code so these are just my guidelines you should probably develop your own guidelines as you go along so whenever you come across an idea that integrates especially well with your understanding of our work then make it your own and I think finally we need to beat the stereotype so programming is not manufacturing and you are not part of any manufacturing economy and there is this stereotype of the code monkey and we don't want to be code monkeys and being the big monkey does not mean knowing the most tricks and I think the best antithesis to the code monkey is credible discerning and reflecting professionals and professionals who holds and protects their own objectives and who know when to negotiate and when to compromise and one who can tell conceptual issues from implementation issues and reframe the problem and propose other solutions and I think it's developers who know what they know and what they don't so we need bold developers as in bold not bold and of course for everything else there is always that's all


Over the last seven or eight years, she has been delighting customers with design and development. She runs her shop out of Santa Barbara, and she is here today to talk to you about wrangling the temple hierarchy like a boss. Would you please welcome with me Alicia. Thank you everybody, just a little more background, I was wonderful to get introduced by Chris Lima, kind of a special. I am from Santa Barbara, in addition to creating custom, what I will call small batch, artisan WordPress themes, I also coach people on WordPress on how to use it, and I'm starting a new thing where I sit with them as their right side brain, if they want to DIY their own site, and so I kind of sit with them if they get stuck, and I can quickly help them. So that's just another way that you too could help with WordPress, it's not all about development, you could actually inspire and coach people. So what we're going to talk about today is the template hierarchy, we're going to talk about what it is, we're going to talk about what it does, and then I have a feeling you'll come to your own conclusions at the end on why you should use it. So how many people have actually heard of the WordPress template hierarchy? Look at all you people, how many have visited wphiarchy.com and tried to wrangle this? How many people don't know what that is? Okay, so the people who just raised their hands are my favorite people in the room. I love everybody here, but these people that came in the room who don't know what this is, they came here and they were brave enough to raise their hand and say they didn't know what it was, and they're going to leave here knowing something brand new. It's going to help them. So we're going to demystify the confusion around this crazy chart, and just want to know if you guys are ready to wrangle. Okay, so to start off, a theme is made up of many different templates and template parts. I don't know if anybody's ever looked into their theme file or folder and seen all the different files, and then closed it very quickly and said, I don't need to do this, I can drag and drop. Has anybody done that? Okay, well that's the wrong approach if you want to get far, WordPress, and stand up here and talk about it. Okay, so it's made up of many different templates and template parts, like all these folks. These parts work together to create the pages and the posts and even the attachments that are viewable on your WordPress site. So we'll go back to this rigmarole, that's what we're going to call this. And so let's imagine that WordPress and your theme have teamed up together and they're going to create this bureaucratic hierarchy with job titles for each template file, and having specific titles for these files will enable them to choose the right one for the right job. So you have to make sure that they have their proper job title. WordPress will be able to do this job more efficiently with something called query powder, not query powder. I think I just said query powder, but it's query powder. And we don't have to go into that right now. You can look at what a WordWP query is on the codex and have your eyes glazed over later. But just know that this query is very important to pull the pages and the content that you have on certain types of pages in your theme. WordPress needs to know where you are in your theme at the time, and it can pull the proper page and layout. So how does the hierarchy actually work? So the best place to start is at the top. If anyone's familiar with index.php, you seen that file? Yeah. And you're like, okay, it's cool. It's doing something in the theme. So you might have noticed. What we're going to call the index.php is the sole proprietor. It's kind of like the freelancer. This file does everything. If you don't even have this file in your theme, you're probably not going to see anything. Because this is the one that does the job that's going to produce the content and the layout that's on your pages and your posts and your archives. Even that crazy thing called the comments list. Custom post types. If anyone's done any of those. They're all going to be fed to the front of your site from index.php unless there are other folks on the job force or in the office to do other tasks. So the freelancer wears many hats, but in most themes this hat's pretty boring. It's just the basic loop. The basic loop is, we don't have to go really into deep detail, but that's how your pages and your post types are rendered. Your WordPress is looking to see how many of those you have and keeps looping through them and showing them. So if index.php usually has basic loop, which means that your pages, your posts, your events, other post types like portfolio, they're all going to look just like this. Boring. So you might want to hire more staff to diversify everything, make it look a little better. So eventually you want index.php to only work part-time. Actually you might even want them to go on early retirement. Just get them out of the picture. He's only there in case something fails. You have the wrong template name or something, but index.php, he'll be there to catch it. But you just want him to go golfing. So let's interview some new prospects. How about singular.php? Singular.php is a new file since WordPress 4.3. Singular.php will display the content that's on your posts, your pages, and your custom post types. So as long as you create that file, if it's in your theme, whatever's in that file, even nothing, when you go to a page you're going to see white, a blank page, until you put something in there. You can put something in there like, cool, this is where I'm going to put my single page. And they all know that you have the right file. But it does not handle things like archives or comments or author pages. And it loops through the code and it will display your static pages and your blog posts and your custom post types. Exactly the same. Whatever's in that file, it's all going to look the same. We don't have to worry about index.php anymore because now she's doing that job for him. And you might have changed the layout a little bit. And so now it looks a little different. And so you don't have to worry about everything looking the same. But it's still kind of boring because now you have three things doing the task. One person doing the task for three things and it's boring because sometimes when you create a custom post type, you want a different layout, you want it to look really cool. So we're going to hire some new people. We're going to get page.php. Singular.php is going to delegate some of her work to page. Remember, she was doing posts and pages and custom post types. Now she's like, I'm done with the pages. I can't do it anymore. It's boring. It doesn't move. There's no date. There's no tags. It's like, I'm going to let this guy do it. So this guy is only going to concern himself with pages. We have single.php. She's like, Singular is kind of done with the blog post. It's like getting me nowhere. So Singular.php is going to be the single view of a blog post. And it's incidentally going to pick up your post type as well. And sometimes we know that our post types are special to us. They might be our portfolio items. They might be events to our massage workshops.  So even though Singular.php is doing a job, it's still doing a job for two things. And these two folks are not going to deal with your archive. Now I know you guys are aware that when you go to a WordPress site and you look at the blog and you see a list of the blog posts, that's an archive. And sometimes you'll see an archive for custom post types. And it's just listed. Sometimes the layout's really cool. You're like, how did they do that? So that's an archive. So while we're at it, why don't we just hire that person too?  They're not pages that you can find. So they're secretly dynamically generated so that when you land on the archive, it happens to show everything. And so whatever's in that archive.php, he's going to dish it up for everything. That's an archive. So now we have a pretty solid team. We could literally get by with just this. If you're not going too far.  So you have a single post page. Then you have an archive that you can style. You can have your thumbnail and a little excerpt. Or maybe you can have those cool little thumbnails with an overlay that slides up when you hover over it. Not like full jazz. But you can design that in your archive.php. So not only does the archive.php handle the blog archive. Like I said, he does handle the custom post type. And I'm not sure of all you know that custom post types have categories, but they're not called categories. They're called taxonomies. So if you've ever seen that word, it's just a special Latin word for category for your post types. So you can get more confused in WordPress. That's all it is. It's a test. Okay, so now these guys, they don't want to work. They don't want to do all the work. So it's time for a promotion. It's time for more money and less work. For your information, that's how promotion is supposed to work. It's not supposed to be more work, less money because you got promoted. You're supposed to figure out how to work less for more. So we're going to hire some more people to make things run more efficiently and give tasks out specifically. So remember we had single.php. Like I said, blog posts and custom post types are going to look the same. We don't want that. We want to do something special. We want our site to look awesome. We want to make it look custom. We don't want events to look like blog posts with comments on the bottom because there's no need for that. So I'm going to plug my friend here. I don't know.  Anybody read Bruce Hale books? He is a children's book author and he writes books. So he's going to need a custom post type for books because he's written a lot of books and had a happy meal, by the way. That's big. He was in a happy meal. So we need a template on staff that was going to work hard to display his individual books. So in a compelling way and an appealing way, that's not boring. That maybe like this guy is the limit. How would you display a book and all the information that you would need on a page for one of his publications? And so we needed to hire someone for that job. And we found him. This person's called single-book.php. He only cares about a single page that's displaying a book custom post type. We know that he's displaying a single page because single is still in there, but we've also hinted that this guy's only dealing with books. So we put our custom post type book inside the name of the file. So once he clocks in, he takes the reins from single.php and says, give me all that book stuff because that's what I'm all about. I'm going to display these books. I'm going to display it like this, which doesn't look like a blog post at all. It's got published date, thumbnail for the book. There seems to be a couple of testimonials on the bottom, a review on the sidebar, the three places where you can purchase this book, and then something awesome eventually went there in that spot. But the thing is, in single-book.php, this entire layout is coded in that file. And so once that file actually exists with this layout, whenever I go to a page to look at one of his individual books, it will automatically just pull this because I created that file. There are things you could have done. You could have gone into single.php and you could have done a bunch of conditionals and you could have said, if I'm on post type that's book, I'll show this chunk of HTML. Else, show this. And then you have this huge, unwieldy file where it's a bunch of junk in it. And then if you need to change anything or someone comes and takes your site over, they're digging through all this code. And you don't really need to do that. You just have its simple file for book. If you don't want it anymore, just hide it. Throw it away. But you should never do that because you really want to make things unique. You want to make things special for your clients.   So, of course, as we mentioned, Bruce had a lot of books. So he had a book archive. And so instead of having just a list of his books with a little excerpt and read more like a blog, we decided to have thumbnails. And you just click on one to go to the individual page. So we had to hire archive-book. It's our archive file. But now we specifically are using that one for book. And remember archive.php is still in the theme. Single.php is still in the theme. But because these more specific files are there, they are going to ignore the more broader ones. So the more specific you get with your files, just putting them in the theme means the theme will go there first. And so here she is. That's all she's going to do. She's going to archive. She's going to do a really good job, too. This woman. So now this is kind of all you need from that crazy chart that I showed you earlier. This could do the job. Just replace book with the other post-type that you've created. Maybe it's a portfolio. Maybe it's a recording or a movie or an event. But it starts off with index.php. Let me see this. This is swag from LA WordCamp. Is it working? So you have your index.php. Remember that guy? We sent him golfing. And then we hired Singular and Archive. Archive needed a little help with the books. So hired books. I'm not working for me. So hired book. And then we have Singular.php who's like diversified their job here with Single and Page. And then Single went and found an intern, I guess. And then had them working on this. So now we're going to go back to Bruce's homepage. And it has a specific layout that's different than all the other static pages on the site. And everybody knows that that homepage needs to be the vestibule to your house. Like you are like the lobby. It's got to look good.  You don't really have to return to the lobby. Not much. So never have a home button in your navigation. Just saying that's old school. You don't want to do that. It's like showing your old school list. And nobody's doing it anymore. Remember your logo is home. Okay, automatically in WordPress it goes home. Spread that knowledge. So your homepage has to look a little different. So this is Bruce's homepage. And we would like the homepage to stay that way. Standard way of creating a homepage is to create a template. And then you go to home page in admin and turn that template on. And then there you have a homepage. Like you'll find a theme that does that. So sometimes the client is kind of curious. They're like cats. They go a moment around in there. You know what I'm saying? And then they kind of turn it off. And you're like the homepage is gone. And there's no way to like client proof that. But there is a way to client proof that. Because you can call in specialist. And one of those specialists is called front page. What the front-page.php file does is whatever is in that file is going to be on the front of the website. Just by creating that file and putting it in the theme folder, that is what's going to be in the front. So there's nothing on there. It's going to get the white screen of death. But you know why it's the white screen of death. Because you created that file and there's nothing in it. That's a test, by the way, to know that it's working. Before you start coding and figure out it's not working. So create the file. And it doesn't matter what the layout template is turned on in the admin. Whatever they do back there, it's not going to affect it because this file is present. And this person will not allow any front page weirdness to get past him. So then there's also another page called the home.php. And this is rarely seen in the theme, but you might have seen it. Because WordPress started off as a blogging platform. Home has always been the list of blog posts. And that might be confusing to people who've actually tried to make a home page and saw a home page. And then they had two home pages in the menu or something and they couldn't figure out what was going on. It's because home literally is where the blog is in WordPress. It's called that. So if you create a template called home.php, you've automatically created the template that's going to render whatever the blog list is going to look like. So maybe your blog list doesn't want to... You don't want it to look like an archive. You want it to look really cool and maybe vague and strange and like Pinterest or something instead of having a list. Well, you can put all that layout and everything in a file called home, create that file. Once that file is created, WordPress will automatically get whatever's in that file to show your blog post. And she's extremely happy to do that job. And the archive person went out looking for her and had enough of the blog. They want to do more important things with their time, like golf. So then when...  It's not a bad idea to have those conditional statements and say if, else, or whatever. But you can do it in a way that's more efficient and you can do it with what's called template parts instead of putting chunks of code in one file and having it be like 12 feet long. Some of these template parts we are already aware of and they're already like kind of ingrown in WordPress and that would be the header.php. You notice that on every page there's a get header. That's a template part. And template parts can't stand alone. They're pieces that get pulled into a full template file so that you can use them everywhere you'd like in different files, but there's only one piece, one template part that you get to edit and when you edit that it gets edited across the site. So the header is one of them. You've probably seen sidebar.php where it says get sidebar. And this is like when you're actually... you open your theme and you actually look in the files to read the code. First of all, I had to ask, how many people have actually done that? Okay, that's good. How many people did it for more than 10 seconds? Okay. All right, all right, good. All right, so then you also have footer.php so that will have like your date and time stamp, you know. So template parts can contain quite a few things. It can contain a basic loop that you're going to use everywhere so you just pull that into a theme. It's the same loop. I don't want to repeat the code everywhere. I'm just going to pull it in. It can contain just plain old HTML. There's like a phrase, this is awesome and you want to throw it in different places. You can name them anything you want as long as they're relevant to the function of the template part. And that's called semantics.  Okay, I'm talking to you Bootstrap. You don't name something column 25 in a column 50. You name it, whatever it is doing, come on. I'm a fan, can you tell? I'm a Bootstrap fan. Anyway, you can call it a loop.php, you can call fun stuff and you've got to make sure there's fun stuff in there. Win a vacation. You're going to have that sprinkled through all your theme files. Mailchimp, your email campaign form. You can have that in a template part and you can stick it in a sidebar. You can stick it on a footer. You can stick it inside just the page for your blog or whatever. And you can also have something called content which you might have noticed is already in your theme if you're using the right one to start with, that would be underscores. I'm a huge fan of that. So if you've never heard of that, please go to underscores.me and download it and learn something. I'm serious. Put out by automatic, well developed and it's a great starting point if you want to create whatever you want. So how do you get these into your themes? Into your theme files? It's very simple. You just get it. You type this little tag in and see how we make this thing work again. And you just make sure you got these guys or nothing's going to happen. This is saying PHP, okay? And you get template part and then the part that you named it, you don't need the PHP part. PHP part, everybody knows. Everybody's on the same page. This is PHP. So just put that in there and everything that's in that file is going to show up in that space. And if you wanted to do a lot of your conditionals, you can say get template part loop, else get fun stuff, else whatever. If it's page 35, get the loop. You can do literally stuff like that. You can orchestrate your own site to do whatever the heck you want. And so we're going to go back to Bruce's homepage and he had all these sections in his homepage. He had a school visit section which was here in the top. He also had his latest book and he had a crazy sidebar which we couldn't see in this slide that had a testimonial. And all of this is just, I'm calling it in a basic loop. Instead of content, I'm getting this. This is one of the parts. This is the school visit part. And this is the code in that piece. I also use something called advanced custom fields if anyone's familiar with that. This is another way to client-proof your site. You just create fields for them to fill in the information.  They're just going to put the content in those fields, press publish, and watch the magic happen. But you have talked to them in advance to make sure that layout's okay with them. So there's no surprises. So that's... So template parts also have a hierarchy. So you notice in your theme there's a content.php. And whatever's in that, there's a tag called get content, and it's going to pull content.php. But maybe you'd like a little more specific content for a book. And like I showed you, that book page had a thumbnail upload, it also had a description of the book, and it also had a couple of reviews. So that would all be in content-book until we pull that up. It works with loops, works with any of your template parts. And so if we go back to this, some people were wondering what this part was all about. Because before I showed you, you just put the name of the theme, or the template file here, and also I put my template parts in a folder. So this is the path to that actual file. So it's nice to group your template parts into a folder or something. Underscore already does that for you. And so what this does, if I have a section that I created, section.php, and I have section-home-visit.php, if anything happens to my home visit and it disappears, the section.php is a default and will show up in case the other file is missing. So this is kind of like insurance. And finally, just to help you out, you don't want to get lost in your templates. So it's a good idea, before you start coding and getting crazy, that when you actually create one and you're pretty sure you know where it should show up, you might want to just put a little sentence in it and say this is the future home of the book archive. And so then you go to your test server or your website and you put in like BruceHale.com slash books. And if I see a page that says my future home of book archive, then I can breathe and I can go and code in that file. Otherwise it's kind of easy to get lost and maybe you've misnamed something and index has been called off the golf course and you don't know that yet. So index.php is working for you. So it is a good idea to like test out. And I think with that I am complete. And that's me. Okay, so I made this kind of short so we can have questions. All right, I got a little trick for my questions. Have you ever spoken at a WordCamp before? No. Well, you're going to. Because the mics are here. Yes. So how does content.php know to hand over the reins to content-book.php? All right. By the simple fact of content-book being available, that's going to be the one you're going to choose. Let me go back here. And do you see how I say get template part? Hey, where is my? No. Okay. Okay, I'm going to call it. You see here? A section-home visit. If I just called section, then I'm just going to get the section part. But I created a section called home. So let's use your example of book. Content book. So if I was just going to get content here, it would be get template part content. Okay. And I wouldn't need this part. Because content is the base. Now I want book. So I created the file. I put it in my theme. And in this area, I'm going to say content-book. And just by doing that, I'm going to pull it in. So create the file, then call it. And so you're just making things more specific for yourself. The cool part about WordPress isn't about learning something and having to reply it to everybody. It's about people coming to you to make you more specific about something so you can get better skills. So always let your client teach you something new. I had the greatest time working with Bruce. Because I got to learn about children's books and young adult books. And also I had to help him with the information architecture of the site and how he wanted to show his books. And I knew that books had to be specific and he had to be awesome looking. So with this knowledge, you'll be able to make one file that you only work in for books and you never have to worry about the rest of your site looking funny. You know what I mean? Sometimes you'll mess with a file and then you're like, oh my god, it messed up the archive too. I don't know how long ago it got messed up so it looks like I have to scrap this. You know, I don't know if you've been in that position. Did I answer your question? Can you tell me what you think I said? Okay. The book is what you call your custom post type when you create it. Yes. There you go. See, we keep digging. It's like a treasure hunt. And then his nugget is in. He's got the nugget. Okay. That is it. So also Google create custom post types. Please, you can do those on your own. You do not need to plug in. You just don't. All right. Anybody else have a question?  It's really cool. You have to come up here. So my question is when you go into a page sometimes you might want to say a full width template. How do you actually get one of those PHP templates created and to show up in that dropdown menu so you can select, you know, full width or contact us page. Do you know what I mean? Inside WordPress. What I'm talking about is creating what's called a page template. Okay. So the ling is a little confusing because it's the same word. So a template inside a beam is not the same as a page template that's going to show up in the admin. So there is a header that you put inside a page template that will enable it to show up in the admin. And so if you want that to happen it's a simple thing. It's like a page template colon and you put the name of it and then whatever is in there by simply doing that thing at the header you're going to have it as a selection. Yes, exactly. Exactly. I don't have anything like that.  My clients know exactly what they want. They know exactly what they need and I don't want them to have to turn on something like that. We talk it out ahead of time and they're not getting a theme where they can later on change things around. They're getting what they needed for their business. And so I'm a little different. If you're making a theme for a marketplace you're going to probably see that. And then there's just too many whistles and bells and choices and the next thing you know there's one and there's one on the homepage and you know what I mean it's like just make people what they need. It's not that difficult when she gets the skill under your belt and it's actually really fun. So any more questions? You spoke in there about a get temple field clock. Can you go over that again? The get template field. Oh. Okay. Let me get to go back and see if I can find that. Yeah. I might have to do one of these. Okay. I'm going to tell you. I did kind of do one on my favorite developer plugins. When I say developer plugins they're plugins that force you to use code to use them. They're not some UI where you drag and drop and you don't learn anything.  That works. This is going to be on TV. So anyway what this is is a plugin called advanced custom field. And instead of get meta which you might be familiar with when you may use custom fields that are inside of WordPress it's using the field for its plugin. It's an amazing plugin. It'll allow you to create anything. And if you couple that plugin with something called post to post post types to each other this guy's the limit on what you can make.


Hello there. There are many debates on Twitter Zingers regarding the difference between observability and monitoring. I'm not going to talk about that. I'm going to focus on what is observability? What is observability-driven design, development and testing? How applications should focus in producing golden signals during the design phase so that those signals can be produced at the operation cycle, can be consumed to produce meaningful insights from the data. Let's get into the session. I'm sure all of us have seen this mobile phone Nokia 3310 known for its boundless battery, talk time of an entire day and its strength. It has many good things. At the same time, if the battery goes down, it's completely dead. Even the basic functionality of calling my mom when there is a need, that is not possible. I just took this as an analogy for comparing it with monolith applications where there is a single unit containing user interface, business logic, data access layer, all packed as one single unit and very easy to test, develop and also monitor. All good. But if there is a problem, then the complete system is unavailable. The system availability isn't questioned. And none of us like this hard failure. I'm taking another example, the smartphones. We have upgraded our mobile phones into smartphones. When the battery is 100% H, right? So I can do wonders with, you know, I can do many things. I can do my work. I can chat. I can share. I can access all the applications. The battery goes down before it goes completely off. It helps me do my basic functionality like calling or doing some work, sharing something in LinkedIn. So do you like the soft failure? And soft failure is good. I just apply the same thing in our software development. And I segregated into application as well as infrastructure. So coming to the infrastructure, we have great caching tools to prevent overloading of a database. We have scaling in and out to launch the instances when there is a demand. Load balancer, which takes care of routing to only healthy instances. And our containers will automatically recover. On the other hand, in the application side, application architecture has evolved from Monolith to microservices where we have smaller scalable and highly available functional units. A ticada code with Monolith, development and operations were operating in silos. So they build, release and hand it over to the deployment in the operations team, which takes care of the deployment, right? And microservices will merge these two phases, release and deployment. It was single step called continuous integration. Where we deliver services rapidly to support the ever-changing needs of the business economy. If we consider the Monolith application, the system is homogeneous. Similar to development and testing, even monitoring is so simple. With microservices, where there are many moving parts and they generate a myriad of data, say something goes wrong. Identifying a root cause of an issue itself is like, you know, finding a needle in a haystack, right? Even Gatner says that, you know, the traditional monitoring tools leave a gap in identifying or giving the data inside which are required. So what they can say here is, traditional monitoring is not just enough. What is this new word, the new buzzword observability? Let's start with the basic. The term actually means, from the control theory, it's a measure of how well the internal states of the system can be inferred from the knowledge of its external output. I'm going to share a couple of ways to produce such external outputs so that we can infer the state of the system. And I read that logs, metrics and traces are often known as the three pillars of observability. There are many powerful tools in the open source as well as in the commercial markets like, you know, some logic, NK logs, Prometheus, open telemetry, Yacker. I have added some of them. So does that mean my application is observable? Not exactly. The services generate a myriad of data, what needs to be observed, what needs to be ignored and it wasn't clear to me. As a philosophy, observability is to know what is going on inside our system from the signals it produces. So during the operation, we can consume those signals but we cannot produce those signals. So observability shouldn't be after that, like during the operation cycle. It should be like, you know, thought well through during the development phase. During the design phase, it should be like, you know, observability driven design. So design for what behavior is normal, what is up normal and to design for developer policy. During development, built to produce some meaningful signals. Google codes such as like golden signals in its array book in detail. During the testing phase, similar to functional testing, we should have testing for verbose logging, verbose phrasing and observability driven testing. During the operation and monitoring, then we get good signals. Then that can be consumed. We kind of know generated that in the operation but how do we fed it back to the development so that, you know, there is a continual improvement in the development quality. So I'm going to add a new phase called observe just after this monitoring and before planning and I'm going to consume all these signals and fed back to the development phase. Here we got a new cycle. In order to achieve that, there are some must to have architectural patterns. We have seen them in philosophy. Let's see how to achieve them. Number one, monitoring. It is as important as the system is and it should not be compared with observability at all. It is not just for identifying the application issues or security issues but also for planning, decision making to ensure a more reliable system. At the same time, aiming to monitor everything is like an anti-pattern. Number two, distributed tracing. How many of us have driven the microservices application under fire especially during an outage? Thanks to Dapper, the Google research paper on distributed tracing at detailed information on spans, traces are well explained. There are tools like open tracing, now it's called open telemetry and they implemented it and we need to add traceability into our system. Number three, event driven. Rest is not an all in one thing. It could have happened to all of us even for applications like Google where there is a slowness for obvious reasons. And Grigger had detailed it in enterprise integration patterns how to make them even driven or loosely coupled. Number four, retry. Most of us have implemented the retry logic. If some API is not responding, retry it in after two seconds, three seconds or some fixed amount of time. Now tell me what is the use of retrying after every two seconds or three seconds if the application on the other side is on maintenance mode. So we need to have effective retrying strategy like exponential back of increase. Number five, fail first and fall back. So what does it actually mean? Is failure a desirable state or what? It's basically a behavior like, you know, service A can try to waive or service B risk for some time and it is not responding means, okay, just go back to the plan B, that's the fall back method. All right, let me recap. We started with monolith and we have learned a lot from heart failures. Then we started building micro-services where the system availability is not in question, it's ensured, so there are some failures. Now it's time to build observable micro-services with built-in resiliency mechanism in the system. Essentially the observability culture changes the way we think about the development process, testing process and the operation process and it index an operational mindset into the development. So doing it so, it increases the resiliency of our application and make the operations and monitoring very simple. It's not a one-time heavy lifting job and it has to be a continual process we should embrace. I come from Imagenia Technologies, consultancy as well as product development. We have rapid application tool called WaveMaker, appetite for API platform and high-scale for container orchestration. Thank you very much for joining me and thanks to BNCF. Thank you.


destroying it's making something new so do you want to know what's inside this hazardous disaster danger zone well I did my name is Brennan Keith-Avery and this is just my opinion hey what's going on everyone thank you so much for tuning into my opinion slash review for annihilation I really do appreciate it but before we get into the review help you boy out by clicking that subscribe button also click that little bell so you can be notified when I make uploads and give me that thumbs up let's see if we can get this video to 100 likes so now we have annihilation it is directed by Alex Garland he directed the film X Makana which came out in 2015 and I love that movie very much excel for the ending I felt that the ending let me down and it just did not live up to the hype but you know if you feel differently that's okay because I know a lot of people did enjoy that movie a lot more than I did or at least the ending now this movie annihilation is being based off of a book called annihilation as well I saw saw being based off the first film in a trilogy of books first one being called southern reach and I did not read that or the other book as well but it is being based off that it stars the people that I noted the most was Natalie Portman and Tessa Thompson of course I know Tessa Thompson from Creed and she was also a Valkyrie and Thor Ragnarok which came out last year Natalie Portman of course she did Blacks one that came out a number of years ago and won the Oscar I believe she won the Oscar for best actress in the leading role that movie was fantastic I loved it from beginning in so I'm a fan of Natalie Portman didn't really like her in the Star Wars prequels but you know I was really interested in this movie because I am also really into science fiction and things like that and I'm very curious person you know so when I see the trailers like this to where there's like this hazardous dangerous zone and this other advertising it is like okay you know people going in but they're not able to come out and we're trying to figure out what's going on and you seeing Natalie Portman walk through all the wilderness with like an assault rifle and she's taking things out you know that really did intrigue me I'm like okay you know I'm on board with this you know but well I'll save that just for a second but for the most part I really did enjoy the film something that I noticed early on as I was like why I think this film past the the Betul test named after Allison Betul the Betul test excuse me if I'm not pronouncing that right and what the Betul test is it's a test that's in films that's been in Hollywood for some time to where you can have a scene to where it is only women in the scene and the women are talking for an extended amount of time I forgot what I tried to look up exactly how long it takes but I couldn't find it but it's women in the scene no men and they can't talk about men either so nothing but women in the scene and the women are talking about no they're not talking about a man or a or bounding the type of love interest anything they're just talking about other things and I think that the film past this on a number of times and that was like one of the first thing I noticed in the film now early on things were a little wonky for me maybe the first 10 or 15 minutes because things are bouncing back and forth I was unable to understand everything that was going on but at the same time I did not find myself attached to the characters or the story I just really did not care what was going on things really picked up for me when they actually got to the hazardous danger zone and when it was going inside and kind of describing you know what the what the the scientists were discovering you know through its inception of I guess crash landing on earth this has a very strong cast like I said with Natalie Portman and Tessa Thompson there are five main female leads in this film I think they all did a great job also this film kind of lets you know early on who survives or who doesn't per se and that's not a necessary a complaint but at the same time it does take away from the mystery and there is a lot of mystery in this film that is one of the best things about it when they're in this zone you're just kind of just like they already know what they're in for but when they're inside this zone just trying to figure out what is going on why it's going on and just trying to figure everything out that is that was one of the most intriguing things to me just the mystery of it there's also a nice horror element to this film as well a lot of nasty images some things that'll make you kind of turn your seat and kind of hold your stomach and cover up or I like this I mean some of the designs from the creatures I found very fascinating some of them I found hideous they had a great design to them but at the same time I was like oh my god that's nasty I don't look at that right now that's disgusting but at the same time that's one of the reasons why I praise the film because you don't want to just be sitting there you know monotone just kind of stoic just looking at the screen I mean this film does kind to strike emotions out of you and I think that it did a great job there whether I was kind of swarming in my seat or not so the horror element was great I love the cast of the women I was very intrigued by everything and there I like how they spread everything apart by having one female one woman being a biologist the other one an anthropologist a psychologist a surveyor and a linguist and that's kind of you know seems kind of smart to me when you're kind of in this foreign territory just trying to make the best understanding what's going on because you need a biologist you need somebody that can read different languages you need psychologists to be able to you know decipher if everybody is staying sane or going insane or becoming a lunatic so I like the balance there but it's really hard to talk about without spoiling the film but really what comes down to it is since there is so much mystery behind this and you don't know what's going on in this hazardous zone what makes the film where there is great or bad to me is if the ending pays off because there are so many unknowns and you just want to know what is going on you know why is this happening and so you really want to know if it pays off and in my opinion the film does not pay off I was very disappointed with the ending I feel extremely let down by everything that went on I feel a little bit cheated and I don't think that that's fair the film started out okay then it got really really good and you're just so you know eager to find out what's going on and then they just kind of like to win completely left not just with the storytelling with the storytelling the characters and also the CGI elements of this film like the last 10 minutes of this film maybe 10 or 15 minutes I'm just kind of looking like what the hell is going on I think I have an idea what's going on after I left the screening I kind of stood out in the hallway a little bit I didn't want to seem like a creeper but I kind of like strike the conversation with some random people and then this other guy you know how y'all really understand what was going on and then this other guy came and we were all talking and I was like can I understood this I understood that and he was like yeah and you know this happened here and that's why this turned into this right here and that's why at the very end of the movie this was there was a reaction like this but it wasn't a reaction like that early on in the film and I was like okay I understand that that makes a little sense but at the same time I just still didn't like it I'm not saying that it's a horrible film I know that there are going to be some people walking out of this that you know really loved it I will say this if you was not looking forward to this film you probably don't want to go see it if you were looking forward to it or just didn't know still go see the film so if you're really looking forward to it go see it if you was on the film to go see it but this is just something to where you was like I don't know I needed to hear the opinion of other people this probably won't be for you but hey you know that's just my opinion then again you may like the film if I had to rate it out of a one out of ten and I also want to say guys the effects was great and the music and score was great too just that ending really let me down big time if I had to rate annihilation out of a one out of ten I would give it a six out of ten yes a six out of ten but guys that's just my opinion have you seen annihilation or do you want to see it have I turned you off do you agree with me or do you disagree with me let me know in the comment section below let's get this conversation going to keep it flowing if you liked this video go ahead and give me the thumbs up and if you don't this fine go ahead and subscribe to my channel go to my website check me out there book market and also look me up on social media Facebook Instagram and Twitter all that good stuff it's right there at the bottom of the screen and I made it very easy by providing a link to all that good stuff down in the description box below but guys I just want to thank you again for tuning in to my opinion slash review for annihilation directed by alex garland and before you go don't forget that my name is brennan Keith Avery and that's just my opinion peace


Hello and welcome to this session in which we'll discuss preventive versus detective controls. This topic is covered in many courses but primarily auditing as well as IT information system controls and sometime it's covered in managerial accounting. So what is preventive versus detective versus controls? Well the first thing let's talk about what are controls. Controls are policies and procedures to safeguard assets and minimize financial reporting errors and or fraud. So simply put these are techniques, policies, procedures to do what to make sure your assets are protected and try to minimize or eliminate maybe you cannot eliminate financial reporting errors and fraud. So this is what controls are. Now what do we mean by now preventive controls? Now we're going to look at many examples that deals with control. How would you save your assets? How would you minimize financial reporting? We're going to look at actual example but that's the overall idea. What are you doing to making sure your assets are protected and you are not getting errors into your accounting information system? You're avoiding this. So what are preventive controls? Preventive controls are your first line of defense. In other words you start with preventive controls. It means what? It means you want to prevent the error before it occurs. So you have to have controls and we're going to look at specific examples but you want to make sure you know what preventive is before it happens. So a deter undesirable event from happening from the get-go. So before it happens you try to eliminate that error. That's the most effective control. Why? Because you're not letting the error enter into your accounting information system. The problem with preventive controls is there's an upfront cost. There's design cost. You want to make sure you do it properly and most of the cost is upfront but once it's working then you will minimize those errors and you will prevent you will prevent the errors and you will safeguard your assets. What are detective controls? Think of detective controls as your second line of defense. Well it detected the error after it happens. So now the preventive wasn't good enough. Now you got to the detective. Now you want to find the error after it happens. Well there's a continuous cost here. Why? Because you have to constantly look for the errors because preventive you do it once you set up the system. Detective you keep on looking into your accounting information system to find any errors that has to do with your financial reporting making sure your assets are productive. And the third type of control it's called corrective controls and basically from the word corrective once you find the error. So a preventive did not stop it. You found it in detective. Now what you do is you take corrective action. Correct the negative effect of the error. Maybe you create a new control. Maybe that you overlook that control but now for the corrective you will be able to restore or repair the damage that has been deducted. So those are the three controls preventive, detective and corrective. Specifically I'm going to be focusing on preventive giving you examples of how preventive controls work and giving you examples of how detective controls work. So you need to know when you look at a control what is that control? Is it detective? Is it preventive? And how does it work? Now before we define those and give more examples actually we just define them give more examples. I would like to remind you whether you are a student or a CPA candidate to take a look at my website farhatlectures.com. I don't replace your CPA review course. I don't replace your accounting course. My motto is saving accounting students and CPA candidate one at a time by providing resources, lectures, multiple choice, through false that's going to help you with your courses, understand the material better, which you will excel in your courses, which in turn will help you excel on the CPA exam. This is a partial list of my accounting courses. My CPA material is aligned with your Becker, Roger, Wiley and Gleam. So it's very easy to go back and forth between my material and your CPA review course. If you have not connected with me on LinkedIn, please do so. Take a look at my LinkedIn recommendation. Like this recording. It helped me tremendously. Share it with others. Connect with me on Instagram, Facebook, Twitter and Reddit. So first let's talk about preventive controls. What are preventive controls? Again those are your first line of defense where they're going to prevent the error from happening up front. What type of control can the company implement to have preventive controls? One is authorization. What is authorization? What is authorization? It means you cannot do something unless someone reviews it beforehand. So someone is authorizing the transaction before it occur. It requires management to formally approve certain type of transaction. Now you don't want to do every transaction because it could be time consuming. It could be a costly, but you want to have certain transaction above a certain limit transaction that you think that are sensitive important, haven't authorized by someone else. I'll give you an example. For example, when you want to buy from someone, for example, more than $2,000 or $5,000 or $500, depending on the size of the company, you cannot make that purchase unless someone authorized this transaction. For example, before you pay your employees, someone authorizes this process, review their time card, make sure they work the hours that they're supposed to work. Usually that's a supervisor and the supervisor will authorize it, then someone will pay it. Another preventive control is called segregation of duties. What is segregation means? Segregation means dividing or separating the responsibilities. Duties are responsibilities. So what you want to do when you have a transaction, you want many people involved in this transaction. You don't want one person taking a transaction from A to Z. Why? Because there's no checks and balances. So segregation of duties is a preventive control. By segregating the duties, you make sure people are looking over each other's shoulder, not only looking over each other's shoulders, that's not the point. The point is to check each other's work, checks and balances. So what you do is you want to segregate three things, authorization. So the people that authorize the transaction cannot record the transaction. Why? Because if you authorize it, you want someone to record it to make sure it was authorized properly. If you can authorize it and record it, it defeats the whole purpose of authorizing. Same thing with recording. If you can record the transaction and authorize it, it means you can record anything you want to. You cannot record anything you want to because you need authorization beforehand. So authorization, recording, and the third separation of duties, the third element is custody of the asset. So if you have custody of the asset, and let's assume cash. Well, if you have custody of the cash, you cannot authorize any transaction, you cannot record any transaction. And the same concept, if you can record the transaction, you cannot have authorization to the cash or any other asset, cash inventory or any other asset for that matter or a count receivable. Why? Because if you can do all three things at the same time, you can steal from the company and cover your tracks. So that's the purpose of segregating or separating the responsibilities related to authorizing, recording, and maintaining custody of the asset. You would reduce fraudulent payment, which is basically theft. Third preventive control is physical guards and physical safeguards. And here, hopefully, you can use your imagination. What are we talking about here? We're talking about fences, cameras, locks, sensors, physical barriers to protect the asset. Why? Because you don't want to have people have access to the assets easily because it can be misappropriated. The technical word misappropriated, the simple word theft. You want to prevent theft. So that's what you do. No one can access the cash unless they are authorized. No one can access the inventory unless they're authorized. This is what you do. So those are some preventive controls that the company can make to safeguard of the asset and minimize the error in the accounting system. What are some other preventive controls the company can do? A job rotation. Don't keep the same person, especially in the accounting department, doing the same job repeatedly. Have someone else switch people from accounts payable to inventory or from inventory to cash, switch their responsibilities. So this way they can review each other's work. Proper hiring and training of employees. That's a preventive control right from the get go. When you hire someone, you vet them. You vet them. You look at their background. You look at their education. You make sure they're qualified and make sure they're competent. Also train them. So this way you prevent errors from happening from the beginning. You could also have what's called pre-formatted input. For example, there are certain items that the employee cannot change. The date of the transaction. It's automatically there if it's a computer system and other inputs as well. But again, the point is to prevent errors from happening upfront. Also having an information security system. An information security system can be considered both. It have a preventive measures and detective measures. Here we are. We are talking about a control such as passwords. So if you are an AP clerk or an AR clerk, you can only access that module in the system. Or if you work in payroll, you access that module access logs. You can know who access what at what time and what did they do. You can review the logs to ensure appropriate data restriction because you don't want access. You don't want to give access to everyone in the company for everything in the company. So information system could be considered preventive right from the get go or like access logs is detective. You can go back and find out what happened. Let's talk about detective controls. The first thing is in detective controls is you have to maintain records. You have to have a policy that we want to keep those records for three years for five years emails documents purchase order sales order so on and so forth because if you have no record, then how can you detect something if you don't have the evidence to look at? So maintaining written or electronic evidence to support transaction. If you don't have a policy, you should have a policy. How long should I keep those records? Five, seven. Now for publicly traded companies, they are required for a certain amount of time to keep those records. But even if it's a small company, you should have your own policy. Performance review. You're reviewing other people's work. How would you do it? Comparing actual performance to various benchmark to identify any unexpected results. You can do variance analysis. You can do budget actual versus actual versus budgeted. Those are performance review to detect anything that's unusual going on with the company. So you should always review the transaction comparing the performance to some standard to some benchmark. Why to detect anything that's going on wrong reconciliation is an important detective control as well. What is reconciliation relating data set to one another to identify and resolve discrepancy? The best example of reconciliation is a bank reconciliation. In a bank reconciliation, you would look at your bank statement and you will compare your bank statement to your general ledger for cash. And what you do is you compare everything on both to make sure because they should be the same. Those two, your bank statement and your cash general ledger should have the same figures. So you want to make sure everything in your bank statement is properly recorded in your general ledger and everything in your cash general ledger is also recorded in the bank statement. Because of the timing differences, what you have to do on a monthly basis, you have to prepare a bank reconciliation. Now, if you go to my intermediate accounting course, I have or my financial accounting to farhatlectures.com, I have lessons and examples about how a bank reconciliation work. But a bank reconciliation or any form of reconciliation, this is one example of a reconciliation. Also, you can add up all your individual general ledger, sub ledger account receivable, all the customers and compare that to the general ledger account receivable to make sure all the customers are being accounted for in the account receivable. That's another form of a reconciliation. Reconciliation is very common in accounting. You really need to know how to perform reconciliation. You could have many other detective controls that are IT in nature, information technology in nature. Those are batch total, hash total, check digits, limit digits, validity checks. We're not going to cover them in this session because this session is very general. But if you're looking more on IT control, go to my audit course farhatlectures.com where I discuss these topics in detail where I have IT controls. Also, you have to understand there are limitations of control or controls. What are the limitations? Mainly, there are two limitations for control. One is cost benefit. Yes, the company can have enough segregation of duties, enough IT controls to prevent errors from happening. But sometime, the cost of having maintaining a control is very expensive relative, very costly relative to the benefit. So there should be a cost benefit. It doesn't mean cost benefit is the only driven aspect of having a control.  Is it worth it? If you have inventory worth worth of 5,000, how much you will spend to safeguard that inventory? Will you spend 20,000? Will you spend 1,000? You have to have a cost benefit. What is my cost? What's my benefit? Another limitation of internal control. Limitation means the internal control is not working as as properly as it should. Like all the controls is collusion. Well, let's assume you segregated the transaction between three different individuals to make sure they are looking over each other's work. What happened if the of those individuals collude with each other? Now three, it's harder. Maybe two, it's easier. But the more people you have involved, the better off you are, unless those people are working together to defeat the internal control, then the internal control becomes baseless, useless, and it doesn't work as it should work. What should you do now? Go to farhatlectures.com, whatever course you are taking, if it's auditing or managerial accounting and work multiple choice questions. To reinforce those concepts, what we just learned. Accounting is an investment. Don't shortchange yourself. Subscribe, study hard, good luck, and of course, stay safe.


Pigmentation in the iris has the same function as it does in the skin, protection against strong sunlight. And pigmentation or the degree of pigmentation is the primary indicator of constitution. So primary constitution is a colour typology. In a dark iris the pigmentation permeates the whole iris. In a light brown or hazel iris the pigmentation is partial. We'll see some pictures of this in a minute. And a blue or blue grey iris has little or no pigmentation. And as we've said before the blue in a blue iris comes from the base leaf or the pigmented epithelium of the iris. Which is a midnight blue layer of tissue that lies behind all the fibres that we can see in that complicated structure that we've been looking at. So here are our three primary constitutional types. And this is a little bit of a preview of what we're going to be doing next in our next lesson. And we're going to start putting the names in here too. The correct iridological constitutional names. So for the blue iris no pigmentation. Because pigmentation in the iris is always in the yellow brown red spectrum. And we call this the lymphatic type. And you can already start to see lymphatic. That's got to be something to do with the lymph and the lymph system. You'd be absolutely right. We'll discuss that in more detail as we go through. Next to that we have the intermediate type. Brown grey or sometimes described as hazel. And the thing about this is that it can be quite pale or it can be almost completely dark. It's a very wide range of, you know, spectrum of colour that you can see in this particular type. We call this the mixed type because it is a mixture of the two pigmented and unpigmented. Sometimes also called the mixed biliary type. And that word biliary refers to the liver and gallbladder. So we know there's something to do with liver, something to do with the gallbladder, maybe to do with digestion affecting these types. And then lastly on the right hand side we have the pure dark brown iris. That's fully pigmented with no, and you can see in the mixed iris in the middle that you can't see much of the fibre structure in the middle where the pigment is densest, but as it fades towards the edge of the iris you can start to see the fibres underlying it. Whereas in the far right picture, the dark brown iris, you see no fibre structure, at least not in the ciliary zone. And the name that we give to that is hematogenic. And those of you who are familiar with your anatomical language might already know that that's going to have something to do with blood. So blood composition is the important factor in determining that particular constitutional type. And that's the primary classification. We have a lot more detail to add to that in the next class, but that's where we start with our constitutional analysis by looking at what colour the iris, and then asking relevant questions about the individual's health experience. If you enjoyed this video, please give it a like and subscribe below so you don't miss any future content. To learn more about CNN or its courses, head to www.naturopathy-uk.com