How I learned to program
danluu.com
danluu.com
I love this bit. This is extremely true even today. Most students at my university, and all of my university's classes, do not use or understand the benefits of a VCS systems. This is crazy on a different level. I hate to say this but it is in fact 2016 and it should not be a question that git or something should be used on every project no matter how small.
I didn't appreciate why version control was so important until later, but at least I knew what it was. Now I consider a department with either no real vcs strategy, or an outdated, cumbersome one to be a huge red flag.
One place I worked used source control, kinda. They had an old system, sccs, and they used to pull together patchsets into zip files, name the zip after the (unique) bug number it addressed and put the zip into the vcs. Here was then a lotus notes database that recorded what the fix was for, what version it applied to, other pre-requisite fixes before this patch... So painful. The graduate software engineers they took on actually developed fear and nervousness of vcs and tried to avoid it as much as possible. That was back in about 2002...
This is for many reasons. Version control is not only about controlling versions.
- It's not about saving files, it's about understanding group work flows. Every text project should be in a git repo. If it's code or not it doesn't matter. You can see what things were written for, who wrote them, and even more.
- It's a method to catch cheating. If someone submits one commit called "Working" or something and has no history of the code/project it's likely they are cheating.
- It's decentralized backups and and offline workflow (for git)
- It's a method to collect and aggregate work. Setup a gitlabs/gitbucket for the class and make every student keep their projects up there. The teacher has a centralized and nice looking place to find the code and it doesn't make the students zip up or require them to do anything. Their work is shared by nature.
- It exposes you to what you are going to be using every day for the rest of your life as a CS major.In the US/Canada college degrees are generally not directly training you for a career -- that's what internships are for. My position is that this is the right approach. I will have a lifetime to perfect my git skills, but I only had four years to learn about programming language semantics from a recognized expert in the field.
Also, a university that gives CS degrees to people who cannot actually work as programmers is doing a disservice to their graduates, even if the university intends for everyone to continue with post graduate studies and go into academia. At the very least, your doctoral advisor will need you to write some code for them, and you better be able to do it.
Just stick it into CS 101 (give it an afternoon), and then treat it like a prerequisite. Require that all students use VCS for projects in all other courses.
It's really not hard. Even for most of my non-CS classes I maintained a git repo just for notes.
Even if you set aside the benefit of learning and building a useful real-world skill, mandating git usage will likely save almost every student from a disaster at some point during their studies.
Version control can act like a safety net that lets you try things and explore with more reassurance that you won't utterly trash your progress so far.
While I respect their opinion I feel that pushing people into a difficult environment immediately will better their develop their confidence for future situations like this. It's all to often that I encounter fellow students who are "afraid" to attempt to use tools, algorithms, language features, etc because they haven't been trained in their usage.
As someone who taught myself to program that's pure crazy talk.
If you print values you get a debugging log which (for me) is often more helpful, because I can easier map it to the offending code line.
But it's good to have both tools available.
It's sad that git (or equivalents) doesn't feature more prominently these day. It's as important a tool as compilers, debuggers and editors (although I don't remember being taught how to use them properly, either).
I think it does. I was taught version control in University (CVS era but we used SourceUnsafe) but only for one class. These days all new grads I've interviewed have Github profiles and are required to use Github for all projects (especially group projects).
Version control gives you VERSION CONTROL and a backup.
1) Sometimes after compiling under VisualStudio we would return to look at our source code and see that it had been replaced with Assembly. Teacher's response? "I guess you'll have to write it again."
2) Saving periodically to a single file is about as useful as not saving at all when you have borked your program somehow. Now you get to spend the next few hours commenting out random lines and inserting `cout<<"Here"` lines into the code to see how far along it got.
We in the class eventually decided that the "safest" way to do it was to continually save the files under new names in order to create a poor man's VCS. But that in itself was difficult to remember after more than a few days of working on it, as you'd have to remember which version you wanted to work on: assignment.cpp, Copy of assignment.cpp, assignment.bkup.cpp, assignment(Last version that worked).cpp, etc.
I would be appalled these days if CS classes don't spend at least a single lecture discussing how to use Git.
The greatest works of humanity were written without a VCS (novels, operas). Using a VCS is only mandatory for multi-person projects.
Code is different. There are many times that I have been developing and I do something to my code that causes mystery behavior, and I don't catch it until perhaps days later. Being able to walk backward in time and see when the problem first occurred is invaluable.
I used to really like using Visual Source Safe. It was so easy to set up and integrated directly with Visual Studio, there was no excuse not to have a VCS. Too bad it had a reputation for garbling itself (something I never had happen as a single dev).
Having to learn a VCS at the same time you are learning the difference between a parameter and an argument will cause more harm than good for a novice.
I wouldn't recommend it to someone at the hello world level, but would not long after. The industry is plagued by people that don't know how to use source control.
That's an option, but not the only option.
For big shared mature projects, I treat each commit (to shared branches at least) as a presentation, where I try to describe exactly what changed, how, why, and to preemptively answer any questions I suspect will come up in the code review, clean up unnecessary or unrelated changes, cross linked to any task tracking items and bugs, the code review itself, any docs I might've updated in tandem, .... the description will often be longer than the actual code changes. With a quick summary to start, so you won't typically need to read the rest, of course. After the review and submit, I'll ping QA with some stuff I think might be worth testing once the build goes green. My commit messages, at least, tend to be better than any of my coworkers.
For solo seed projects, on the other hand, I take 5 seconds to try and describe what it was I did in the past X minutes. I try to remember to commit often enough that this doesn't devolve into "Changed stuff" because I forgot to commit for a day and touched 20 different things, but it happens - making those commits worse than any my coworkers generate, but still better than no VCS. They come in handy for tracking down bugs and such.
> The greatest works of humanity were written without a VCS (novels, operas). Using a VCS is only mandatory for multi-person projects.
Most of these had drafts and earlier revisions (or versions.) I agree that VCS is not mandatory mandatory, but the entire reason I switched to git (from SVN) was that "git init" is super low friction for getting new projects under VCS. That it handles branches way better and enables distributed workflows are mere side benefits.
I don't even understand "treat everything as a series of patches" as that's not really a VCS workflow unless you are Linus.
Not true. These things usually go through many drafts and revisions, and the previous drafts are usually available to check out.
- programming is a team effort
- writing (non-code) is important
- software is never done
- few clever algorithms used in day-to-day work
- the complexity comes from aggregation of many simple things, not one complicated thing
https://henrikwarne.com/2012/08/22/top-5-surprises-when-star...
It's also important to teach students how not to prematurely optimize, how to find places to optimize, how to use abstraction, and a lot of other things that just are kind of shown and glossed over.
Except if you need a certain level of performance. It would be silly to write a million lines of code to find out that you could never reach the level of performance that was actually required.
But in general you are right.
I'd like to add that perhaps the most difficult aspect of software engineering is a situation in which specs change all the time. This happens a lot during prototyping, and afterwards, when a prototype has been promoted to a product.
When people use that phrase, they're usually talking about the nit-picking, obfuscation-inducing stuff that'll get you a 3% increase in speed, that you'd generally do at the end of the development cycle.
We also all understand the limits of our hardware and our abstractions we are applying to the project at hand. If we should be considered professionals we need to prove it by being able to reason about our systems. We should be able to tell beforehand what abstraction is appropriate for the project. That is the knowladge that must be taught.
Because you need a long-living project, and such projects are (a) expensive and (b) rare if you mean them to be thrown away. University is not predisposed to carry those out, thus it's industry's job to teach programmers how to do that. Universities are well-suited for teaching different things, which are very difficult to pick up working in industry alone.
With amount of time we spent on Big-O and multiple classes involving algorithms I thought that if I ever had to do this professionally I would spend all day cooking up all sorts of cool algorithms involving recursion and graphs. It turns out that the biggest fight I have in my day job is not that but herding people to pump out readable code that is relatively performant.
The curriculum is changing pretty frequently, but git is covered in-depth, along with keeping code on GitHub, pull-requests, etc. Other VCS like svn are discussed briefly. The class also goes over popular IDEs and editors (vim, emacs, sublime...)
The class isn't led by a professor, but by a group of older students that have encountered these things in internships. Maybe that's what makes the difference?
It is difficult to understand the usefulness of a VCS when the longest project you have worked on amounted to 5 lines of code and you can't produce a fizzbuzz program, let alone understand the difference between a class and an object.
If you were self taught, or have been away from the newbies for too long, you don't always remember what it was like when everything was new. Wrapping your head around how to construct a program that does what you want it to do (or even figuring out what you want a program to do in the first place) is a difficult hurdle to jump. The more extra hurdles you throw in front of them (git, debuggers, and even the compile step) make it harder.
The earlier you require those hurdles to be jumped, the earlier you will filter out students. I believe most people can wrap their head around computational thinking and computer science and I would hate to lose them because of the tools.
You don't need a VCS to understand classes & objects. You don't need a VCS to understand Big-O, you don't need a VCS to understand Trees or Graphs or Maps or Stacks or Queues. You don't need a VCS to understand Computer Science.
And once you know what a Tree is... then I can explain to you how git works.
I swear I used to have a flowchart I'd blindly follow, and god help me if there was a conflict record :/
Addendum: The end result of this confusing mixture of market forces is a fleet of workers unskilled at either.
Maybe / quite probably they weren't filtering out ton of false negatives.
1. Had a Github with actual code in it.
2. The code was clean, lightly commented, and brief without being terse; regardless of the paradigm.
3. They breezed through the interview because the questions tested their ability to actually build the thing they said they could build. No silly games. A light question that touches on data structures and O time, but nothing you'd need to crack open your old college books over.
I feel bad for people starting out, but senior / intermediate devs are just such a better deal. You pay double and you get about four or five times the work.
Overall, I've been bummed lately because I've interviewed CS majors and they have no/poor personal website, basic CS code in Github, and overall don't seem to have that passion that other non CS majors do have. I don't know if it's college that isn't preparing them well enough, but having a personal project or two in Github alongside a decent personal website goes a long way to at least indicate you actually enjoy programming.
And really, I have zero financial motive to learn how to do so because while you might get the rare wiz kid, usually you don't.
Perhaps all of their code at previous gigs has been proprietary and they don't relish the prospect of doing a full days work and then coming home to spend their evenings maintaining a GitHub profile in case a future employer has it as an unspoken requirement for the position.
I suppose I could try citing my 22k karma on electronics.stackexchange, but I'm not sure that has the same level of name recognition.
Granted I'm not going to fail someone on an interview who appears competent, can explain Frontend technologies well and answers questions correctly. It's just more comforting to have both. As we all know, theory doesn't equal real life in many situations.
That's a reason to feel bad for the senior devs :-). The people starting out will get the job because they look cheap to managers/shops that want to throw mythical man months at a problem, so they get a foot in that way.
Crazy also how similar our path to learning programming was. Looking back, all those hours of fiddling with BASIC in high school, or with Pascal at school really didn't teach us all that much. Like him, my internships mostly taught me meta-lessons rather than actually valuable skills. Like him, in my education I followed the path of least resistance, or rather the path of "most options left to explore since I have no clue what I want to do", and I feel I'm lucky I ended up where I did. Like him, I fell in love with math way late when I finally saw it wasn't about rote application of arbitrary techniques (abstract algebra is what opened my eyes) like we're taught in school.
This sentence, buried deep in the essay, is brilliant: "a common failure mode is that you’re given work that’s a bad fit, and then maybe you don’t do a great job because the work is a bad fit. If you ask for something that’s a better fit, that’s refused (why should you be rewarded with doing something you want when you’re not doing good work, instead you should be punished by having to do more of this thing you don’t like), which causes a spiral that ends in the person leaving or getting fired."
I have a very smart friend who is actually a great writer. But if she doesn't nail the first draft, she gives up saying, "I suck at writing". Writing is rewriting. And similarly, good learning is having grasp at the engine at your disposal through metacognition.
After joining industry immediately after high school, I dismissed the value of formal education and selected a major with little consideration (I was unaware that CS even existed). I've recently joined a team where all my colleagues, many who received their degrees from prestigious institutions, majored in C.S. and imposter syndrome haunts me. Many though, are surprised,
Although I have my B.S. in information systems, I'm debating whether to return to academia -- obtain a second B.S. in CS or a stretch for a masters in CS (self study the fundamentals, which I'm currently doing, prior to starting the program) -- or continue the self study route to fill the missing gaps in my knowledge.
You’ll get over it. However, you will forever be cursed with having to keep your wiz-kid credentials up to date as you will never have that degree to help wedge the door open for your next opportunity. Ultimately, if programming is what you do (yes, I know CS is not just about coding) it doesn’t really matter, because the rubber meets the road at some point, and either you can code, or you can’t.
One thing I'm trying to do is keep myself current when it comes to software development. I think it's good to have a backup skill that I can fall back on in case my PhD doesn't work out.
It's good to know that someone like Dan Luu went through ups and downs before getting to where he is now.
The Joel Test is now considered to be obsolete because it awards points for things like "Do you have testers?" and "Do you fix bugs before writing new code?", which aren’t considered best practices by most devs today.
Can anyone explain why having testers isn't considered a best practice by most devs today?
Devs should be testing their own stuff too, of course.
Only to check that it's actually working before sending it off to the testers. Unit tests can be a good way to do this.
Make no mistake though: a good tester is worth their weight in gold because they will find many "real life" edge cases the developer would not have thought about, as well as UX issues if the feature being tested is user-facing.
I probably would be disinclined to hire a developer who wanted a different person to write/run their tests, unless it was for a very specialized role and said developer had exceptional talents.
That's not the role of the tester. The developer should be writing and running their own unit tests. The Tester should be running through user scenarios, use cases, and basically be pretending to be a user of the software to make sure that everything works and makes sense in a workflow (not just in their unit components)
Towards the end of high school, I got Internet access and learned HTML to build a web page. I took AP Computer Science (in C++) in my senior year and scored 5 on the exam. I majored in computer science at a top math/science university that isn't as well-known for CS as some other schools. I turned down some of the higher ranked CS schools, which was probably a mistake, especially as I wasn't even that interested in the other sciences. I'm more into languages, and I was interested in CS because of its creative and entrepreneurial potential.
Fast forward to now: I started programming early and majored in CS, and I can write classes, objects, and functions, but I still don't really "get" programming. My algorithms course in college was all math and proofs that I didn't really understand. I've since gone through algorithm MOOCs and implemented some algorithms, but I still can't really apply them. My work involves some programming, but more of it is Linux administration. (I also don't really get how to deal with hardware because of my problems with anything physical.)
> Tavish Armstrong has a great document where he describes
> how and when he learned the programming skills he has. I
> like this idea because I've found that the paths that
> people take to get into programming are much more varied
> than stereotypes give credit for, and I think it's useful
> to see that there are many possible paths into programming.
Okay. Yes that's useful. Let's see what path you took... > Luckily, the internet was relatively young [...]
There ya go. Look no further!Mine own story is a little different... The author had local peers, I did not. The author made no mention of an old hand-me-down c64 nor Tandy 1000's in his kindergarten classroom...
But, getting online in the mid-nineties? Check. That's huge.
TCP/IP was explained to me by some random gamer in a chatroom, long before I ever thought to "google" it.
(Speaking of paths... Lycos --> Altavista --> Still Altavista for a long time as I resisted the change to Google --> Google --> DDG)
is fairly consistent with
>chock[s] it all up to chance
A little humility does great for ego burns.
I think I can empathize with your view, now.
Your mileage may vary, but as a mere mortal I personally find it much more reassuring when the role of luck is recognized.
Too many narratives are akin to:
"Well, I worked very hard every day without stop and tho I struggled at first - with how hard I was working - eventually the fruits of my labour yielded this unbroken string of successes thereby reaping my just deserts"
His luck probably helped quite a lot. Nobody really knows what they are good at or what they will enjoy until they do it. Even if it's 'harder' or 'easier'. Having a good mentor is difficult as well; they have to know their stuff, want to teach and mesh well with you.
— Oprah
I'm not sure how often Oprah gets quoted on HN, but this statement resonates with me.
What? You've lived a truly blessed life, Dan Luu. I've observed the opposite, pretty consistently. I've been working as a programmer for 25 years and I've found, across nine separate employers (and lost-track-of-how-many different supervisors) that spending any appreciable time reading (even a book about Angular when you're supposed to be learning Angular) will become a management issue. Everywhere I've ever worked has expected learning to be on your own time. Don't believe me? Put "read three chapters of a book" on a status report and see how many levels of management show up at your desk to micromanage your time.
Try something like "reviewed industry publications for new paradigms and optimization techniques."
Can't say I've ever had a problem with that in my two decades in the industry. Learning is expected and mandatory.
My time at home is mine. If I'm reading a technology book, it's usually something I'm curious about and don't have a direct use for in my professional life.
If you are a JavaScript programmer and spend the work day reading about Elixir; that is a problem. It likely doesn't apply to work so that should be on your own time.
Yes, you'd think that would be blindingly, painfully obvious to anybody with the cognitive ability to tie their own shoe laces. And it probably is, to everybody except the MBA "efficiency experts" that are taking over my profession.
At my first job (from high school) my first instruction was "go to company library get the book on fortran and learn it".
I don't spend significant amounts of time doing nothing but research however. The problem might not be "read three chapters of a book" on a status report, it might be having only that on a status report.
document.body.style.maxWidth = "768px";
document.body.style.margin = "auto";
document.body.style.fontSize = "20px"What I like about sites like this, is that I can adjust them to my needs using a tool I have full control over. The browser allows me to:
* Adjust window size or detach tab and resize
* Use zoom judiciously
* Use my preferred browser reading font
Sure, it may not be beautiful, but is surely is functional. I'll also leave this here: http://motherfuckingwebsite.com/
It's also worth noting that Firefox's "reader" mode works perfectly with this site.
And it's fine, as long they scale properly and allow narrow browser views. The only criminals are the ones that force wide paragraphs... sometimes to a point I have to vertically scroll a paragraph.
https://thebestmotherfuckingwebsite.co/
which also has valid points to make.
(I'm sure there's a million add-ons for this... But these days I try hard to avoid customizing my setup, because so often I have to use another computer anyway. Learning to live with defaults makes life so much easier in the long run.)
Or Win + Left Arrow and then Ctrl + = a few times.
Readability view has options for font size, font-style (serif vs sans-serif) and off-white / sepia / dark modes.
Edit: It seems to even have new controls for adjusting column width and line-heights.
Chrome has distill mode, start chrome with "--enable-dom-distiller" option. https://github.com/chromium/dom-distiller
I think there's similar options in IE, but can't remember its name.
The browser will remember this preference for his site, as well. No plugins needed.
I'm not really complaining, I just wanted to point out how little styling was needed to massively improve readability.
Windows 10, which I use in work, has this annoying habit that if I maximize browser for a webapp that requires (benefits from) more screen estate, it doesn't always restore to the earlier size correctly. But it's something I can live with.
HN specifically, if I have serious reading to do in the comment section, I might narrow my browser down to 600px for even better readibility.
There were a few years that I configured my work machine to have dual monitors in portrait mode. That helped my feeling of constriction, while giving shorter lines of text. As a bonus, it matched pretty closely to the 1280 width (at 1200 pixels), and often allowed more of the text to be shown at once.
javascript:(function() { document.body.style.maxWidth='700px'; document.body.style.margin='0 auto'; document.body.style.lineHeight='1.5'; document.body.style.fontSize='20px';} )();
I call it StyleLet :).Why not just resize your browser window?
I apply similar, but relative styles to pages for readability: https://news.ycombinator.com/item?id=12479901
If they are only readable on a wide-screen-width window, perhaps they were wrong to begin with?
Well, if they are, then they are. Pretending everyone else is right, when they're not, has its own drawbacks.
document.body.style.fontFamily = 'Georgia';
document.body.style.lineHeight = '1.62em';
document.body.style.margin = 'auto';
Then I zoom to get the font size I need.Luckily my BASIC books had most of their examples starting with SCREEN 1. Drawing images programmatically happened to be fun and useful, I learned the hard way by retyping examples and then somehow began modifying those.
My own bummer was Windows epoch. I could do VB but never otherwise grasp Windows programming because any program will have so many IDE-generated boilerplate that was totally meaningless to me and I could not work with that.
I could only resume when I learned proper WinAPI later as an University course, but then again I switched to Linux, which is a best IDE there is.
UPD: meaningLESS