14 ms·
Advice to new programmers
- pnevares 8y agoThe overwhelming majority of these points are useful, and the exact thing that "engineering culture" Twitter has been excelling at for a while now. It wasn't always easy to find people supporting people at every stage of their career, but there are several accounts to follow to do just that. The "one page ahead in the manual" quote is a great example of this. It's hard to remember when you didn't know everything you know today -- so think about yesterday, or last week, some smaller time slice. What did you learn yesterday that somebody on your team may not know? Operating at that layer and sharing knowledge freely shows you're a friendly resource and shows that you're honest about your journey. It attracts other people who are slightly above or below that level, who can share and multiply what you're learning. (And it has a great byproduct of teaching you where the egos sit at your company.)
- pjmlp 8y agoLove the advices, many of them resonate to me as well, thanks for sharing.
- Blinks- 8y agoI posted something similar in another thread about advice but take a programming terminology/vocabulary class, you probably know most of it after a few years experience but even a slight misunderstanding in diction can have serious implications down the line. I was surprised how much I learned and how beneficial it was to the conciseness of my code comments. This can be especially helpful with network stack and TCP/IP related work, remembering all the acronyms can save you a lot of time.
- tzhenghao 8y agoAll very good and important advice for those entering the industry. I'd like to stress the people aspect even more. Treat people the way you want to be treated. If an engineer doesn't understand a certain technology, kindly explain it to them instead of berating them for being "not smart". The jerks will outnumber the saints, but being the latter almost always pay off (being successful, high status, generally liked by everyone else etc.) in the long run.
- Consultant32452 8y agoI'll second this with my anecdata. The thing that has always made me the most money is being able to communicate technical things to non-technical people in a way that doesn't make them feel stupid. There is usually at least one better coder than me on any given team, but they never get advancement because they can only talk to other engineers who they are also usually talking down to.
- deleted 8y ago[deleted]
- scaryclam 8y agoBe humble. Be kind. Remember you're never as senior as you think you are. Opposing opinions are not wrong. Remember to have fun, because building things is awesome. Tomorrow is an opportunity to be better.
- jrs95 8y agoI wouldn't necessarily say that opposing opinions aren't wrong. Sometimes they are, and a lot of the time it's because of some form of institutional inertia. In general though, you'll have great ideas, people will politely tell you to fuck off, and you have to be able to get over it quickly or you'll make yourself hate your job.
- ChucklesNorris 8y agoThese replies were not what I expected. Practice, practice, practice is not necessarily good advice if you don't know what you're doing. Before I took college programming classes I was self taught and wrote what I later learned was called "spaghetti code." I had no idea (before the classes) who was giving me good advice and who was giving me bad advice. My code was unorganized and a total mess. In my class, our textbook was "The Elements Of Programming Style" by Kernighan and Plaugher. As far as I'm concerned, it is THE book for beginning programmers. It's rare and expensive now, but worth it. In a nutshell, it taught: - program in a direct way, do NOT try to be clever and code in weird, complex ways. Your code (not just the comments) needs to be readable to others, what it does should be evident. (The book gave examples of both, and after looking at a number of these examples, you get the idea of what K&P mean by ELEGANT programming.) - Subroutines must have one entry point and one exit point, and accomplish one task. - Add lots of comments in your code to help others or even yourself in case you forget what your thinking was. These are just a few examples of good programming practice. I later became a professional programmer, using assembly language and C++. But that first college book was the one that outshone all the later ones that I read. Get it if you can find it! I would also highly recommend Dennis Ritchie's books. One more thing - object oriented programming is good, but I'm not sure it's paradigm will win out in the end. As an assembly language programmer, I began to realize the power of data driven programming, and I began to write my programs in that way. Which is why I think this new language, Julia, holds a lot of promise. I say this as one who has only read ABOUT Julia, not as one who has studied the language itself.
- V-2 8y ago> - Subroutines must have one entry point and one exit point, and accomplish one task. Sometimes code is much cleaner if you exit a method or a function early. Especially in languages with automatic memory management where you don't need to concern yourself about leaks so much. > - Add lots of comments in your code to help others or even yourself in case you forget what your thinking was. Lots of comments is a red flag to me. It often indicates the code itself is of poor readability. But it's usually easier to just slap some comment on it than to properly rewrite it... "A comment is a failure to express yourself in code" (Uncle Bob). > These are just a few examples of good programming practice I'd argue they are debatable, and at the very least not necessarily universal.
- RealityVoid 8y agoI have a problem. I try to be as helpful as possible. But when deadlines are near(and that seems to be constant lately) I lose my patience. I lose patience when juniors ask things they could have easily searched. I lose my patience when they come to me going "this isn't working" without having tried any alternative. I lose my patience when they ask me for things I could not know, that they should know and all I do to solve the problem is just probe a bit more. So how do you, who are comparatively more experienced than your peers, not lose your patience? EDIT: replaced 5x instances of loose with lose. Oh god. I was kinda' drunk and would be tempted to blame auto-correct on my mobile device but I just tried it, and it doesn't turn lose into loose. So I must just be a idiot.
- hideo 8y agoThis is a bit of an oversimplification but I've had really good results by making my first question "What have you already tried? Can you remind me in a couple of hours?" I know you mentioned that, but often times asking that question makes people try again, or doublecheck what they are doing. Giving them the couple of hours gives them room to maneuver and _maybe_ save face. Do it a couple of times and the people with good intentions learn to learn.
- mynameishere 8y agoAre you serious? Lose. The word is lose.
- chrshawkes 8y agobest comment I've read on here.
- bregma 8y agoMaybe they mean they loose their patients. The violent ones can do real harm.
- rlonn 8y agoMy brain almost loosened reading the previous comment. I think you're right about the patients. He uses them as some kind of weapon when he gets angry, apparently.
- sephoric 8y agoI love the simple software-centric approach to analyzing this survey and categorizing the answers. There's one thing I'm sure was mentioned a lot by 17.1% of the participants, but it's one thing I'd like to stress: Find a good mentor! I've been teaching my son programming steadily for a few years now, and every so often he likes to take what he just learned, go and revisit some old programs he wrote or read from before he understood the new concept, and understand it better and often improve on it a lot (even rewriting it sometimes), and then he comes back to me very excitedly telling me how the new concept I taught him greatly improved the thing he did. He's already writing code better than I did when I was a decade older than him, easily grasping new concepts like linked lists, garbage collection, pointers, and Lua coroutines and so on. When I was his age, I was still struggling to understand arrays in QBasic, had nobody to mentor and guide and teach me, and was generally pretty lost. Having a mentor who can guide you carefully and at your pace is an incredibly powerful shortcut.
- ChucklesNorris 8y agoExcellent input!
- stcredzero 8y agoit's one thing I'd like to stress: Find a good mentor! At my old Hackerspace, one of those high school robotics teams came to us for some help. The kid who was doing coding could really have used that advice. He confessed to me that he didn't have time to read through all of the controller framework code and understand it completely. We were under coding marathon conditions at that point, so he wasn't far off with that. One of the motors they were using was pretty big, though. Plenty big enough to seriously hurt someone. So I urged him to at least set breakpoints in all of his stubs, and step through those in the development environment at a minimum. He was pretty dismissive about checking his work. Downright smarmy, actually. Sure enough, something goes wrong, and the metal body of this robot ends up spinning wildly, right in the middle of the team huddled around it, sending parts flying everywhere. Miraculously, no one was hurt. Did that kid learn anything? Nope. He still knew it all.
- sephoric 8y ago
- apl002 8y agoAs a somewhat still new and self taught programmer, the "dont compare yourself to others, but where you were in the past" really resonates with me. I've come a really long way and I'm proud of how far I've come. At the same time I definitely have moments where I interact with someone else and think I'm still such a novice. I am much better at when this happens, being ok with it being true and using it as motivation to keep learning and get better.
- duxup 8y agoYeah those "Oh for the love of god why didn't I think of that!" moments can be a little heartbreaking when you knew all of those pieces but chose to do something ... lesser. I think long term managing that frustration... is 90% of the battle for me. I learned after age 40 and my patience is so much better than when I was younger. I suspect it has helped a great deal.
- drainyard 8y agoMost of the time when that happens to me, I try to remember all the times I did something well and didn't think about it. Usually those far outnumber the bad ones.
- WrtCdEvrydy 8y agoI'm gonna give you a secret... this will make your career easy... listen. 'The more you learn, the less you know'. Now say it to yourself.
- james_s_tayler 8y agoTotally. Something I learned very early on was your big idea isn't as big or clever as you think (necessarily, but sometimes it is!), so it's worthwhile to canvas the office to first find out the history of why something is the way it is or why we don't currently do X. Often you find it used to be done that way in the past and then they stopped doing it that way because Y. It turns up all kinds of interesting stuff that no amount of thinking will get you to on your own. That would be my number one advice for those starting out.
- tskubicki 8y agoMore on the "growing your career" side: Build something that solves a problem and put it on github. Not only are you adding to your portfolio, but you're demonstrating that you can take a problem and come up with a solution for it. Canned "To Do" apps aren't as impactful because there's a 1000 tutorials for this online and everyone knows it (though they can still help for showing knowledge of a technology or stack, so don't count them out)
- wincy 8y agoThis is how I broke into my first full time dev job from tech support. I wrote a web page without any frameworks or anything that would upload images, remember the hashes for them, rotate them, and detect duplicates. I built it because I didn’t want my daughters pictures on Facebook but wanted to share images with family. Then I made a YouTube video with lots of pictures of pizza to demo it. The hardest part for sure as a dev learning only from my Google fu was the async stuff. But I doubled my income that year, so it was definitely worth it.
- adamnemecek 8y agoPick your favorite open source project, fire up debugger and start hacking.
- aliswe 8y agoThis one is pretty close to what my advice would be. I started out making games at 9 yo, using clickteams klik&play, tgf, and later mmf and mmf2. (They were the creators of amos & stos although that was before my time) For those unfamiliar with the development experience, its very similar to scratch but with a spreadsheet-like layout. When I seriously started learning the workings of more complex logic in these tools is when I started reading the "source code" of the 2d platformer Zeb, programmed by Lee Bamber (who would later go out to make Dark Basic), drawn by Nolan Worthington. This taught me in a very condensed manner lots of advanced programming techniques. Like a teacher of mine used to say, this will feel like drinking Fun Light (concentrated drink supposed to be cut like 1/12) directly out of the bottle. And that tradition has stuck with me, decompiling dlls and inspecting websites etc.
- jpeeler 8y agoDedicating yourself to a specific high quality open source project (popularity doesn't not necessarily imply quality, but in the absence of other indicators start here) can serve in many ways as a mentor would. Some advice on getting started on an open source project: Open source projects (whether corporately funded or hobby led) are run by people! So it's in your best interest to give before you take. Become active on the communication channels, answer user questions, fix issues where you can, etc... Once the lead developers recognize your name, they will be more willing to review your code (and get your changes merged when review bandwidth is low). Well run projects often have very knowledgeable people that can point out mistakes and teach you in general. Of course, there's still value in being a "drive-by contributor" where you fix a small bug and never come back. It's just unlikely that you'll form any sort of relationship from such an interaction.
- edoo 8y agoSome good advice on there. I like the no shortcuts one. Another way to put it is the longest way is the shortest way. If you think you are taking a short cut you are likely taking a long cut overall.
- knodi123 8y agoI learned SO much about windows during the 2 weeks when my mouse was broken and I was too cheap to replace it. Turns out you can do pretty much anything without the mouse, even without turning on handicapped assistive mode! And there was a time when a snotty admin convinced me that he had the authority to require me to do development in vim. He did not, and damn that learning curve was steep- but I picked up skills that still serve me well a couple decades later. Oh, and another one - we had a process for cranking out custom reports, where if you could express the entire thing they were asking for in SQL, then you were done. But if any part of required programming logic, you had to create a controller, and a template file, and register them, and do a full product release... it was a big hassle. And man did I ever learn how to make SQL jump through hoops at that job. So, a corollary to your "The longest way is the shortest way" is my life lesson - Constraints make you better.
- edoo 8y agoI like that. A constraint means you have at least a starting point too. I've always struggled to keep on track when faced with seemingly infinite options. The first few decisions/constraints that define a project and allow it to be worked on can take a long time. I really wonder if that admin was more of a 'bastard operator from hell' (old school reference) or sneakily getting you to improve yourself.
- knodi123 8y ago> I really wonder if that admin was more of a 'bastard operator from hell' Ha, yes, he absolutely was. Just very lazy, knew I already had SSH access to our staging server, and knew I needed to develop on there, but didn't want to bother setting up SSHFS and configuring it to be accessible from my windows machine, and didn't want me telling him to do a new staging deploy every 10 minutes while I tried to figure out how to get some connected hardware working right.
- wilkskyes 8y agoMy advice would be to learn and master vim. When I began programming, I was forced to use vim and hated it, I didn't understand why someone would use such an "old school" text editor to write programs. I abandoned it and moved on to typical IDEs. As a young programmer, it's difficult to see the value. But many years later I discovered the power of vim came from customizing it to my exact preferences, and mastering all the shortcuts and its grammar. After a year's worth of effort, I began coding at the speed of thought, and programming has been much more enjoyable ever since, as time moves on I only get faster and faster. It's like cooking with a really sharp knife vs a dull one.
- Noumenon72 8y agoI still like IDEs, but here's an example of the kind of thing you're talking about: in ~/.vimrc, I put nnoremap <F5> :w<cr>:!printf "\033c";python %<cr> and now I can execute a Python script I'm editing with one keystroke instead of "save, exit, ./myscript, vi myscript".
- vaylian 8y agoYou might be interested in the setting makeprg: set makeprg=python\ % Vim comes with the :make command which is handy for compiling projects with Makefiles. But you can also set a different value for makeprg to do whatever you want for the current file. Of course you still to set up a key binding in your VimRC: map <F5> :make<enter> > instead of "save, exit, ./myscript, vi myscript". This is something I see a lot of people doing. Obviously, it is not efficient. There is no harm in having another terminal window open where you run the script. If you are using SSH, you can use tmux or screen to have several terminals in one SSH session. And lastly, if you have to edit several different files, do not exit vim to switch files. Learn to use the :e and :b commands. (The last advice is meant for the general audience and not directly to the previous post's author)
- jrs95 8y agoThis somewhat depends on the technology you're using as well though. Writing Java in vim is a pain in the ass in comparison to something like IntelliJ that has auto-importing, go to definition, etc
- deleted 8y ago[deleted]
- _mrmnmly 8y agoAh sir, you could just ask me directly https://lukaszkups.net/notes/tips-for-beginner-programmers/ https://lukaszkups.net/notes/tips-for-beginner-programmers/ ;)
- Jach 8y agoA quote from _why is something I'm occasionally reminded of, and still struggle with sometimes even though my first lick of programming was 15 years ago: "When you don't create things, you become defined by your tastes rather than ability. Your tastes only narrow & exclude people. So create."
- wslh 8y agoA side note: next time you want to scrape Twitter use https://github.com/twintproject/twint https://github.com/twintproject/twint which is relatively faster and use some tricks to avoid scraping defense techniques.
- ohiovr 8y agoI have learned that I have peak efficiency in code in the early morning and stays strong for 6 hours. By 8 hours I start getting hung up on simpler problems and it’s just a waste of time to keep on going. Take time to relax and sleep. You will have the answer to your problem sometimes just minutes from wake.