Will I learn more from changing other people’s code? [closed]

I am currently trying to break through the intermediate coder stage to advanced and needless to say it’s been tough.

I have been working through several books with example code. I have felt lately that taking the example code, changing it to fit my own similar project, breaking it, and fixing it, is more effective for learning than simply re-coding line after line of example work.

Does anyone else similar or contrasting opinions? Will this method pay off in the long term?

Thoughts on this method of learning?

Thanks!

2

I think you need a proper project: Find a problem to be solved, and solve it.

Doing something real (rather than hacking examples) will drill into your head all kinds of lessons: things that you have been taught that are good, things that don’t work so well.

The biggest difficulty in a real project is not so much writing code, its knowing what code to write. That is, how to break up and structure the problem space. Get that wrong and the nicest code in the world is still a lousy solution.

1

Reading other peoples code all the time is a sure shot way of improving your skills on the project. No doubt about it.

It also helps to be the dumbest guy in the team – by that I mean to say that if all the other programmers in the team are way above you in terms of programming skills it will automatically lift your level too – as long as you have the maturity to accept your limitations and ask for help. So leveraging skills of other team-mates is also important.

Reading code – apart from reading other people’s code and asking them to explain their approach, pair programming is another good tool. Just sitting with a peer and observing their way of tackling a problem can set off light bulbs in you. Also make it a habit to always review your own code – old code from time to time. I recall many times when I have visited a 100+ lines of code I wrote myself 2 months back and thought it was shit and refactored it much better.

1

I think the most important aspect of learning is failure. When you attempt to adapt example code or implement something new and it doesn’t work, you have to figure out why it doesn’t work.

This is when your brain will be put to work attempting to solve the problem you have come across. And when you finally have that ‘aha!’ moment, what you have learned from the initial failure will stick in your mind.

It’s this process that is vital to becoming a better programmer. Good programmers are good at figuring out how systems work, why they don’t do what they should and how to fix them. And the only way to get good at this is to practice solving problems when something fails to work.

If you do nothing but copy code from a book and run it it will always work (assuming no typos by yourself or the book) and you miss out on the vital experience of figuring stuff out for yourself.

1

I guess both are useful, but your coding on your own will be better.. Other’s code will help, you will get to learn some things you couldn’t have thought of but at that transition, it’s how you think that matters.

It would be better if you take a few problems and solve them. Use other People’s help when there are any problems that you can’t get around. That way you will learn a lot more than by fiddling around with other’s code.

When doing it all from scratch, you can understand every little thing of the code. Also, you will also learn from your mistakes(everyone makes them, and so will you).

When you type code, it’s usually not what you type, but how you think of what to type, the logical analysis of the problem (and the inference/derivation of the solution) is what matters.

Absolute majority of programming work is done in a team and involves code base that already exists for some time and needs to be continuously adjusted for new requirements and features. You won’t ever learn that from text book, you have to try it.

Working with other people’s code is also great way to get experience how various idioms work in practice. You won’t normally try to solve problem in all possible ways to see which one works better and you won’t come up with that many ways yourself anyway. By reading existing code you will see various approaches to solving problems and learn what advantages which has in practice, so you can easily pick one when you need to design something yourself.

Lately there are many open source projects out there, so it should be easy to pick one that is interesting for you and contribute to it. You can start by fixing bugs or doing some small feature you think of. That’s currently easiest way to get experience with some real programming work. You can even get grant for it from Google.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật