No, no, no! This always frustrates me. This is not 'coding' (maybe it is, and we should be doing less of it, and more programming). This is gluing together pre-coded snippets and trying to make it work. Continuing to do this is an impediment to getting better. Thinking that somehow this is what 'coding' is, is missing the point.
I will read a stack overflow page perhaps in a search for some direction, look at all the 'solutions' like surveying a landscape of others approaches to the problem. Then I'll throw them all away and code my own. Possibly it will share a lot with one of the answers, what I would consider a good approach. But a literal copy and paste just doesn't happen. I would consider a copy and paste a recipe for inviting trouble, because you haven't really reasoned through the problem yourself, and thus don't really understand the solution intimately.
Programming is a process of mental reasoning around your problem with an eye on the form of reasoning computers use, so you can express that reasoning to the computer in the language you're using. Because computers don't reason like humans 'reason' (ie. humans don't really 'reason'...), knowing how a computer reasons and behaves is alien and takes time to understand and learn and it takes time to become quicker at comprehending this. This is the path of becoming a better programmer. Gaining that experience so the process is less alien and you more easily can fathom how a computer will respond and behave with a certain approach of laying out of the logic you are trying to express.
Copy and paste doesn't help you at all with this. In some cases it may prevent you learning essential lessons and hinder your improvement.
Generally I agree with this, but there is a way to use copy-pasta as a learning tool. If I find a code sample that does what I want but don't understand it, here is what I do:
1. Add a comment with a link to the source for reference.
2. Rename the variables.
3. Comment the parts that I understand.
4. Flag the parts I don't understand with a simple // ? comment.
5. Research the parts of #4 until I understand them, and then update each comment accordingly.
#2 is incredibly important to me. I've been doing some walk-through tutorials lately (e.g., http://learn.knockoutjs.com), and if I use the same variable names as the tutorials suggest, then I'm just transcribing. The code doesn't stick in my head, and I'm not really learning as much. But once I start changing the variable names, then it sticks.
#3 might seem like a waste of time, but I've found with conceptually difficult code, having the #3 comments helps keep me grounded if my brain gets too muddled.
6. Make changes to it so that it does the same thing, but in a better way -- faster, smaller/more concise, etc.
I think that being able to do this (correctly) is to truly understand, since then you are "thinking beyond the code" and can see the problem that it solves, not just an implementation that solves it.
I personally learned (as I think many people did) by copying code out of books. Whenever something went wrong, I had to figure out whether it was my typo or the book's typo or my conceptual error or the book's conceptual error. That process helped me to learn a lot, and quickly. If everything went perfect, I got to play some creative game which I loved and gave me a sense of acheivement that helped me to progress.
I no longer do this, because it's not relevant to me at this stage of my learning, but I view that as an important part of my early learning process. If you reflect on your own early learning process, I would be extremely surprised if you didn't copy and paste code. Frankly, you are surely still dependent on other people's code now, you just might call it a 'library' instead.
I agree if you're saying professional developers should avoid copy-paste (there are also legal consequences), but new learners can make great progress by using copy-paste. I would say it's an essential part of studying what other people have done.
Rather than take a boring example from my programming career I'd rather draw from my brief mathematical studies in college. In undergrad I was taking a course on Real Analysis. The course redefined, much more rigorously, certain concepts that I had understood at a much higher level--think the limit, derivatives and the Riemann Integral. Suffice it to say that these new concepts challenged my understanding of introductory Calculus, and when I was tasked with writing proofs based on the underlying concepts (e.g. neighborhoods), I struggled.
In what can only be described as frustration I decided I was going to start copying the proofs over and over. I repeatedly transcribed half a doze proofs for a few days straight (I did each one a few times each night). A strange thing happened. I began to understand the proofs. By that I mean I started to understand the intuition required to make the transition between each step of the proofs. At that point I found the material much more accessible. Reading the book was easier, the lectures made more sense, I could do homework, and consequently I could complete the exams.
I like this example because there is no copy-paste alternative. I had to engage with the material, but I chose to engage at a very mechanical level. Still, there was something about the process of reading and writing that aided in understanding the material.
I don't believe you can get that with copy-paste unless you find some other way to engage with the code.
This is bad especially for young developers (such as myself). Not to mention jeopardizing the security and integrity of your software project.
I hear 'don't reinvent the wheel' often written in blogs etc. That is not good. The lazy developer would read that and go, 'oh, I dont need to know how these things work, it's already been done for me. I'll just slap A to B, no need to reinvent anything'
Imo how it should read instead is, 'keep reinventing the dam wheel till you understand how it was made, only then you're free from reinventing it'.
You are doing god's work, son. Thank you.
There are more than enough APIs just on the platform I work with daily that I can imagine how much fun it must be sorting through all those available to Windows developers must not be a joy. Well Google lets me search quickly for established solutions and combined with my knowledge I can quickly identify which if any will do what I want to do and adapt if not drop into my coding style.
TL;DR
Copy/Paste might not be good for new programmers, but time savings for experienced programmers warrants its use
Everybody has their own style of learning, and not everyone is at a point in their journey where poring over API docs or dropping down into a lower level makes sense for them.
That's not fair at all. Off the top of my head, three topics I have searched StackOverflow for a lot are Android development, MongoDB, and MySQL. Each time, I would consider the task I was doing to be programming, despite the fact that I was not building a mobile phone operating system or database myself from scratch.
It annoys the heck out of me too when people apply for a programming job and cannot implement even trivial CS methods (like integer => string conversion with base N), then point out that they would just Google for a solution if they needed something like this.
But to be honest, a lot of programming wisdom is buried somewhere on the web as well as inside libraries that do not warrant reimplementation. Much of this googling and copy-pasting simply represents the fact that our traditional programming library approach isn't sufficient anymore for distributing correct implementations of particular functionality - probably too much overhead. SO is much like a large library with mediocre code, imprecise interface specification and without working imports, but it also contains many solutions to trivial problems that competent engineers should be able to implement straighforwardly...
I can fix anyone's code, even when I've never used the language before [2] and it was written by an outsourced programmer who quite obviously only read "how to write SatanScript in 28 days" and then was locked in a room for 2 years until his program kinda worked if you held it upside down while reciting the words to Annie.
I am confident I am a good coder at this point in my career, and much better than many of the programmers I have met. There are a handful I have met that I know are better than me.
I would only have a vague idea of how to do a integer => string conversion with base N without googling it. So am I shit? Am I suddenly a useless programmer because lazyjones only likes people who studied CS? Even though I can understand that code in a glance and rewrite it, often better or clearer than the SO example?
You have picked an arbitrary, and extremely rare in the programming world, standard. No-one needs to write their own string handling routines any more.
Programming is hard and there are many different flavours.
And yours is an old fashioned favour from the early 00s. Stop judging people by it.
[1] Apart from my very bad habit of making a minor last minute tweak or bug fix, not testing it, and introducing an easily fixed bug
[2] They're all pretty much the same after you've used 3 or 4.
I would argue that the problem is not the copy/pasting but where to paste the code. As an iOS developer I download a lot of code samples from the Apple Development Website. In many cases on these samples the developers put a lot of code in Controllers to show how things are done.
Beginner developers will usually copy/paste the code as is in the controller and believe what it does by faith.
An experience developer should understand that the code was put in the controller for educational purposes and place the code where it belongs. A Model, Singleton, or leave it in the controller if it makes sense.
So basically you're in the business of reinventing the wheel all the time. I feel sorry for your employer.
I think it is actually the other way around: once you develop the skill of 'programming', you will know what to search for when you have a problem and you will understand enough of the puzzle to construct the last piece from the various results to your search query. If you don't know how to search for an answer to your problem, you do not sufficiently understand your problem.
Unless you are using a library, it's gonna be better long-term going for complete understanding. Even then, it's usually a great idea to understand what a lib does under the hood.
At some lowest level it is about solving problems and knowing how to drill down and understand requirements, split a large problem into sub-problems. In that respect it is not unlike an architect or an engineer or carpenter.
Then it comes to about learning how to translate to an intermediate mental representation. Here where you you already think about the typical language paradigms. Like someone used to object oriented design starts seeing objects, factories, inheritance hierarchies. Someone used to actor based programming (like Erlang) starts seeing actors sending messages to each other. A Haskell programmer starts thinking about type-classes (presumably, I am not one).
Then it comes down writing it. Here one needs to know the tools in detail. The specific language, platform, API. Say something object oriented at the higher level could become something in C++, Java or Python here. Here is where Google-ing helps. Knowing that say oh Python has this cool built-in module that can help me. Or yeah, I'll use a smart pointer here. Well you have to know about the smart pointers.
Then here is boring but important stuff. Knowing how to use version control. Knowing how to estimate time, communicate with team-mates. Not being stupid about security.
Anyway a lot of things have to come together to make someone a successful programmer in the general sense. Some acquire these capacities formally by going to college. Some acquire these on their own.
The interesting thing is that regardless of how it was acquired, the usual instinct is to discount it while looking back. "Oh I just write Python, here is a book on syntax, learn it and start programming". That always somehow seems easy to programmers. And I have made the that mistake. Friends and family member I have tried to show/teach programming.
I've found that interpretive languages, Python, Perl, or even BASIC can be less difficult to start because you can start exploring them right away. Compiled languages are harder because of the intermediate step.
I'm just curious, knowing what you know now, how would you go about trying to show someone how to program?
I may have that opportunity soon and I was going to suggest thinking about a simple yet everyday problem that arises, and try to make it better with an app (could be phone, web app, client app, etc).
And then get them over to Python or something ASAP. PHP doesn't have enough structure for a beginner to learn good software design principles, it's best kept to just teaching a thing or two about loops and control structures.
Teaching HTML + JS is tempting, but then you kinda have to explain the whole DOM too, which just makes things complicated.
2. Maybe I'm projecting, but I was tinkering with computers for a long time before I started learning to program. To that end, there's a lot of just intuitive understanding of software that you absorb, basic relationships like configuration files, rebooting, memory, what a browser does, what a URL variable is etc etc.
There's a lot to be said for helping a person round out this knowledge, before you start teaching them how to program.
I don't know that a person needs to know a lot about America before learning American English, but I wouldn't be surprised to find out that it helps. "You see, they're kind of a casual low key people, so their language has a lot of slang and elisions..."
It's like learning to speak another language; you're talking to a child. You have to tell/teach it everything about it's life. Eventually it'll be able to live by it's self.
When you're ready for application programming, look for topics on c/c++ and other languages that people seem to love. Find out what your favorite game/website is built in and see if you can replicate it.
I think games are a great place to start; simple, humorous text-based adventures, for instance, are both really fun to write and teach a lot of the basics.
The more abstract aspects often become internalized through experience and through concrete examples. Say I didn't care about all the network or socket programming until I had to implement a chat-like server. Looking back thinking "oh yeah algorithms are important" but I only internalized that until I picked the wrong one and got horrible performance. Or until I started interviewing and everyone and their cousin wanted algorithms -- so yes they are important in getting a good job ;-).
Anyway this "example before abstract" is just my personal idea. Googling for example is something I do very often. Say when I get to an API section, I quickly look for example first. Man pages that have examples.
This is a misleading simplification. I'm sure I'm preaching to the choir here, but I'm going to elaborate anyway.
Learning to program isn't fundamentally about learning what text to type in to a box somewhere. It's about learning to think computationally. "Think computationally" is vague and doesn't mean very much to the beginner. That's because it's something you need to learn with practice.
Think about writing in normal human languages. You could say there are two things going on when you are writing an essay, for example. At one level, you are thinking about the concepts. What are your arguments? How are you going to support them? At another level, you are thinking about how to write them down -- how to encode them in a way that readers will understand.
The same distinction exists in programming. At one level, you need to think computationally. What are the inputs I have access to? How can I use them to produce the right outputs? What data structures should I use? How should I handle this edge case? At another level, you are thinking about how to write all of this down so that the computer will actually be able to do it.
Copying and pasting will help you with the second part -- figuring out how to write down the structures you come up with -- and real, experienced programmers do that all the time, but it won't help you with the first part -- figuring out what structures to write down.
But learning how to start programming isn't about that at all, even a little bit.
Writing your first program is learning what a text editor is (no, it's not quite the same as a word processor), maybe learning about the command line interface on your computer for the first time, learning about the various dependencies between the tools and libraries you need to install to get started. There is Googling and discovering tutorials that are out of date or have mistakes in them, and figuring out what to do then.
Just because you haven't achieved mastery yet doesn't mean it doesn't exist. It takes a very long time.
Until you've worked with masters, you may doubt they exist. But they do.
But nowadays, I am forced to rely on third-party libraries. These libraries often change constantly and have "in-development" nuances. So, the OP regrettably is correct that searching the Internet is a requirement for working on modern applications.
I do reminisce about the pre-Internet days, when all I needed was my brain and a simple reference book!
I remember feeling that way when I was eleven, teaching myself. But I think this feeling goes away with self confidence and experience.
Once upon a time, I had a bookcase full of three-ring binders containing plural "reference books", updated frequently via snap-open, pop-out, slide in latest version.
These days, I find Chrome's location bar far faster and more convenient than that bookcase!
She is absolutely correct about the importance of "developing a knack for asking the right questions on Google".
And as for copy-paste, when and to what extent to do that is another knack, one which will likely accompany the acquisition of the first knack.
Contrary to what some readers here might expect, most highly competent developers don't have blogs or start their own companies. Most of the talented and experienced engineers who work in the bowels of Google optimizing search algorithms, or at Boeing writing avionics software or at Oracle designing database systems pursue their craft in obscurity and anonymity. I work with master programmers every day who nobody has ever heard of.
Having been on HN for a few years, I've recognized several of the people here as being masters of their craft based on the depth of understanding and experience that's evident in the words they've written.
"In my experience most programmers have a sense of imposter syndrome..."
I think that the Dunning-Kruger effect, in which "incompetent people will tend to overestimate their own level of skill" and "fail to recognize genuine skill in others"[1] is much more prevalent in our field than impostor syndrome (the opposite phenomenon).
A good friend of mine in in a PhD program at UCLA. She's into solid-state physics and modeling. They use IgorPRO a lot in this field (oddly, also audiology). However, she can't use it a lick. She tries, she really does, but she just can't.
Why? Dyslexia. She has dyslexia. All the variables on the screen just look the same. i++ and i--, or +i and 'hi', or for() and if(). Just the same stuff to her. Its something not usually discussed, as I think most programmers don't have it so bad. 'Up to 17% of the population'[0] may have some form of dyslexia. It's something that really does impede many many people from just reading, let alone coding and programming. Does anyone know of a work-around for this at all? Thank you.
http://programmers.stackexchange.com/questions/9657/programm...
http://programmers.stackexchange.com/questions/9657/programm...
Out of curiosity, does she not have a problem reading (or writing) physics papers?
Compiler versions, dependency injection configuration files (why yes, I am a Java developer, how did you guess?), build systems, source control, dependency management, library incompatibilities, setting up a test environment, setting up and configuring databases and web servers, etc.
Maybe I don't actually spend as much time on these things as it feels like I do, but I do know futzing with this stuff when you just want to write real code to solve real problems is soul sucking and demoralizing.
So I definitely relate to the hard part of programming, beginner or not, as just getting to the point where you can actually write some code and see what it does.
I tried learning Ruby/Rails a while back and spent 3-4 hours just trying to get the environment setup. I finally realized that Windows 7 was not a very popular OS to learn Ruby on and gave up.
On the contrary, getting a PHP/Python/Javascript "environment" setup is no problem. Notepad + a hosting account or any Linux/Mac and you are good to go.
I admit that the learning curve of programing is a little steep. But isn't every skills in the world the same? Think about the first time a child learn to walk, the first time a child learn to speak. No healthy adults think these things hard to do now.
The conclusion: the programing is just like any skills in the world, they are always hard for the new beginners but become easier and easier while you are getting familiar with them. Saying if it is statically hard or not isn't an accuracy statement.
What's certainly true is that learning how to code is dramatically easier than it ever has been; and is likely to get easier as time passes. Learning how to code is indeed pretty easy, knowing how to build a complex product goes beyond that, though.
Compare that to today. There was nothing to install. It was all already there. There wasn't even an environment to launch, you booted into the REPL. You didn't have to hunt for tutorials on the internet, everything you needed to get started was in the manual that came with the computer. And everything in that manual was appropriate to the computer. You didn't have to worry about having the wrong version of dev environment, making the tutorial incorrect.
That's not to say that programming hasn't improved in other respects. I could spend years trying to build a basic TCP/IP stack on that old 8bit computer, which already comes pre-installed on a modern computer. I can grab a free copy of just about any language I've heard of. Huge numbers of libraries freely available allow me to stand on the shoulders of giants. But, nothing available today approaches the simplicity of that old 8 bit system for learning to program...
So often the better way is just googling, seeing examples, and a lot of copy-pasting.
I'd say the problem with programming isn't that it's difficult, but that it's intimidating. Writing a bunch of arcane symbols and words in a text file scares people off, while really it's just everyday logic people use in a different form (at least, the very basics are). I think that's also why programmers keep telling people it's so easy, so that they get over that irrational fear.
One of the biggest surprises when I started to learn, LANGUAGES ARE STILL BEING UPDATED. ?_? Totally thought that was done and over with, then I come to find language/framework updates can break entire programs. First time learning Rails was when they just upgraded to 4.x and all the tutorials was in 3.x. Now that was a "FUUUUU" moment.
P.S. I thought the pictures was done quite nicely ^.^
The modify part leads to more concrete questions, more Googling, more detailed reading of docs, until at some point I'm engaged enough to go back to zero and actually start learning the language from the basics.
(This doesn't work for those languages who's paradigm you first need to understand before being able to do anything, but most languages allow for hacking straightforward procedural code at the basic level.)
That scenario might not be entirely possible given the terms of GPL and Apache, but that's how they talk about it.
Even political parties who's slogan is more police and harsher punishment don't understand copyright. In Sweden, the extreme right just plucked some images from the internet, did not check the license, and used it in their party program and commercials. In the end, every Swedish household got sent a pirate copy.
The problem is that copyright infringement is so extremely easy to do, that it happens everywhere, and will likely keep happening regardless of scans.
Instead, start by learning about computational processes. Use Racket — it's a stable, excellent environment. Read SICP or at least HtDP. You'll have fun. It's challenging, because it requires an adjustment to the way you think, but it is not particularly hard.
If you can embrace that idea, you can eventually learn to code.
The goal is to understand what you are doing and why, not just blindly copy and paste code that seems to work. Break it by changing something and fix it enough times and you will gain insight about how it all goes together.
Even the most complex problems can be made easy if you can break it into smaller tasks and build up to the finish.
I've encouraged my kids to learn programming. The one thing I haven't done is tell them it's easy. Anyway, they've seen me in bug hell, so they're under no illusions. But they're no strangers to learning hard things.
>>> And they don’t let you in on a big secret: that there is no mastery, there is no final level. The anxiety of feeling lost and stupid is not something you learn to conquer, but something you learn to live with.
Yes! Bring it on! Bright kids spend their entire school day at the final level -- 99th percentile on every possible measure. Those kids would benefit from an extracurricular activity with no final level (traditionally, "classical" music) that they can pursue at their own pace.
>>> They don’t tell you that a lot of programming skill is about developing a knack for asking the right questions on Google and knowing which code is best to copy-paste.
In my view, that's a general skill in its own right, worthy of learning. I fixed my refrigerator and clothes dryer that way. I rarely tackle any technical task without first seeing if somebody has blogged a tutorial. And I grew up fixing things before the Internet age. But I'd start kids on coding without the Google Everything approach.
>>> [the anxiety / boredom graph]
I enjoyed that. It does seem to ring true.
I see lots of bioinformaticians writing simple scripts usually just counting stuff up, and doing some stats. It needs to run once, on one machine and often only on one dataset.
That type of programming is easy.
I am working for a sequencing centre, doing the database to run the place. I inherited a self taught bioinformaticians code after she had left. Second worst code I have ever seen (the worst was also a self taught bioinformatician, who didn't even indent stuff). The code was so bad, I had to refactor it just to debug it. The team leader didn't see a problem. It had worked. He didn't see the fact that it would have taken me a day or two to write this from scratch, if I had had an original specification, rather than spending a week to refactor her code until it worked. To this day, I have no idea what parts of the code are doing (I can see it is reading byte 8 of a binary file and doing something. I have no idea what the contents of that file are). At least now I have made the code modular so I can see the output of reading the file into a huge nested dictionary.
Learning to code is easy. Learning to code well is not. Hell we can't even decide what coding "well" means. 100% test coverage? Shit that works? Something that is readable and maintainable? Something that runs faster than all the equivalent software? In the end I think experience will mean a developer can work out which of these is most important. Maybe just getting something that works is what is important, and the example I gave above is perfectly acceptable code.
I've spent a lot of time doing embedded stuff. Totally different world. What matters here is irrelevant elsewhere.
So any time someone says "I can program" you have to ask "Where? With what tools? For what audience?" and so on. Because there are so many niches (and so many being invented every week) its impossible to guess.
Once they have begun, I tell them "sure, basic programming is simple, but you need to think hard about what you really want to do".
That generally has a good outcome and they continue to be interested in programming and wanting to learn more about it.
If you tell an interested person straight away that "it is incredibly difficult" then you will be discouraging a large number of people before they even begin.
Eventually they wrote a course that included Python.
I assume the instructors realized what they had bitten off as last I looked Python is no longer on the official curriculum. This story actually gets much worse as they wanted to do Objective C but they originally hired a former instructor who was a DJ to learn and teach it. That guy didn't show up for work one day ..... and never did again.
If you reach a certain level tutorials become a waste of time, because you don't need structural help any more. You also understand that you shouldn't google how to implement a specific solution in the language of choice but which solution in that language solves the given problem. You also don't copy&paste because just solving a single problem is not the question any more. You can already solve most problems. It's more that the desire to improve leads to learning new principles, which means hand-copying small code examples (sometimes from actual programs not from SO questions) and playing with them until you get a feel for it and then start to use it in your daily programming tasks.
Programming takes an odd kind of thinking and is about as easy as anything else that takes a large amount of time and effort (read not easy).
I was a bad programmer for a long time. For a few years, I was an engineer and basically wrote quick and dirty matlab or python scripts to do physics based modeling and simulations. But, it was never elegant or efficient or anything that I guess you learn about in upper level CS courses.
It didn't have to be. A customer would never see the code, it would never have to perform under critical conditions, it could almost never be reused because each project data set was completely different. The code was just supposed to crunch input and produce meaningful output that could be analyzed.
I got to thinking that I was a pretty good programmer because I could write those scripts.
Then I quit that job and moved to a different country. The only job here that I managed to get was as a software engineer. Here, I learned how very wrong I was. Writing quick and dirty scripts that crunch data is easy. Programming is hard. Really really hard.
The real reward in programming is clearly seeing how much your understanding has grown. But at the same time you're humbled by how much you have yet to learn.
I felt like god when I first wrote an output stream to a file. I couldn't believe it was possible. Most people didn't have those kind of feelings. I think that's the difference. You're either captivated or you're not.
I wish I knew this before I started my Master's degree in IT. Programming is frustrating if you don't have an engineering background... you keep running into new problems and people telling you what you could do better.
The next big change for me was going beyond the docs to the actual API to do even more customization, and override existing methods. It's a progression from low-level understanding to higher, and whatever gets you there - just don't give up.
I taught 3rd graders to code. I also taught 1st graders, but the 3rd graders it really clicked. They would come up with solutions to things I would not have thought were possible given the limited language we were working in.
We started in "Project Europa" it is object oriented, module based, and the vocabulary is very limited. But students built all sorts of virtual robots to do all sorts of interesting things.
When I learned to code I learned in RPG, and that doesn't stand for Role Playing Game. Then I moved on to Basic. Turbo Basic, and later QBasic. I wrote a 3D boxing game in QBasic. Yes. 3D graphics from QBasic.
To this day my vocabulary in any programming language is pretty limited. Those around me get upset because I'll use a While loop and increment a counter rather than a For loop and the Index of the thing I am looping through. It is not that I don't want to use the wider vocabulary, or that I have anything against Lambda's. I don't dislike Tuples. I have nothing against using a Class. But I don't usually need more than my 12 word vocabulary to build things. If I do, that is a performance optimization. What? Itertools and product will do the same thing I did with nested For Loops? So? I didn't know there was an itertools. I didn't know there was a product.
Someone said you need to develop a knack for asking the right question of google... Nah, sure StackOverflow has 90% of the answers you'd ever need to know, and they have a clever code snippet that I will admit comes in handy, but if you have to break thought to Google, you aren't breathing the code. It is like trying to learn Spanish by carrying the pocket guide with you rather than making do with the 12 words you know until you can learn 6 more, and then 12 more then 24 more words.
Take the training wheels off and suck it up. Machines are big and fast, large vocabularies are for people who want to speak concisely. A 3rd grader may not use the best choice of words, but he can still explain to you how to make a peanut butter sandwich, or build something in mine craft.
So don't let anyone tell you Programming is hard. Programming is easy. But there are a lot of ass hats who care if you should have built a function rather than copy and pasting the same code with minor variations 20 times. Or will say "you could have done that in one line with a lamba and a reciprocal function"
"Yeah, and Einstein had someone else do most of the math for his proofs because he kind of sucked at calculus. I'll get to optimizations after I have something that runs."
That larger vocabulary you sneer at is much of what allows developers to be multiplicatively productive, allows them to do much more work and do it in a faster and less error-prone way.
Or, put another way: are they having to maintain your code when you get tired of it and move on or are they having to deal with second-order effects from your code being more brittle, less flexible, and slower to work on? 'Cause if so, they're not the asshat.
It was fairly easy to see why this happened. That workflow was the heart and soul of the company's revenue processing, and no one wanted to touch it any more than absolutely necessary, to avoid breaking anything. So when they expanded from one warehouse to two, it made more sense to simply re-iterate the existing code with the new location id. When they added another location, re-iterate it again, and so forth.
I created a Launch subroutine, then replaced all those hundreds of lines of code with a for loop that simply called the Launch subroutine for each object needed. Then I went through the rest of the workflow and swapped in Launch calls where appropriate. Overnight, that workflow became much shorter, more readable, and most importantly, significantly more maintainable. Previously, if you wanted to change what programs were run per branch, you had to insert the launching logic in twenty-five separate spots. Now? Once.
That, my friends, is why we build functions, rather than copypasta-ing the same code over and over.
Just because you taught some 3rd graders a for loop doesn't make them coders and it certainly doesn't make them engineers.
The programming is easy myth is doubly bad: it sets a false expectation for the aspirants and belittles actual engineers' lifetimes of study.
I can cook, but I'm not a master chef. That doesn't mean I don't do it. Nor does it mean "cooking is hard".
Riding a bicycle is a lot harder than basketball.
I started practicing mindfulness meditation a few years ago. Mindfulness trains you to experience your emotions without judging them; in other words, it helps you to "live with" feelings like frustration and anxiety without getting overwhelmed by them. It's been an invaluable addition to my programming toolkit.
Oddly enough, the program wasn't difficult to understand. I've even written it and got it to run before! I think what happened this time around, is I had read the chapter again, started writing more notes and had a better grasp on the material than before, that when it came time to bring all the concepts together, the example program didn't include them! For the first time in years, I actually felt stupid, borderline retarded (in the literal sense).
The example involved an abstract base class, Dragon, with 3 derived classes. The idea was to have a player fight a randomly selected dragon via Base class array and Base class pointer. At this point in the book, aggregation was discussed and shown in an earlier example, but wasn't implemented in the example. Mind you, no player class was created! So basically, arguments were passed to xDragon's defend and attack member functions via variables within the main function.
So I'd decided to create a Player class instead, and have the Player And Dragon objects interact with each other in the main function. Problem was, I hadn't learned enough to know how to do that, to which I didn't realize until error after error and trying desperately to get it running. I'd refrained from using Google and Stack Overflow for the most part, save for a few compiler errors I'd never received.
In the end, I'd decided to create a Game class that layered a Player and Dragon object. I had a feeling I should have written it that way from the start, but felt uncertain. The last errors that I was stuck on for a few days, I'd solved by way of "I wonder if this will help" lol.
Up until then, I wasn't aware that if you don't have a separate implementation file for a class, and should you decide to layer an object from that class, the class must be defined within the class declaration. Having defined member functions outside of the declaration, although within the header file, gave me: include\BlackDragon.h|22|multiple definition of `BlackDragon::calcDamage(short)', first defined here.
I will admit, it did put a damper on me. I felt like I was on a roll up until that. Perhaps I'll take a week or two break from programming get the feeling back again.
And this is how the security industry makes its living.
That's exactly my daily felling, but I'm just a junior soft eng
Learning to code is easy, just as learning to write English prose is easy - kids routinely do both of these things. However, learning to be a professional software developer or a commercially successful novelist or journalist is very different from learning to code or learning to write - for most people, it requires hard work, many years of experience and learning from lots of mistakes.
I absolutely disagree with this. I learn new things at least once a week about computer science in general. No one knows everything.
"They don’t tell you that a lot of programming skill is about developing a knack for asking the right questions on Google"
So, she relies on S.O. for all her programming problems, what if other people don't? SO is _not_ my first choice anymore. Man pages are such high quality.
"I learn new things at least once a week about computer science in general. No one knows everything."
How do these statements contradict each other?