AI Era: For Absolute Beginners, What's the First Step to Learning to Code?
Straight to the point: the very first step isn't syntax, frameworks, or even choosing the right tools. It's an even more fundamental skill: demand decomposition.
Now, you might be thinking, "Demand decomposition? What's that got to do with coding?" Hold your horses, let me tell you a story.
Let me give you an example from my own experience. My degree was in International Economics and Trade, and I worked as a Product Manager – literally a "never learned to code" situation. Once, at work, I encountered a requirement to automatically generate performance reviewers for each employee based on a set of rules.
The Product Manager's Dilemma: Low-Value Feature = No Resources
Those of you working at big corporations will be familiar with this: matrix management, peer reviews galore. Previously, the reviewers were partially hardcoded in the system (like direct supervisors), partially selected by employees themselves (e.g., frequent collaborators), and partially confirmed by managers. But eventually, everyone got tired of the hassle. They figured, why not have the system automatically generate reviewers based on rules? (And these were no simple rules – a dizzying, dynamically updating set, requiring automatic weight calculation for different stakeholders, time-based organizational structure slicing, and so on.)
The goal was to eliminate manual intervention and confirmation, hence the feature request.
Leaving aside the actual business feasibility of this demand (performance reviews are a drama hotspot; how could you possibly avoid manual adjustments? In the end, you’d still have to create backdoors in the system for modifications, and probably tweak both the results and the process data), let's just focus on feature implementation.
As a Product Manager, the official corporate-speak response to this request was: "This demand requires in-depth exploration; we need to abstract it into a generic rules engine." The real underlying message? It's too low ROI; better to just find an intern to grind it out (no offense to my intern friends, seriously...). After all, performance reviews are only done twice a year. Building a rules engine isn't impossible, but this kind of non-standard request might change again if a different business unit comes along, and then we'd get grilled: "Why is the solution so inflexible?" If we made a flexible solution, we'd be questioned: "Is it really necessary to be this complex?" And after resource assessment, they’d say, "We can schedule this for next year." It's a classic case of "product ignoring business needs," "development refusing to allocate resources," and "business disregarding development costs" – a dysfunctional vibe all around.
This is the typical dilemma when working in a large organization: all the reasons are objective (because resources are genuinely limited). Business, product, and development are all obsessed with "abstraction," all trying to build "reusable components" to use for promotion reports, vying for resources to keep reinventing the wheel. But the real, frontline needs just can't get pushed through.
My "DIY, Bare-Hands" Approach
AI wasn't a thing back then (or maybe it was, but I didn't know it). I was just determined to actually solve a problem for the little business operations girl. Instead of endlessly "thinking about value points, waiting for reviews, waiting for scheduling," I decided to try it myself. So, I started pondering: what exactly do these rules do? What's the input, and what's the output?
The performance review assignment rules, roughly summarized, looked something like this:
- If an employee's position is A1, group is B1, department is C1, then they should be reviewed by everyone in group B2 of department C2, excluding those in position A3.
- For each person in group B5, the reviewers should, in addition to the existing rules, also include people in department D1 who are not in position A2, and Zhang San.
- There were various other weird and wonderful rules, simplified here. Otherwise, a simple vlookup could handle it.
- As for why these rules existed, that's a business management issue, not for this discussion. Let's focus on what us working stiffs can control.
Common sense told me this was something like an Excel vlookup tool. Except, a simple vlookup only outputs a specified column. Here, I needed to nest a vlookup inside another vlookup, to find people in another table based on the review rules found in the first. So, why not just create a handy little tool that does this with a couple of clicks?
And so, one dark and stormy night, I tentatively started searching for solutions on Google, Bilibili, and YouTube.
First, I checked if any no-code or low-code platforms had similar tools. Didn't find anything quite right. Then, I wondered if Excel VBA could handle it. I looked at some tutorials and found similar cases, but the company-issued Excel version didn't have VBA functionality, so that was a dead end.
While browsing search results, I saw examples of using Python to process data. And the example code looked surprisingly easy to understand, almost like natural language descriptions. So, I typed "Python script to extract Excel data based on conditions" into the search bar, opened page after page, and lo and behold, I found a case that was a perfect fit!
But then I realized, I have no idea how to run code. How do I get this thing to run on my own computer? So, I started searching again: "How to install Python on Mac," "How to run Python," "How to check Python version," "What is pip?" "What is a virtual environment?" "What is Homebrew?" "Why is Homebrew installation so slow?" "How to install pandas?"...
Step by step, I slowly pieced together a prototype:
import pandas as pd
df_A = pd.read_csv('/path/to/file_A.csv')
df_B = pd.read_csv('/path/to/file_B.csv')
def find_ids(df, **conditions):
result = df
for key, value in conditions.items():
result = result[result[key] == value]
return result['id'].tolist()
def update_appraiser(row, df_B):
if row['position'] == 'A1' and row['group'] == 'B1' and row['dept'] == 'C1':
ids_1 = find_ids(df_B[df_B['position'] != 'A3'], dept='C2', group='B2')
……
combined_ids = ';'.join(map(str, ids_1 + ……))
return combined_ids
elif ……
return row['appraiser']
def main():
df_A['appraiser'] = df_A.apply(lambda row: update_appraiser(row, df_B), axis=1)
df_A.to_csv('/path/to/file.csv', index=False)
if __name__ == '__main__':
main()
At first glance, it looks quite complex, but in reality, it's just a hodgepodge cobbled together from a few different examples. I myself had no idea what this jumble actually meant.
But I relaxed my mindset. If it worked out, great, I'd learned something new and solved a business problem. If it didn't, so what? No one expected someone with zero coding experience to just whip up code like this. So, I took a deep breath and started looking at it. Slowly, I began to notice:
- Things in quotes “‘’” seemed to be table headers or cell values.
- "row" probably meant a row in the table.
- "to_csv" followed by a path looked like a file address....
- and so on.
If you really quiet down and read this code, you'll find it's very similar to natural language. Ignoring the syntax, if you just translate the parts you can understand into English, it reads like this:
if row['position'] == 'A1' and row['group'] == 'B1' and row['dept'] == 'C1':
-> If the value of "position" in this row is A1, AND the value of "group" is B1, AND the value of "dept" is C1
ids_1 = find_ids(df_B[df_B['position'] != 'A3'], dept='C2', group='B2')
-> find_ids is the name of a tool to look up IDs, where the position value is NOT A3, the dept value is C2, and the group value is B2.
-> Seems like it's saying: search in table B for people whose position is not A3, department is C2, and group is B2, and find their IDs?
combined_ids = ';'.join(map(str, ids_1 + ……))
-> No clue. "join" means to put together, "map" is like a map?
return combined_ids
-> Return something called "combined_ids", still clueless.
Since there were parts I could understand, I decided to just jump in and start modifying things, see what results popped out, and then roughly figure out what each line of code did. Sometimes I messed things up, and got a screen full of error messages I didn't understand. Then I'd just copy the errors, paste them into a search engine, and for problems at this stage, there are always standard answers to be found.
Eventually, I provided the business unit with a script that could find all the employee IDs of the reviewers. Then, in Excel, I manually performed an unpivot operation (transforming row data into column data – a basic skill for any product manager), and finally exported usable data.
The little business operations girl was ecstatic.
The Real Foundation: Demand Decomposition
The example above is something you could already achieve before AI really took off. By making good use of search engines, you'll find that problems you encounter have almost certainly been encountered and solved by others. Now, it's even better. You can completely skip the step of searching for answers in search engines. Just throw your questions at AI, and it will help you write and explain the code. You just need to copy, paste, and see the results.
Of course, all of this comes with a major prerequisite: all subsequent steps are built on the foundation of you having a solid understanding of the business (or your needs). Imagine, before even searching for implementation methods, if I couldn't translate the business requirements into clearly described rules – at least one input corresponding to a defined output – then even if I were a coding whiz, I'd still need someone to tell me what the rules are.
Even when collaborating with AI, you still need to play the role of the bridge between "demand" and "code implementation." The clearer you can describe the demand, the better the results AI will produce.
- Define your objective: What problem am I trying to solve?
- Analyze the inputs: What data do I need? Where does the data come from?
- Determine the outputs: What results do I hope to get? What format should the results be in?
- Outline the process and rules: What are the steps from input to output? What are the conditional judgments at each step?
- Describe in natural language: Use clear, concise language to describe the rules and requirements, just like writing an essay.
This is what I understand as the "foundation": In the AI era, even for absolute beginners learning to code, what’s more fundamental than syntax and frameworks is actually your "demand decomposition" ability. You can start with absolutely zero concepts, but you need to be able to translate – either translate your needs into conditional formats (If A then B), or understand the logical judgments in example code written by others or AI.
After all, the ultimate goal for most people "learning to code from scratch" isn't to become a professional coder, but to better solve problems in their life and work by expanding their programming skills.
Decomposed and Ready: Learn to Code Like Learning a Foreign Language
In my mind, code is just another language. People communicate with people using Chinese, English, ect; people communicate with machines using code. (I know this isn't strictly accurate, there's a lot of compiling to binary involved, but you get the idea.) The way you learned English back then is the same way you learn code now. People without a science background might be a bit weaker in logic (sorry, stereotype!), but just like English reading comprehension, you can start by getting familiar with it, and the logic can be unraveled slowly (and without the time pressure of exams anymore).
However, just like English reading comprehension, vocabulary is the foundation for scoring points. If there are 10% new words in an article, you can still guess their meaning from context. But if 90% are unfamiliar, it's practically random guessing. But now with AI, it's like you're walking into the exam with a Pleco dictionary – oops, showing my age. Let’s use a more modern example: it’s like having a smart translation pen in the exam hall, "point and translate wherever you don't understand."
Of course, I also know that this fragmented information isn't "real knowledge," and this "learning-by-doing" approach has its limitations compared to systematic learning. But for coding newbies, gaining "small but continuous sense of accomplishment" is more important in the early stages than a "rigorous and systematic learning framework." After all, the goal isn't to switch careers to become a full-time coder, but to use coding skills to realize your own product ideas. Make something first, see if it works. Once you get a taste of success, you'll naturally have the motivation to learn in more depth.
Besides, these basic concepts themselves aren't difficult (even for non-science majors like myself). For some people, it's almost at the level of "seeing it is understanding it." If you could sneak around the network administrator to play Bubble Tang (another age-revealing example) in your middle and high school computer class, then feeling like coding is difficult now might just be because you haven't taken that first step to try it out.
When chatting with friends, I also lamented how we were learning new knowledge across different fields every day back in our student days. How did we manage to learn new things in nine subjects every day? After working for so long, we probably forgot in the daily grind that we still have the ability to learn new things across fields.
Stop just reading, and start trying it out yourself!
Here are some basic learning resources and methods that I personally used and recommend:
- O'REILLY's Head First series books: You can treat them as textbooks and follow along, or like me, use them as dictionaries. When AI gives examples I can't understand, I go look up the books. For the very basics, start with the HTML and CSS book. Build a static webpage to establish a sense of accomplishment first. PS: Head First books are really well-written. Although a lot of the foreign humor becomes even colder after translation, the overall structure and step-by-step approach make you think, "If only teachers taught like this when I was in school."
- Andrew Ng's series of open courses on DeepLearning.ai: These courses are rewarding to listen to again and again, but I recommend having a little Python foundation before listening. I personally got started after listening to the 9-lecture course, Prompt Engineering for Developers.
- freecodecamp: After reading books and listening to courses, jump straight into coding and pass the certification exams. It's another round of reinforcing memory.
- Finally, you can also have AI generate practice questions to check your knowledge retention. Don't forget, AI is a 24/7 private tutor.
Comments
No comments yet. Be the first to comment!