2024-10-03
한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina
bob answersprogrammer’s “35-year-old crisis”:
thinkthe idea that programming is only for young people is actually an illusion, but it is indeed a very influential illusion. this illusion exists because the demand for programmers has soared like a rocket over the past 70 years.
in fact, we "old programmers" are still there, but the number is not so conspicuous.
author | wang qilong
produced by |new programmer》editorial department
imagine if you had written code for more than fifty years in your life and were still programming until you were 71 years old. how would you view the current era of explosive ai programming?
robert c. martin is known as the world-famous programming guru. this man is called "uncle bobthe old man (uncle bob) is a pioneer of agile development and design patterns. he has been engaged in software professional work since 1970 and has been engaged in related work for more than 50 years. the famous "solid five principles" are the five design principles in the field of object-oriented programming. , came from his handiwork. uncle bob’s attitude towards ai is very ambiguous: from a practical point of view, he pointedly complained that “today's ai is just a junior programmer with only half a brain, and will never really grow.", because the tasks that ai can complete are quite limited; but even though he is over 60 years old, he still has great expectations for the future: "by the time we create machines that can think like humans sometime in the future, programming skills will become obsolete.”
as a world-renowned software development guru, uncle bob's masterpiece "clean code" once defined what "clean code" is and described a series of effective operating practices.
recently, the chinese version of uncle bob's latest book "functional design: principles, patterns and practices" was published. many people wonder why this leader of object-oriented programming "betrayed" to the "enemy camp", and uncle bob he also displayed his always straight-forward character and directly "rebutted": "in recent years, some articles have claimed that functional programming is opposed to object-oriented programming and that object-oriented programming is outdated. i disagreed with this view and decided to write this book.”
functional programming is more than just "programming with functions." functional programming is programming without assignment statements.
once you try programming without assignment statements, all other features of functional programming fall into place. if you want to deal with functions, you must use recursion. all these things come naturally the moment you decide not to assign values. so, that’s what functional programming is all about.
——"functional design", robert c. martin
the above remarks are all from the interview with uncle bob by csdn "new programmer". we had an in-depth exchange with this "living fossil of agile development" and listened to his personal account of how he, as one of the 17 software industry leaders, co-published the "agile manifesto" 23 years ago (2001).historical details, and also learned the latest views on ai programming from this senior programmer with more than 50 years of development experience, which refreshed many people’s past views on uncle bob.historical impression. the following article will start with uncle bob's memories of 1970, taking readers back to the "ancient era of programmers" when even the world wide web was not yet born.
"new programmer": before the interview begins, could you please give a brief self-introduction?
uncle bob:okay, my name is bob martin. some people call me uncle bob. i have been a programmer for a long time.more than fifty years.when i first started programming, computers were big enough to fill a large room and expensive, running into the millions of dollars.
i've worked with a variety of programming languages, includingassembly language, cobol, fortran, pl/i, c, c++, pascal, java, c#wait. over the years i have been involved in developing a variety of systems ranging from financial systems to embedded real-time systems and process control systems. therefore, you can say that i have extensive experience in this industry.
additionally, i have authored several books, including clean code (Clean Code), "the way to clean architecture" (Clean Architecture), and the book we are discussing today is called "functional design》(Functional Design)。
"new programmer":besides writing books, what do you do in your spare time? by the way, i often read your twitter and found that about 50% of your tweets are social news about the us election and trump, and the other 50% are about technical content, programming, and your views on code.
uncle bob:indeed. in non-election years, about 90% of my tweets are about software. but since this is an election year, there is more content covering other topics. when i'm not writing books or programming, i do a lot of things. i like to ride my bike and travel around a lot. i'm also a pilot and have a lot of fun flying around in my own plane. i have a huge family withfour children and ten grandchildren., i usually visit them as much as possible, so my time is arranged very fully.
"new programmer": please take us back to the starting point of your programming career and tell us the story of when you started working as a programmer in 1970. you were 18 years old at the time, and the first languages you learned were assembly and cobol. can you talk about your experience when you first started?
uncle bob: well, there weren’t a lot of college courses at that time. i had no interest in school at the time. at that time, the vietnam war was raging and there was a lot of riots and unrest on campus. and,i have learned a lot about computer programming, and learned cobol and fortran, and even several computer assembly languages. so, i don’t think there is any need to go to college。
as for where my programming career started, it all started when my mother bought me a little plastic computer when i was 12 years old. that toy has three flip-flops and six and gates, and you need to turn a small lever to operate it. some rubber bands and levers inside move the parts, allowing it to do simple calculations, such as counting from 0 to 7, or counting from 7 to 7. the count returns to 0. in addition, you can also program it to add two bits to generate a sum bit and a carry bit. i even wrote a lot of interesting programs on it - the programming process is to add a small tube inserted onto the latch, these tubes block the rod from entering the slot, thereby changing the condition of the trigger.
so, i spent a few weeks learning how to make that toy computer work, and through that process, i became a programmer.i've been a programmer ever since。
that was my starting point, and then my dad bought a lot of books about computers and programming languages to give me as much information as he could. then, at age 16, i got a programming job writing programs for the honeywell 200. the job lasted two or three weeks, when istill just a boy, i did it during the summer vacation and it was so much fun.
about two years later, when i was 18, i got a full-time job writing assembly language and cobol for the ibm 360. soon after, i began programming many microcomputers in assembly language. at the time these computers were produced by the varian corporation, many companies were building microcomputers at that time, but few were successful, and it was digital equipment corporation (dec) that dominated the field. i then became very skilled at programming the pdp 8 and pdp 11, devices that were produced in the early 1970s.
"new programmer": the 1970s was a really interesting time. the world wide web had not yet been invented, and usenet had justappear. you are one of the first usenet users in the world, and i also learned that the nickname "uncle bob" was originally given to you by a colleague at the company. later, you mistakenly used this nickname as a signature on usenet, and eventually the name successfully changed from a nickname to your real name. can you share the story?
uncle bob: i was working at a startup called clear communication, which was the start of my careerfourth stop, sometime between 1987 and 1989. there, a coworker gave everyone a nickname, mine was "uncle bob." it was a bit annoying at first because he was always walking around calling me by this nickname: "uncle bob, what about this?" "uncle bob, what about that?".
i left that company and became a consultant, and no one called me “uncle bob” anymore. turns out, i kinda missed the title, so i made the mistake of adding it to my email signature.
i was very active on usenet at the time, often posting articles on newsgroups such as comp.object and comp.lang.c++, and people began to notice "uncle bob" in my signature. i was at a c++ conference one time, probably around 1990, and someone pointed at me from across the hall and said, "look, that's uncle bob!" i thought, oh my gosh, i made a mistake, i really should change my signature. - but then i realized that "uncle bob" would actually be a good brand, so i kept it.
"new programmer": usenet can be regarded as the first social media you participate in. like many legendary developers, you like to participate in different communities or forums. i once saw you posting on hash note: "i am robert martin. you can ask me questions." at that time, many developers actively asked you ask questions and join the conversation. now, that communication seems to be taking place primarily on twitter.
uncle bob:right,twitternow my main social media. i also use facebook, but mainly to keep in touch with family and friends.
"new programmer": you were initially attracted to c and c++, but you also mentioned that you tried languages such as snobol, focal, alcom, and basic out of interest. what other programming languages do you think can be called "interesting"? especially among the new programming languages that have emerged in recent years, which ones do you find interesting?
uncle bob: the language i find most interesting at the moment isClojure, a language that i have invested a lot of time in learning. this surprised me because clojure is actuallyLispa dialect of lisp that i never thought i would learn.
for the first thirty years of my career, i never considered learning lisp because i thought it was a terrible language—because, of course, i didn't understand it at all. until one day, i read a book called "the structure and interpretation of computer programs". the language used in the book was lisp, which immediately attracted me. all of a sudden, i became a big fan of lisp. i want to find aways to use lisp in your daily life, so i met clojure.
clojure equivalenta lisp dialect that can run on the jvm (java virtual machine), it was perfect for me, so i started learning to code clojure and having fun doing it, it was a great pastime for me.
additionally, there are other interesting languages such asForth, a stack language based on postfix expressions that is different from any language i have ever used and very interesting.Prologit is also a very interesting language. you do not need to directly tell the machine what is correct, but let the machine get the correct result by solving it. overall, these are very interesting languages that everyone should check out because they are very unique.once you learn a very different language, it changes your whole outlook on code。
"new programmer": i understand some of your previous comments on ai code. in your opinion, large language models are sometimes good and sometimes stupid. while the ai's code explanation helped a bit, you still stated that it shouldn't be blindly trusted.
uncle bob: yes, programmerit's easy to become overly reliant on tools like copilot and uncritically accept the code they generate when you see it, and that's dangerous. you need to be critical, and while some of this code is okay, most of the time you need to be very careful with ai-generated code. so my suggestion is,be careful, use it like a tool, and always remember that tools can harm you if used incorrectly.
"new programmer": so, for programmers who are just starting to learn, how should they use ai to grow? i have heard two completely different views in interviews. one is that novice programmers should fully embrace ai; the other is that ai will destroy junior programmers because these people do not have the ability to judge the quality of ai code. .
uncle bob: just like junior pilots shouldn't use autopilot.please learn how to fly a plane first, and then use autopilot when you don't need to pay attention to details. the same is true for ai.junior programmers should not rely on ai at the beginning because they do not yet know how to judge the quality of the output code. many times, that code is not only bad, it's just wrong and doesn't work at all.
what i'm really worried about is when junior programmers are given a task and they choose to use ai to implement it. after ai gives the code, these novices will always think: "well, it was given by ai, it must be fine", and then lose their jobs. so my suggestion is,you should even taper off your use of ai during the first few years of your career。
"new programmer": nowadays, more and more ai-generated codes are used in different projects. how do you balance code quality and generation efficiency?
uncle bob: my way of balancing isuse ai to generate code first, then clean it up. i won't let it stuff bad code into the project. so, if the code generated by ai works and passes my tests, then i will go back and refactor, clean and improve it without hesitation. such as changing the naming, extracting some functions, adjusting the structure, and so on.
because i don't expect ai to generate great code. so i'll clean it up and turn it into my own code. in this way, it is my project and the code i wrote.
"new programmer": about five years ago, someone asked you "what trends in software engineering are overrated?" and you cursed microservices.five years from now, are there any other trends that are overvalued?
uncle bob:the overrated trend right now is of course generative ai, no doubt about it. it's new, and anything new is overrated. five years from now, everyone will look back and say, "we probably overestimated it." that's the norm.
"new programmer": your old acquaintance kent beck said something when the ai wave was rising. he said he reluctantly used chatgpt and found that 90% of his skills were now worthless, while the value of the remaining 10% had increased a thousand times. how helpful can generative ai be?
uncle bob: to be honest, i don’t think ai is particularly useful. in the simplest of cases, it can be somewhat helpful. for example, when i was doing some very basic coding work, ai would give me some code. i would take a look at it and think it was okay, so i would continue working on it. then, the ai will often continue to work according to the context, until once things get interesting, the ai becomes increasingly unreliable——the more complex something is, the less helpful it is。
ai can handle small things, but not at all if i want it to refactor and improve the design. furthermore, ai can’t help much when it comes to writing tests.
"new programmer": you’ve said before that it will be a long time before coding schools become obsolete. will there be a specific point in time that identifies that moment? is there an end to technology?
uncle bob: this is an interesting question, but i would think of it from a science fiction perspective.by the time we create machines that can think like humans sometime in the future, programming skills will become obsolete. but let’s be honest, that’s when all skills become obsolete.so i'm not sure that's something to look forward to. if it's going to happen, i think it's very, very far in the future. you know, the human brain is much more complex than the entire internet.
"new programmer": indeed, this reminds me that you also said that everyone should return to asimov’sthree laws of robotics, even if it would create a race of "robotic slaves." how do you understand artificial general intelligence (agi) from a philosophical perspective?
uncle bob: yes, although i think it is unlikely to be achieved in the short term, we do already have genetic technology. if we ever create conscious machines for our own survival, i think something like asimov's three laws will be absolutely necessary.
"new programmer": on this basis, ai should beopen sourceto avoid this happening? do humans need open ai or closed ai?
uncle bob: different companies definitely want to keep their own secrets, and i don’t think there’s anything wrong with that in itself.the real problem with ai is energy consumption.it consumes a lot of energy and will continue to increase as technology becomes more sophisticated. this makes its cost quite high. so we have to see how far ai can develop today, and see how well these large language models can do. however, they consume a lot of energy, just like nuclear power plants.
"new programmer": let’s step away from ai and talk about human-to-human topics.
someone once asked "who is your mentor in life?" and your answer was "books are my mentor." through books, you met outstanding figures such as martin fowler and kent beck, and even worked with these two later on. . so, as that yearone of the 17 people who created the agile manifesto, can you reveal what your relationship is like?
uncle bob: in the past, we often had many software-related meetings, but now there are much fewer such meetings. i attend various types of conferences, such as c language conferences, design pattern conferences, and some general software development conferences. through these activities, i met many people.
for example, i met at a design patterns conferenceKent Beck, met at an early extreme programming conferenceMartin Fowler. i met most of these people face to face. they were both my partners and my mentors. i learned a lot from them. they are also my peers, and we learn and progress together. a lot of what i learned came from programming books from the 1960s and 1970s, such as donald knuth's the art of computer programming, and books from that era were very important sources of information for me.
so, when i was about 30 years into my career, i started going to conferences and meeting people face to face, and it was in this environment that we foundedagile meeting. most of the people who attended agile conferences i knew before, either through correspondence or having met at conferences.
"new programmer": we can often see a point of view, that is, "is agile development really applicable?"
there was a period in the past when many developers pursued fast delivery and ignored the quality of software. this may be a misunderstanding of agile.
uncle bob: this is indeed a misunderstanding of agile. agile isn't about being faster, it's about understanding where you are. you do agile development so you know exactly how much progress you're making, how fast you're making it, and whether you're meeting your deadlines. in other words, agile is a great way to help you understand just how much trouble you're in. it ensures that you aren’t surprised when deadlines slip, and it gives everyone a clear idea of progress because we might not be as fast as we thought.
many people mistakenly believe that agile is a fast method, and some people also market it as a fast method, but this is always a misunderstanding.agility is not a way to make you faster, it is a way to let you know how fast you are.so, agile is not obsolete; it is not an obsolete technology. if you want to know the actual progress and completion date of your project, agile is a great way to do it.
"new programmer": one of your tweets struck me very deeply, that is, “agility was originally founded bydeveloperinitiated, butproject managerintervening in the early stages of the agile movement destroyed the original collaborative relationship. ” can you tell me the story?
uncle bob: indeed, the agile movement was originally started by a group ofprogrammerinitiated. seventeen participants met at snowbird resort to create the agile manifesto. we are all programmers, or at least have strong technical backgrounds. this movement didn’t start from a project management perspective, but one of the founders, ken schwaber, decided to start a course called certificationscrum master(scrum master)" course. this course is designed to train people who want to become scrum masters and teach them how to assist the team in usingscrum method——this is a model of agile development.
project managers have shown keen interest and have signed up for such courses. since most of the participants were project managers rather than programmers, this resulted in the originalthe movement started by developers gradually transformed into a movement led by project managers.programmers were dissatisfied because they felt they were being excluded from this initiative.
to solve this problem, a group of us startedsoftware craftsmanship movement(software craftsmanship) and released the craftsmanship manifesto in an attempt to reconnect project managers and developers. however, this did not achieve significant results.
ultimately, we separated out an "official agile movement" centered around project management, and an actual developer-led agile movement. the latter is still committed to working in a concise and orderly manner and clarifying its position and development direction.
"new programmer": so, what is the significance of the scrum master role? in what ways is this role important? how do we cultivate an excellent scrum master?
uncle bob: the scrum master was originally designed to be a member of the team responsible for reminding other members of the commitments made when using scrum or agile methods. responsibilities include weekly checks on the team's progress, such as confirming that test code has been written as planned and that predetermined estimating methods have been followed. this role is rotated within the team, usually between different members. in mature teams, after several weeks of practice, there is no need for a dedicated scrum master to supervise because team members are already able to consciously execute the established process.however, with the involvement of the project manager, this role gradually evolved into a project management function, which is far from the original intention of the scrum master.as a result, the role of the scrum master today has changed significantly.
"new programmer": you just mentioned the story of software craftsmanship, which reminded me that your signature on twitter also reads "craftsmanship" (craftsmanship), this is a very old word, today it should be translated as "craftsman spirit”。
how should this word be understood? in today's fast-growing industry, is there really no time to focus on quality? as ai advances, software delivery appears to be getting faster. i think ai will help, is that right?
uncle bob: these large language models are really interesting tools and i think they will be helpful to programmers. but they won't replace programmers, and they won't do all the coding. they're not good at writing code, but they can come up with some interesting suggestions. so i thinkthey will be useful, but not enough to make us no longer need programmers.
as for craftsmanship, it is an attitude, an attitude towards work. the best way to explain it is this: when you get home from a long day at work and look in the mirror, you can say to yourself, "i did a great job today and i'm proud of my work." that's itthe way a craftsman behaves.craftsmen are satisfied with the quality of their work. they are diligent and disciplined to produce high-quality work. this is the core of software craftsmanship.
of course, we can discuss many technologies and methods, such as test-driven development (tdd), simple design, solid principles, etc. there are many technologies and concepts. but the fundamental idea is that at the end of each day you can say to yourself, "i did a great job today." unfortunately, many programmers go home, look in the mirror, and feel like they need to take a shower. bath because they feel like they did a bad day. they wrote a bunch of bad code just to meet a deadline, and they need to wash away those bad feelings. that's what craftsmanship is about - going home knowing you've done a good job and feeling proud of your work.
"new programmer": your book "the way to clean code" (Clean Code) also reflects the principle of craftsmanship. does the so-called "tao" of clean code focus more on the implementation of business logic rather than system programming? or is there no difference between the two?
uncle bob:clean code is a set of concepts and techniques that help you work like a craftsman so that you can go home feeling proud of your work.it doesn't matter whether you're implementing business logic or doing system programming. it's just a set of techniques and concepts that help you do your job well and make you feel satisfied.
"new programmer": i have discovered before that, whether it is the developer community in china or the united states, many people think that clean code means a lot ofabstract. so how do we avoid writing overly designed and overly abstract code?
uncle bob: yes, this is a very strange phenomenon, because my book itself does not recommend excessive abstraction, nor does it advocate a lot of abstraction. what the book suggests is,use abstractions sparingly and appropriately, but over-design is not recommended. apparently, there are some programmers who believe that any form ofindirectare all bad, they think the only way to write good code is to try todirect. i don't agree with this view, i think a moderate amount of indirection and abstraction can be helpful, but you have to be very careful because abstraction comes at a cost. so, use abstraction when it helps solve a problem, but be aware of its cost and use it sparingly.
"new programmer": presumably this is the reason why you said some time ago that you would launch a new version of "code cleanliness". can i understand it as clearing the source? but since you decided to completely redesign and rewrite the book, why not give it a new name?
uncle bob: the title of the book was decided by the publisher. i mainly wanted to reiterate the core concept of "clean code", but used different expressions and elaborated on the theme from different angles.
the original book was written 16 or 17 years ago for the audience at that time. and now i'm writing this book for today's readers. it will trysolve more common problems today. i would use different language and take different approaches, making it less directive and more informative, trying to convey the same point in different ways. the message is the same, just expressed differently. i think these two books will ultimately be complementary and readers should read them both.
"new programmer": let’s talk about your new book “functional design”. first of all, why did you want to write this book?
uncle bob:functional programming has grown in importance over the past decade. although people started paying attention to functional programming around 2005, it is actually an older concept, having existed as a mathematical language since 1936, and one of the earliest programming languages was functional.
in the early days, functional languages were expensive to execute, slow, and required large amounts of memory. but now, advances in computing power and memory resources have made the cost of functional programming almost negligible. this brings the advantages of functional programming, especially when it comes to multi-threaded programming. functional programming allows you to write multi-threaded code without worrying about race conditions or concurrent updates. this is because functional programming has no assignment statements and does not change the state of variables.
as i was learning clojure, i found it to be a fun way to code and solve problems. i think it should be combined with other tools like object-oriented programming and structured programming.however, in recent years, some articles have claimed that functional programming is opposed to object-oriented programming and that object-oriented programming is outdated. i disagreed with this view and decided to write this book.
book cover of "functional design: principles, patterns, and practice"
this book discusses how functional programming, object-oriented programming, and structured programming work together to build better systems. it starts with basic concepts, gradually builds up design principles and patterns, and finally combines them into a complete small application. i hope readers understandfunctional programming does not exist in isolation, which works with everything we've learned over the past 50 years.
"new programmer": i have also collected a lot of questions about the new book from the csdn developer community, and most people are most curious about why you choseClojureinstead of scala to write the code in the book? is it because you want to use a more functional language that doesn't support classes and inheritance, to prove that your solid principles also apply in functional design?
uncle bob: part of the reasonindeed. although clojure is not a "pure" functional language, it is very conducive to writing functional programs. however, there is another, perhaps more important, reason why i chose clojure, and that isclojure is very simple。
what i want to convey in this book is the idea of functional programming, not teach a complex functional programming language. i especially don't want to teach a language with complex grammar. clojure's syntax is very simple and has almost no complex syntax. learning clojure is easy, and you can master it by reading the clojure code.
so when i show code in the book, i don't go into detail about how clojure works. instead, i explain some basic concepts and let the reader figure out most of the rest. i also recommend some other documents for interested readers to refer to. but overall, clojure is very easy to understand, sofor those readers who don't know much about clojure or functional programming, they can focus more on the concept of functional programming without being bothered by the language itself.
"new programmer": i remember you once said on twitter that if anyone wants to be mentioned in your next book, they can submit a piece of code that they think is the neatest. does this happen often? how many people typically submit code? can chinese developers also submit?
uncle bob:yes, i did tweet that and got quite a few responses. some people send code snippets via github links or directly. i will probably use some of this code in an upcoming book.if chinese developers want to submit code that they think is very neat, i'd be happy to consider it.but i can't promise to use everyone's code, because the length of a book is limited and i can't put everyone's code in it.
"new programmer": do you have any innovative ideas for digital textbooks and online learning platforms? people seem to be less willing to read paper books these days. how will these new formats revolutionize the way programming is taught and learned? how do you plan to teach programming to the next generation?
uncle bob:indeed,we are now in the digital age, where attention spans have shrunk to less than 20 minutes. but if you really want to learn something, you need to slow down and focus on your studies. several of my recent books have come withvideocontent, readers can watch live demonstrations of programming sessions through the url in the book. this combination of text and video is very effective.
in addition, there is a very interesting way isonline lecture. for example, after reading the printed material, the book will prompt you to visit a specific url to watch the relevant lecture. i think these methods are very useful.
i don’t think the days of paper books are over. they may be converted to e-books, pdfs, or online reader versions, but text books will not disappear. text is a medium with very high information density, which is more dense than videos or lectures, and it is also more convenient to control the learning progress. therefore, i think a combination of diverse learning formats may be more effective, using both text and video.
"new programmer": your book is intended for readers of all levels of expertise, from beginners to seasoned professionals. this certainly presents different challenges when it comes to balancing depth and breadth of content.
uncle bob: my book is really aimed at a diverse group of people, both novice and professional programmers. the key is to provide value to both types of readers without making it too difficult to digest for one or oversimplifying for the other.
when teaching and writing, i assume that my listeners or readers are as smart as i am and can understand my content. it might take a little effort on their part, but i'm sure they'll understand. i do not adjust the content based on my judgment of the reader's ability. i simply deliver my message directly, as if speaking to a peer.
maybe i have more experience, maybe i have been through more and made more mistakes. so i can share my experiences and stories. but i won’t slow down or oversimplify it.
"new programmer": how have you changed the way you teach programming over the years? what new approaches and lessons have you adopted to keep up with the evolving technology landscape?
uncle bob: in the early days, i usually usedtransparencies, and display the course content through a projector, usually preparing a large stack of film to display the content page by page. over time, now i use iPadit's a lot of fun to do a presentation, hook it up to a projector and draw on the ipad screen with apple pencil, and everything will be displayed on the big screen in real time.
during the covid-19 pandemic, we began to teach via remote training tools such as zoom. now, most of my teaching is done remotely. i still use slide presentations and screen drawings, and those methods still work. the only difference is that in remote teaching, i can't directly see the audience's reaction, which is less of an experiencehalf the fun。
"new programmer": another change brought about by the epidemic is that many programmers are worried about being replaced by ai. i saw a statement before that learning functional design can help them keep their jobs, can you elaborate on that?
uncle bob: functional design and the concepts in functional design books are actually designed to help you become a more mature programmer.add new tools to your “toolbox”. functional programming is a good tool, object-oriented programming is a good tool, and structured programming is also a good tool. these should be in your toolbox. test-driven development is a great tool, and it’s best to have it on hand. solid principles are also good and should definitely be in your toolbox. so the purpose of this book is to expand the developer's toolbox, which will definitely help you keep your job.but i don’t think you have to worry too much about being replaced by ai. this is unlikely to happen in my lifetime, and it may not happen in your lifetime, or it may never happen. i have a feeling we won’t see machines capable of human-level intelligence.
"new programmer": regarding functional design and object-oriented programming, i believe many people must have asked you which one is better. but what i want to ask is, do you thinkwhich one is the current ai better at?for example, is functional programming better suited for ai code generation? it has no state, a function can be generated when used, and each function can also be automatically generated and verified by ai. so, if ai is better at functional design, will programmers who only know functional programming face a greater crisis?
uncle bob:it doesn’t matter, because ai can’t do anything, and it's no better at generating functional code than object-oriented or structured code.you can think of ai as ajunior programmers with half a brain and never really grow up. it will give you some suggestions, most of which are not very good, and a few of them may be okay, but they need to be changed, because the code written by ai is always messy.
ai is what it is, and it can be helpful, but you shouldn't adjust your career direction to accommodate ai. ai is a tool, and you can learn how to use it, but you shouldn't change your career plans just for a certain ai tool.
"new programmer": if a new person came up to you and asked, "which language should i choose as my first programming language?" how would you usually respond?
uncle bob: well, you can choose java. having said that, c# is also a very good language. clojure is also good. c language is also available. c++ is a bit difficult and complex, but it is also an option. the go language is also very good, it is a good language...
actually, which one you choose is not that important. programming is programming, it doesn't matter which language you start with. most importantly, you have to learn the next language. don't stop at one language.learn one, spend a few months until you're somewhat proficient, then learn another, and so on, learning a new language every year. think of learning a language as fun and find a language you haven’t learned yet. you may never use it at work, and you may never use it again, but make it a habit to learn a new language every year or two.it doesn’t matter where you start, what matters is that you keep learning.
"new programmer": would you recommend junior programmers to participate in open source projects? what impressive open source projects have you been involved in yourself, and can you share the story?
uncle bob: my son and i started a project 20 years ago and it's still going on and it's a great project. although i am no longer involved, many others continue.
if you are a junior programmer or a young programmer and want to learn some new ideas, i recommend joining an open source project. try submitting some pull requests and contribute what you can. this is firstly a great way to help others and secondly a great learning opportunity. anyway, you're right, i highly recommend people to get involved in open source projects, it's a great way to expand your career.
"new programmer": do you know about the “35 crisis”? many programmers face two paths once they reach a certain age: either switch to management or retire.
uncle bob: this is a real problem given the tech industry’s preference for young people. in fact, a developer asked me a similar question, and i remember it clearly. his exact words were: "uncle bob, why are you still programming at 70 years old?" he is right, i am 71 years old now and still writing code.
this idea that programming is only for young people is actually an illusion, but it is indeed a very influential illusion. this illusion exists because the demand for programmers has soared like a rocket over the past 70 years.
think of it this way: every five years, the number of programmers in the world doubles. this means that we have to double the number of programmers every five years, which means that half of the programmers in the world have less than five years of experience, and three-quarters of the programmers have less than ten years of experience. in other words, three-quarters of the world's programmers are under 35 years old. so when you look around, all you see are young people. you may ask, where are all those old programmers?in fact, we are all still there, just not so conspicuous in numbers.
this creates the illusion that programming is only suitable for young people, but this is actually completely wrong. to become a truly powerful programmer, it takes a long time to accumulate. there may be some senior programmers who feel that it is great to have ten years of experience. that is indeed good, but in another five years, he can become a better programmer.
so, if you really like writing code, think this is your favorite, and want to keep doing it, then don't give up. you don’t have to be a manager. if there are people who are good at management, let them do it. if you want to keep writing code, keep at it. you don't have to change careers or retire early. it doesn't mean that your brain won't work well when you reach 36 years old. indeed, there are so many new people pouring into this industry now, and not only young people, but people of all ages are learning programming.that doesn't mean you don't have a chance.
"new programmer": this reminds me that many programmers now feel self-doubt when facing ai. but in fact self-doubt is nothing new, and many old programmers would have had the same problem in previous eras. have you ever had feelings of self-doubt before?
uncle bob: when i first started programming, i was still a young kid. i always felt that i could make a name for myself. i never had any self-doubt at this time.
instead, i started making mistakes, getting fired, and experiencing other setbacks. self-doubt at this time is actually a good thing.a moderate amount of self-doubt is actually quite healthy. because after a while, you learn to cope with it.you think, "okay, i know how to avoid these mistakes. i know i'm not perfect, but as long as i focus, be careful, and talk to others, i should be able to fix these problems." slowly, you will will overcome those self-doubts. actually, going through a period of self-doubt is not necessarily a bad thing. it allows you to grow and become stronger.
"new programmer":finally, can you give some advice to current developers? especially those programmers who feel confused, or who are at a loss when it comes to ai programming.
uncle bob:if you don't know what to do when faced with ai programming, then turn off ai. just ignore it.spend another month writing code yourself, and then turn on ai. maybe then it will look at your code and see what you want to do, and then it will be able to give better suggestions.
for example, imagine you are a newbie learning to drive. you have never touched the steering wheel, and you want to use automatic driving as soon as you get started. as soon as you press autopilot, the car starts to move. you may be scared to death, thinking: "i have to turn this thing off first. let me have some experience." until you learn to drive, try autopilot again. you think, "oh, now i understand how this thing works." then you can make better use of it.the same is true for ai. it may not be smooth at first, but as you go, you will become more and more proficient.