Programming lessons I learned
来源:互联网 发布:神经网络算法代码实现 编辑:程序博客网 时间:2024/04/29 19:52
摘自:http://jaseemabid.github.com/07-26-2026/programming-lessons-learned.html
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 i
to 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
4. Contribute to a FOSS
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 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 :)
- Programming lessons I learned
- 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
- [cite]Top 20 Programming Lessons I've Learned in 20 Years
- 20/20: Top 20 Programming Lessons I've Learned in 20 Years
- 10 life lessons I have learned in last few years
- Windows Auth - lessons learned
- 7 lessons I wish I learned before starting my first game internship
- 7 lessons I wish I learned before starting my first game internship
- Software Development Lessons Learned from Poker
- Cases on Information Technology: Lessons Learned
- 8 Management lessons learned from Apple
- Lessons learned from c/c++ defects
- Enum Lesson I Learned
- Lessons learned in the project of victory football
- Learned lessons from the largest player (Flickr, YouTube, Google, etc)
- Improve Domain Name Security, Lessons Learned From Domain Name Hijacking
- JSP中配置Oracle以及oracle.jdbc.driver.OracleDriver No suitable driver解决办法
- C/C++的参数传递
- Xilinx FPGA开发工具链各自特点 2012_7_28
- Unity 中的数学知识
- 针对win 7系统中matlab安装后出现的小错误解决办法
- Programming lessons I learned
- linux系统下设置用户权限
- Linux学习笔记(二十一)
- 关于Java串口通信
- Unity 在JS中间隔时间调用方法
- 基於Aforge的物體運動識別-入門篇
- 关于java读写速度的考证
- telnet 服务
- Unity GUI基础知识。。。。。