This year will usher in the seventeenth year of my programming. My programming journey began in the late 1990s when I was in college, mainly involved in form-based web design, traditional ASP, and Microsoft Access databases. Programming that was originally only a hobby has now become my career and passion. I have been studying, swearing, succeeding, and failing for half of my life, and often can't help but bend the code for the beauty and complexity of nature.
I was immersed in the code for a long enough time, so I saw the prosperity and demise of many languages ​​and platforms. I saw that many models were popularized, blamed, and then promoted again. At some point, I often can't tell whether this is the trend or the future.
The fashion trend of programming is short-lived, but the rules I stick to often work in other parts of my life. In fact, life is like code (I have bought this domain name to prove this!). The following are the three great lessons I have summarized, and the big waves of programming and living again and again.
1. A plausible decision is often a trade-off.
Great debates always happen in the development community. Whether it's a recent debate about TDD as a viable approach to web development, or what level of developers should use ORM (or micro-ORMs). Whether it's .NET MVC should be better than WebForms or a JavaScript-centric app should be more popular than a page-based app. For me, the answer is the same: see the trade-offs after your trade-offs?
In any debate comparing the two popular methods, we will always proceed from our own position, and the interests of the two interests should be taken seriously, and the two evils should be taken lightly. Earlier in my career, I was obsessed with pursuing the so-called correct answer. The process of feeling is linear: getting rid of the old ways of doing things and turning to the embrace of new and better methods. There was a time when I was convinced that writing my own SQL queries was an outdated exercise and ORMs were the last winners.
However, I understand that a better approach should be determined by the content. For example, today's fully-fledged ORMs provide great services in isolating the lengthy pipelines that map related data grids to objects, but isolation also makes some non-standard queries difficult and potentially inefficient. The n+1 select problem is a classic trade-off between writing less code and writing more efficient code. The extent of my use of ORM is entirely influenced by the amount of data I am expecting the application to use, the potential time constraints I am exposed to, and the long-term scalability requirements of the app. (By the way, I am currently a micro-ORMs, such as Dapper's loyal fans, which allows me to write my own SQL and some sophisticated object-relational mapping).
I have applied this experience to other aspects of my life. Should I buy an apartment or a long-term rental house? Should I start my own business or work for an established company? There is no absolutely correct choice. When you weigh the pros and cons, you can better cope with the various problems in your life.
2. Clarity is not always related to simplicity.
Like most engineers, I am continually refactoring until the code is as small and succinct as possible. If you can choose less and more concise code to accomplish the same task, then why should I choose a solution with more code? Often, a cleaner language leads to better communication. Adding a snake will only hinder the extraction of core information. However, the ultimate goal should not be concise – but should be communicable. For me, the following straightforward code, when it's longer...
If (HasFarm() && HasBoat()) { Broadcast("You are wealthy!"); } else if (HasFarm() && !HasBoat()) { Broadcast("You are OK!"); } else if (! HasFarm() && HasBoat()) { Broadcast("You are OK!"); } else if (!HasFarm() && !HasBoat()) { Broadcast("You are poor!"); }
...but more specific than this succinct version.
(HasFarm() && HasBoat()) ? Broadcast("You are wealthy!") : (HasFarm() || HasBoat()) ? Broadcast("You are OK!") : Broadcast("You are poor!") ;
Although this is a matter of taste (some people may think that the latter looks more obvious), the point I want to make here is that sometimes the greatest method of interpretation is not simplification. This experience also applies to everyday life, and I spend a lot of time thinking about how to better communicate the message so that the other party can receive it – sometimes more detailed explanations are not without value, but must be more clearly communicated.
For example, I want to tell my dad more clearly and in more detail how to turn off the iPad ("press and hold the button on the right side for a while..."). Or, I seem to have typed some of the content I have submitted to my local branch to my colleague ("The mistake I just made has been fixed"), and then when it comes to deploying updates to the product, I can Clearly know which specific commits are merged and appear ("Check 4812-4822 lines, including the DoneDone issue in the 6/15 release, which will be presented in the product release tonight.").
3. Accumulate benign debts and continue to repay.
I grew up in a family that was particularly afraid of debt. In the mid-eighties, my parents poured all their money and made a down payment of 75% of their first house, and then paid the remaining amount within seven years. Paying in cash is the norm. Credit payments are almost a sin in their view. As a child, my opinion is that debt is completely bad. I never think that debt is an advantage.
Until I saw how others treated debt – when I was in my early 20s – I finally knew that debt could be beneficial. If you can afford the debt reasonably, then you can succeed. If you can accelerate your growth later with a better upside, debt can be a huge asset.
The same is true for the code. Sometimes it's worth your debt now—missing abstractions or having some unoptimized SQL code—if doing so allows you to post content to a growing audience faster. The key is to understand that you have to pay it back, and that you can repay it after an appropriate period of time.
This is the trick of debt in life and programming. Repayment of debt needs to be continued. Use 10% of the time for refactoring, which is equivalent to paying your credit card bill on time. If you maintain a sustained, supportable debt repayment status, then accumulating debt is actually good for you.
Copper Lugs,Copper Cable Lugs,Plating Copper Cable Lugs,Copper Tube Terminal Lugs
Taixing Longyi Terminals Co.,Ltd. , https://www.lycopperterminals.com