Programming lessons I learned
2012-07-28 20:54
225 查看
摘自:http://jaseemabid.github.com/07-26-2026/programming-lessons-learned.html
Things I learned outside the classroom that might help somebody :)
Learn Git!
Its a bit pain to learn, agreed! so is every other VCS out there. It will surely change the way you code forever, if you put some effort into learning it properly.
The basic idea of git is that you can get back to any version of your code at any time. It makes collaboration a breeze. It will tell you who added a line of code at what point of time. You commit when something works, add a decent commit message 1 2 to
help yourself later, and continue working. Before the next commit, look at the diff to see what you are going to commit, think again if that is exactly what you want to do and go on. Are you stuck with some nasty bugs? Revert to last known working version,
and continue your work in a fresh manner or stash your current changes for later review.
Read Git best practices. Its one of the most dense articles I have come across yet. It will surely reward you.
Here are a few tutorials I collected which might help.
White spaces are important.
The ideal way to fix this will be to use emacs smart tabs
People who find that difficult should at least use the whitespace highlight plugin with gedit. Here is a screen shot with white space plugin enabled.
Intent all your lines with either fixed amount of spaces alone, say 4 or with tabs alone. Tabs are better because they lead to smaller files and anybody can adjust tab widths to read it as per their convenience without actually editing the file. This makes
patches real patches and not just white space modifications. It makes the file consistent across platforms and editors.
I’m going a bit inclined here. Pick emacs, not vim.
There are infinite number of comparisons online. I’ll state my reason for picking emacs over vim. Vim is a modal editor and it suggests you stay in the normal mode by default. It makes moving around very easy and when you want to insert text, you type
get to insert mode and then type in the content.
I realized that this is not how “I” work with my code. Emacs is not a modal editor. You can insert text at all times. It uses control meta keys more efficiently and makes moving around and inserting text at the same time a breeze. I think I can beat a kickass
vim guy with my basic emacs skills.
Watch this video
Here are some good emacs videos to get started.
EmacsRocks
emacsmovies.org
PeepCode, if you can pay for it
If you prefer downloading videos for offline viewing, use wget for downloading all EmacsRocks episodes:)
Things I learned outside the classroom that might help somebody :)
1. Learn to version control your code.
Learn Git!Its a bit pain to learn, agreed! so is every other VCS out there. It will surely change the way you code forever, if you put some effort into learning it properly.
The basic idea of git is that you can get back to any version of your code at any time. It makes collaboration a breeze. It will tell you who added a line of code at what point of time. You commit when something works, add a decent commit message 1 2 to
help yourself later, and continue working. Before the next commit, look at the diff to see what you are going to commit, think again if that is exactly what you want to do and go on. Are you stuck with some nasty bugs? Revert to last known working version,
and continue your work in a fresh manner or stash your current changes for later review.
Read Git best practices. Its one of the most dense articles I have come across yet. It will surely reward you.
Here are a few tutorials I collected which might help.
2. Have some sane white space in your code.
White spaces are important.The ideal way to fix this will be to use emacs smart tabs
People who find that difficult should at least use the whitespace highlight plugin with gedit. Here is a screen shot with white space plugin enabled.
Intent all your lines with either fixed amount of spaces alone, say 4 or with tabs alone. Tabs are better because they lead to smaller files and anybody can adjust tab widths to read it as per their convenience without actually editing the file. This makes
patches real patches and not just white space modifications. It makes the file consistent across platforms and editors.
3. Pick a real programmers editor.
I’m going a bit inclined here. Pick emacs, not vim.There are infinite number of comparisons online. I’ll state my reason for picking emacs over vim. Vim is a modal editor and it suggests you stay in the normal mode by default. It makes moving around very easy and when you want to insert text, you type
ito
get to insert mode and then type in the content.
I realized that this is not how “I” work with my code. Emacs is not a modal editor. You can insert text at all times. It uses control meta keys more efficiently and makes moving around and inserting text at the same time a breeze. I think I can beat a kickass
vim guy with my basic emacs skills.
Watch this video
Here are some good emacs videos to get started.
EmacsRocks
emacsmovies.org
PeepCode, if you can pay for it
If you prefer downloading videos for offline viewing, use wget for downloading all EmacsRocks episodes:)
wget http://dl.dropbox.com/u/3615058/emacsrocks/emacs-rocks-{01..11}.mov?dl=1[/code]This is actually easier than it sounds. Pick some small application, interact with the community and fix issues which you can. I was able to fix some issues with gedit during my last vacation and I am working on more of it now. Also, I am porting the JavaScript
4. Contribute to a FOSS
code in gitweb to a standards compliant version using jQuery which was a proposed Google Summer of Code 2012 project. Hoping to get those patches accepted soon :P
Comments welcome :)
相关文章推荐
- Top 20 Programming Lessons I've Learned in 20 Years
- [cite]Top 20 Programming Lessons I've Learned in 20 Years
- Top 20 Programming Lessons I\'ve Learned in 20 Years
- 20/20: Top 20 Programming Lessons I've Learned in 20 Years
- [转]Top 20 Programming Lessons I've Learned in 20 Years
- Top 20 Programming Lessons I've Learned in 20 Years
- Show and Tell Lessons learned from the 2015 MSCOCO Image Captioning Challenge论文及tensorflow源码解读(2)
- 8 Management lessons learned from Apple
- Windows Azure Mobile Service - Data Sync lessons learned
- Improve Domain Name Security, Lessons Learned From Domain Name Hijacking
- Fayn J/ Can the lessons learned from the assessment of automated electrocardiogram analysis ...
- Lessons Learned from Developing a Data Product
- Lessons learned developing a practical large scale machine learning system
- Learned lessons from the largest player (Flickr, YouTube, Google, etc)
- Lessons learned while converting to Kotlin with Android Studio
- (转载)10 lessons I learned at Facebook
- 7 lessons I wish I learned before starting my first game internship
- Elasticsearch Mantanence Lessons Learned Today
- Lessons learned from 13 failed software products
- 7 lessons I wish I learned before starting my first game internship