I no longer remember my first project. I think I was in my freshman year and I attempted to compute e^10,000 using taylor series expansion.
Anyway, I can not tell you which lessons I learned from my first project and what lessons came later. So here's a mix of everything I have that may/may not help you.
Use linux. Learning to code under windows is like attempting to build a rocket-ship with silly putty.
Get a throw-away computer and abuse it. Look in a junk yard or someone's attic or search ebay for a $20 computer. Your expensive gaming laptop/macbook pro has too many valuable documents to mess with. You need to know what will happen when you do something like this:
Learn to use a debugger. Step through code, peek into memory, use breakpoints. This is the most important skill you'll ever learn
Write stupid dumb things just for the fun of it. All code doesn't have to serve a purpose. Replace all instances of "wand" with "wang" in Harry_Potter_and_the_prisoner_of_azkhaban.txt and see what happens. Go have fun
Install FreeBSD. See what non-consumer software really looks like.
Get a Pic Microcontroller and build a fancy digital alarm with it. You'll learn more about coding while reading a microcontroller's datasheet than anything on coursera or youtube can teach you.
Learn a difficult language first. Javascript and Python are cheap skills that are easily picked up. Master pointers.
Read coding styles. Learn about the yoda-syntax and why people write code like that.
Read every blog post on news.ycombinator.com
Go have fun
Read every line of your compiler output. every single line. Google for what you don't understand. figure out what flags make your compiler more verbose.
Buy a legit textbook on computer science. Internet posts and articles can only take you this far.
I don't know if any of the above apply to you. I still wish you happy hacking! :)
First major projects? Just random things at work, mostly Access tools for data management.
Important things:
pick your tools carefully. Namely if it's programming intensive don't choose Access or anything else VBA based. If I had my choice I would have chosen any other programming setup that allows SQL queries fairly easily.
Comment your code. You won't remember why you had to call a DLL to do something instead of using the built in function. You will try to use the function. It won't work. You'll relearn why you used the DLL. Every. Time.
Don't work on your program in an isolated bubble (unless it's required). Try to get constant input from whoever is going to use what you're making or whoever wants it made.
My first major project has been translating a desktop client (rich app) to a webapp. I'm expanding/maintaining the second iteration now.
Some more important things in addition to what @multidan listed:
Given the opportunity, perform plenty of research on what frameworks/APIs you want to use ahead of time. Nothing sucks more than getting halfway (or more) through a project only to realize that you picked the wrong framework/API for some of the more advanced use cases and you have to either
finish with the current framework (and then maintain it); or
start from scratch with the other framework
I wasn't the one who made this mistake, but I was the lead (read: only) programmer on the project by that point, so I paid the price either way.
For small tasks, it may be preferable (in terms of time/effort) to simply find a few examples and then write a utility to do it yourself, provided you know that you will never need more functionality. If the task is larger, try to find a framework/API that already does most or all of what you need to do, and then just put a wrapping class around it if it doesn't do everything you need. ONLY write the entirety of a larger utility if the frameworks/APIs you can find are woefully inadequate.
UNIT TESTS, UNIT TESTS, UNIT TESTS. I cannot stress how much having good unit tests helps to write good, easy-to-maintain code. The more unit tests you can write ahead of time, the better, because that's all the more use cases or edge cases that you know will work as expected once you've finished writing the code. It's also great when the QA folks come back saying "it broke when I did this" and you have a unit test case that can explicitly prove they did something wrong.
Writing accounting systems on Apple ][s and IIIs, and Commodore PETs.
I learned that things will go wrong because there are always gotchas at lower levels that you will discover the hard way. Later, you learn that compilers and interpreters and third-party libraries always have gotchas that are going to screw you. I learned that co-workers will intentionally and unintentionally screw you over. I learned that employers have no idea what you do and always get pissed because it takes too long and they never want to pay what it's worth. I learned that customers want stuff that seems really stupid to you, but if you give it to them they will be really happy and they will pay you and you will understand that what you thought was a stupid idea was really a good idea because you only know programming and they know what they need in their business. I learned that you have to keep experimenting and learning new things, that you should never get complacent with a platform or a language, you should always aim for where jobs will be in ten years time, and keep moving there.
My first project was creating a Shadowrun dice roller for my Python class. Probably my best learning experience.
First, Python is a pain in the ass when it comes to graphics. But it was fun to logic out the design. Creating one dice, then a row, then multiple rows, all while keeping track of where the graphics point will be.
Then it helped me explore different libraries. I ended up going with Tkinter, creating buttons instead of graphics.
So i learned a lot from that project; breaking a complex problem into small individual parts, optimizing code so I create the element once then apply it repeatedly (do not repeat yourself), user interactivity, applying images (i remember that being a pain), and saving/loading.
That was the first project that I coded on daily for long periods of time, I couldn't step away from it. So the best thing I learned was to learn programming by finding a personal use/interest and trying to code it out. Really helps keep me focused and a bit of a perfectionist with it.
Right now I'm trying to pick up ReactJS with some Mobiscroll components, I'm pair programming on it and it's so massive of a project it's breaking my brain. Trial by fire can also be a great motivator. I'm picking up more than I did in school but I'm definitely lacking some fundamentals.
It takes a really good programmer to be able to learn so much from smaller projects like that. Most things I'd done for classes I just half assed it and got something working and moved on. You'll be very well prepared when you move on to large-scale multi-programmer projects.
I worked on a small team and wrote a tool in Java that maintained, aggregated and indexed a collection of files.
Biggest lesson learned? Bad programmers write bad code and sometimes it's not even salvageable. People like to whine about people like JoelOnSoftware telling managers to only hire rock stars but bad code is a nightmare to deal with. In this case I gave up and rewrote about 1/3 of the application myself out of desperation. I certainly wasn't a rock star at that point (still not) but at least I knew wtf I was doing.
I've run into similar situations since then with basically the same end result - having to entirely rewrite their code. In the most recent instance there were race conditions, no comments, the same variable would be used for multiple things (which frequently didn't match the name of the var), magic strings, magic numbers, long and inexplicable string manipulation blocks, they violated some of the most basic best practices... the whole thing was garbage.
Lesson: Don't be a half-assed developer. Everyone else you ever work with will hate you. You don't have to be a total rock star, but know what you're doing, and if you don't, ask someone else.
I agree with your overall sentiment but i have two nitpicks. Ofcourse bad programmers write bad code, but alot of 'good' programmers write bad code aswell. Id say it is a problem with lazy developers, and unlazy developers with lazy/bad days.
I also dont think your sentiment of 'just dont be a halfass developer' is good advice, since it doesnt really provide a solid course of action, and fosters un-original thinking.The only way of learning what is bad/good about certain approaches is trying, failing, learning. This ofcourse assumes that you are not lazy and competent.
There will be active efforts to instill FUD among the testers. FUD will spread like wildfire and suddenly your manager will come asking what the problem is when there is none.
Keep tight control on your analysts, and don't let the drama queens wander the test center at the beginning of UAT.
Last week I wrote my first ever script. Basically a header and footer grabber in bash using xxd and sed. Felt good, I still suck ass at coding but gonna work on it more when I have the time. Was for use with scalpel. Oh, I learned bash and regex ftw.
My first 'real' project was a mobile game I did. I created all the assets and coded the entire thing with a framework I made (wrapped around the Android SDK). I honestly had no idea that modern games (and software in general) are pretty much all made using existing engines and frameworks. It was pretty eye opening when I'd be browsing game development forums and see people posting games like, "I made this in like a week", and it'd be a decently polished game. Meanwhile, my point and click game took almost a year.
So that was the most important lesson; open source and free libraries are plentiful, time is valuable, and don't reinvent the wheel (unless you have to).
Various small games (Tetris etc.) = 'Realtime' programming, animation, bitmap graphics, storing game state
Programming text editor with syntax highlighting and automatic indenting = Document/View architecture (ie. MVC design pattern, although I ballsed it up and put all my 'model' code in the view... you learn by making mistakes :P ), text handling, caching
Various raytracer type things = implicit rendering, vectors, matrices, coordinate transformations, lighting, procedural texturing, text file parsing
More games = networking, latency / desynch / resynchronization, in-game chat
16 comments
9 u/downvotesattractor 22 Mar 2016 22:16
I no longer remember my first project. I think I was in my freshman year and I attempted to compute e^10,000 using taylor series expansion.
Anyway, I can not tell you which lessons I learned from my first project and what lessons came later. So here's a mix of everything I have that may/may not help you.
Use linux. Learning to code under windows is like attempting to build a rocket-ship with silly putty.
Get a throw-away computer and abuse it. Look in a junk yard or someone's attic or search ebay for a $20 computer. Your expensive gaming laptop/macbook pro has too many valuable documents to mess with. You need to know what will happen when you do something like this:
Learn to use a debugger. Step through code, peek into memory, use breakpoints. This is the most important skill you'll ever learn
Write stupid dumb things just for the fun of it. All code doesn't have to serve a purpose. Replace all instances of "wand" with "wang" in Harry_Potter_and_the_prisoner_of_azkhaban.txt and see what happens. Go have fun
Install FreeBSD. See what non-consumer software really looks like.
Get a Pic Microcontroller and build a fancy digital alarm with it. You'll learn more about coding while reading a microcontroller's datasheet than anything on coursera or youtube can teach you.
Learn a difficult language first. Javascript and Python are cheap skills that are easily picked up. Master pointers.
Read coding styles. Learn about the yoda-syntax and why people write code like that.
Read every blog post on news.ycombinator.com
Go have fun
Read every line of your compiler output. every single line. Google for what you don't understand. figure out what flags make your compiler more verbose.
Buy a legit textbook on computer science. Internet posts and articles can only take you this far.
I don't know if any of the above apply to you. I still wish you happy hacking! :)
1 u/grlldcheese 23 Mar 2016 14:26
Jesus. My first project was a decade ago and you just gave me a few things to learn.
Thanks.
4 u/multidan 22 Mar 2016 19:05
First major projects? Just random things at work, mostly Access tools for data management.
Important things:
pick your tools carefully. Namely if it's programming intensive don't choose Access or anything else VBA based. If I had my choice I would have chosen any other programming setup that allows SQL queries fairly easily.
Comment your code. You won't remember why you had to call a DLL to do something instead of using the built in function. You will try to use the function. It won't work. You'll relearn why you used the DLL. Every. Time.
Don't work on your program in an isolated bubble (unless it's required). Try to get constant input from whoever is going to use what you're making or whoever wants it made.
2 u/RevanProdigalKnight 22 Mar 2016 20:00
My first major project has been translating a desktop client (rich app) to a webapp. I'm expanding/maintaining the second iteration now.
Some more important things in addition to what @multidan listed:
Given the opportunity, perform plenty of research on what frameworks/APIs you want to use ahead of time. Nothing sucks more than getting halfway (or more) through a project only to realize that you picked the wrong framework/API for some of the more advanced use cases and you have to either
I wasn't the one who made this mistake, but I was the lead (read: only) programmer on the project by that point, so I paid the price either way.
For small tasks, it may be preferable (in terms of time/effort) to simply find a few examples and then write a utility to do it yourself, provided you know that you will never need more functionality. If the task is larger, try to find a framework/API that already does most or all of what you need to do, and then just put a wrapping class around it if it doesn't do everything you need. ONLY write the entirety of a larger utility if the frameworks/APIs you can find are woefully inadequate.
UNIT TESTS, UNIT TESTS, UNIT TESTS. I cannot stress how much having good unit tests helps to write good, easy-to-maintain code. The more unit tests you can write ahead of time, the better, because that's all the more use cases or edge cases that you know will work as expected once you've finished writing the code. It's also great when the QA folks come back saying "it broke when I did this" and you have a unit test case that can explicitly prove they did something wrong.
2 u/BunyipMoan 22 Mar 2016 19:19
Writing accounting systems on Apple ][s and IIIs, and Commodore PETs.
I learned that things will go wrong because there are always gotchas at lower levels that you will discover the hard way. Later, you learn that compilers and interpreters and third-party libraries always have gotchas that are going to screw you. I learned that co-workers will intentionally and unintentionally screw you over. I learned that employers have no idea what you do and always get pissed because it takes too long and they never want to pay what it's worth. I learned that customers want stuff that seems really stupid to you, but if you give it to them they will be really happy and they will pay you and you will understand that what you thought was a stupid idea was really a good idea because you only know programming and they know what they need in their business. I learned that you have to keep experimenting and learning new things, that you should never get complacent with a platform or a language, you should always aim for where jobs will be in ten years time, and keep moving there.
2 u/Sosacms 22 Mar 2016 20:22
My first project was creating a Shadowrun dice roller for my Python class. Probably my best learning experience.
First, Python is a pain in the ass when it comes to graphics. But it was fun to logic out the design. Creating one dice, then a row, then multiple rows, all while keeping track of where the graphics point will be.
Then it helped me explore different libraries. I ended up going with Tkinter, creating buttons instead of graphics.
So i learned a lot from that project; breaking a complex problem into small individual parts, optimizing code so I create the element once then apply it repeatedly (do not repeat yourself), user interactivity, applying images (i remember that being a pain), and saving/loading.
That was the first project that I coded on daily for long periods of time, I couldn't step away from it. So the best thing I learned was to learn programming by finding a personal use/interest and trying to code it out. Really helps keep me focused and a bit of a perfectionist with it.
Right now I'm trying to pick up ReactJS with some Mobiscroll components, I'm pair programming on it and it's so massive of a project it's breaking my brain. Trial by fire can also be a great motivator. I'm picking up more than I did in school but I'm definitely lacking some fundamentals.
1 u/multidan 22 Mar 2016 20:28
It takes a really good programmer to be able to learn so much from smaller projects like that. Most things I'd done for classes I just half assed it and got something working and moved on. You'll be very well prepared when you move on to large-scale multi-programmer projects.
1 u/Sosacms 22 Mar 2016 22:58
My brother has been an amazing tutor and the Python instructor was my best programming instructor.
2 u/DietCokehead1 22 Mar 2016 21:10
Hello, World!
1 u/ForgotMyName 22 Mar 2016 19:57
I worked on a small team and wrote a tool in Java that maintained, aggregated and indexed a collection of files.
Biggest lesson learned? Bad programmers write bad code and sometimes it's not even salvageable. People like to whine about people like JoelOnSoftware telling managers to only hire rock stars but bad code is a nightmare to deal with. In this case I gave up and rewrote about 1/3 of the application myself out of desperation. I certainly wasn't a rock star at that point (still not) but at least I knew wtf I was doing.
I've run into similar situations since then with basically the same end result - having to entirely rewrite their code. In the most recent instance there were race conditions, no comments, the same variable would be used for multiple things (which frequently didn't match the name of the var), magic strings, magic numbers, long and inexplicable string manipulation blocks, they violated some of the most basic best practices... the whole thing was garbage.
Lesson: Don't be a half-assed developer. Everyone else you ever work with will hate you. You don't have to be a total rock star, but know what you're doing, and if you don't, ask someone else.
0 u/brutalkeso 10 Apr 2016 20:58
I agree with your overall sentiment but i have two nitpicks. Ofcourse bad programmers write bad code, but alot of 'good' programmers write bad code aswell. Id say it is a problem with lazy developers, and unlazy developers with lazy/bad days.
I also dont think your sentiment of 'just dont be a halfass developer' is good advice, since it doesnt really provide a solid course of action, and fosters un-original thinking.The only way of learning what is bad/good about certain approaches is trying, failing, learning. This ofcourse assumes that you are not lazy and competent.
1 u/postmortem 22 Mar 2016 20:06
There will be active efforts to instill FUD among the testers. FUD will spread like wildfire and suddenly your manager will come asking what the problem is when there is none.
Keep tight control on your analysts, and don't let the drama queens wander the test center at the beginning of UAT.
1 u/thefloodcontrol 23 Mar 2016 02:57
Last week I wrote my first ever script. Basically a header and footer grabber in bash using xxd and sed. Felt good, I still suck ass at coding but gonna work on it more when I have the time. Was for use with scalpel. Oh, I learned bash and regex ftw.
1 u/ayylol 24 Mar 2016 16:50
My first 'real' project was a mobile game I did. I created all the assets and coded the entire thing with a framework I made (wrapped around the Android SDK). I honestly had no idea that modern games (and software in general) are pretty much all made using existing engines and frameworks. It was pretty eye opening when I'd be browsing game development forums and see people posting games like, "I made this in like a week", and it'd be a decently polished game. Meanwhile, my point and click game took almost a year.
So that was the most important lesson; open source and free libraries are plentiful, time is valuable, and don't reinvent the wheel (unless you have to).
0 u/tame 23 Mar 2016 08:11
When I first started teaching myself to program?
That kind of thing. :)