by yura · 3y ago · 0 comments
Maybe you’re still lacking fundamentals? Seems like your strategy so far has been to grind tutorials and crash courses. They will make you feel like you’re learning a lot in a short time but in the end you’ll still not know what you’re doing, and you’ll keep struggling when facing new problems that are outside of the scope of the tutorial.
Maybe you’re learning from low-quality resources? Yes, the internet is full of free resources but most of them are useless and actually harmful, and some curation is needed. Instead of studying the basics over and over from endless free online tutorial/courses, just learn them once, the right way, from a high-quality resource instead. See: teachyourselfcs.com
Realistically you will never need to write it yourself unless you're coding in some very specific domains
It's at most a signal for whether or not they remember algorithms 101 or some leetcode exercise, but knowing that they do remember isn't really useful to me
For bubble sort? Do you really think anyone should have to remember an algorithm to write a quadratic time sort? All you have to do is "compare and swap" and loop through until you are done, this is way easier than Fizzbuzz.
This is only hard if you have a hard time grasping loops, conditional comparisons or swaps. But if you understand all of those the sort writes itself. And understanding loops, comparisons and swaps is pretty fundamental to anything you do as a software engineer, so I'm not sure how any competent software engineer could struggle with it.
Engineering is about solving valuable problems. Solving some of those problems requires obsessive control over (and selection of) specific sorting algorithms, many do not.
Edit: it's also worth bearing in mind that many of the people who discovered these algorithms are famous in part for having thought them up. If data structures and algorithms were so obvious, nobody would know who many of these people were.
I think you have this wrong, Fizzbuzz is actually completely trivial to the point where the problem statement is almost literally (modulo modulo) a description of the algorithm.
Bubble sort is very easy but it's not literally trivial to the same degree as Fizzbuzz!
Or because you don't know the algorithm in question... The problem isn't bubble sort but any generic algorithms test. The examiner wants you to write code but not tell you the specification because it would be shockingly similar to telling you the solution.
When I read a post on HN about inverting a tree I was wondering how exactly you are supposed to invert the child and parent relationship so that children point to parents instead of parents pointing to children. I.e. leaf nodes are now at the root and the root node is where the leaf nodes are supposed to be. Then someone said "He meant reversing the tree" and I'm like "That is not what he said."
You'll often see responses like "but many people don't need to write sorting algorithms from scratch in their day to day work, so they're out of practice". But to me this attitude itself is indicative of the issue.
Being able to do this doesn't require sorting algorithms to be well-practiced and fresh in one's mind. It requires a general ability to visualize and reason about simple data manipulations. Which to me is an absolute fundamental for a programmer working in any field.
If the algorithm can be described with a small sketch or a couple of sentences, generally an implementation should just flow for an experienced programmer who has general fluency? For something like bubble sort, the description can be more or less directly translated to code.
The fact that someone even conceives of this as something which needs to me memorized / practiced suggests to me that they might not have that kind of basic working fluency.
When you tell them how the algorithm works, it feels like you are not testing anything except syntax.
If you let people look it up, it feels like you aren't testing anything except their research skills.
It is difficult to have a test in a vacuum. It would probably be better to have a test with multiple steps.
Exercise 1:
a) Research the topic bubble sort. Explain what bubble sort does and write some notes or pseudo code that will help you implement it. Once you are done, we will disable internet access and close your browser.
b) Write a working bubble sort in COMPANY LANGUAGE.
c) Modify the bubble sort so that it can sort by multiple columns.
The first tests your research skills, the second your syntax skills and the third your ability to deal with changing requirements and implement novel functionality without research.
Bugs have been found in production binary search.
Skipping bubblesort, I think quicksort is easy to implement, if you know Hoare's fp insight (I remembered it, but had to check it was him). Making a version that is both efficient and correct may be harder for me... Similar for Boyer-Moore substring matching (I remembered their names!)
Could you please provide more information on this?
You pick a number in the list, then put lesser numbers into a left-list, and greater into a right-list. Recurse.
It's very slow as intuitive, simple and elegant fp, because it's creating new lists like crazy; but a mutable, in-place version (e.g. in C) is super fast. Maybe the origin of the folklore "learn fp to be a better coder, not to code fp"? I don't think he expected it to be so good; he was just doing him. A very smart man.
I think the difference between professional engineers and person writing the blog isn’t necessarily skill. I think it’s how we react when we make mistakes. Maybe the real test of a programmer is watching how calmly they can write their buggy bubble sort, then test it and fix the bugs. Bugs happen. How we roll with the punches is what makes some people great.
This. Many programmers, for some reason, act like skill is a complete order; you are either more skilled or less skilled than someone else. In practice you are just familiar with different things, so if somebody doesn't know something that feels trivial to you, it just means he didn't encounter it in the same way.
I told him to be patient, to insist, to commit time learning not only typical courses of how to code your website with a database. In fact I gave him advice against doing that first.
I adviced him to learn binary/hex, algorithms, data structures and structured programming as a minimum. Also how a machine works (at least the abstract model): memory addresses, data, pc.ñ, call stack... etc. Interpeters vs compilers, some OS basics (though at first can skip most of this). My advice has been to first learn with Python and later C.
Understand why or when to use functions, certain data structures, etc. Do increasingly difficult but basic exercises.
And specifically, develop a sense and taste, at the end, on how to figure out how to code a solution to a problem he never saw. Cost analysis also helps lots and must be learnt at some point.
This is what happens when you gothrough random courses, exactly:
> Maybe you’re still lacking fundamentals? Seems like your strategy so far has been to grind tutorials and crash courses. They will make you feel like you’re learning a lot in a short time but in the end you’ll still not know what you’re doing, and you’ll keep struggling when facing new problems that are outside of the scope of the tutorial.
That is SO true. You have to start from scratch. I mean it. Because when you see something like s stacktrace that goes from Python to your native library with memory addresses you will understand NOTHING when the time comes.
Programming is a discipline where you need a lot of practice.
To be honest, I don't have an objective reason to learn much CS as that's not my layer, so I'm butting up against my own ignorance any time I try to advance in something easy. And then my ADHD determines memorizing that information is unnecessary so I struggle to get concepts to sink in.
Recently I discovered Roblox uses Lua so learning that to make silly experiences for my son sounds wonderful. It's goal oriented so I can convince myself it's worth pursuing, and I feel like Lua concepts will help expand my toolkit for the future. But I'm also not starting from a blank IDE page going "geez how do I even know what to start building first..."
When I was 16, I had software skills but was clueless about what to actually build. Now I know what to do and don't have enough time to do it. The idea of grinding two hours a week just doesn't work for me. I want to do things in bursts. Like working 10 hours on it and then weeks of nothing.
The problem with not understanding things is that when you face a new problem or things crash or go wrong you get totally lost and do not know how to proceed at all.
Another recommendation if you want to learn is that you use a terminal and an editor. Nothing else. You will see things closer to how they work. You will be aware you are launching a script or compiling a file. You will see the output files, you will understand there is a compiled file to be run. You will see if it is native code you run it directly but if it is compiled to bytecode you need a VM, etc.
That is part of the details one must be aware of.
There is definitely a lot of overlap here, but I have a finite amount of time that I can put towards solving problems. I've been thrown into AI over the past 6 months and know none of the fundamentals of this space, but I can still be very productive.
My process now is to know how to pull up docs quickly (in my editor), take advantage of the LSP, use my debugger and learn the systems on the fly. I'm probably not going to take courses in AI, Data Science and other aspects of this discipline as it will only have a marginal affect on my daily activities.
My job is to understand the flow of data, so I need to focus on that and make sure my process, tooling and access to documentation are the best possible to accomplish that.