6 ms·
This is a classic academia-ish take. Consume a bunch of theory and regurgitate whatever you've read. Better way to learn is making stuff with the language, hav
by oreally 5y ago
This is a classic academia-ish take. Consume a bunch of theory and regurgitate whatever you've read.
Better way to learn is making stuff with the language, having actual skin in the game. Only then bounce back to theory on the more nuanced stuff.
- luigi23 5y agoThis is a classic hacker/builder take. Start scratching your own itch and make many apps. /s To be frank I have the same mindset, but it's good to read other people takes on it. Some prefer to have basic knowledge and feel great anxiety when they're jumping to code without any foundation.
- matheusmoreira 5y agoStandard libraries are very concrete, not academic at all. Learning the standard library means learning how to open a network connection and making an HTTP request to some server. The language becomes useful and gives results immediately. Theory means stuff like language concurrency models, it becomes important once you start considering how to structure the code at a high level. How do I use this language to handle X requests concurrently, hopefully in parallel?
- powersnail 5y agoThat highly depends on which language and standard library you are talking about. Reading C++ standard library gives you headache, and doesn't really teach you how to write C++ in a normal application. For a beginner, this is an impossible approach. Reading Python standard library means reading C half of the time. Useful for some seasoned Python developers, but not for new comers who want to read Python. At the end of the day, standard libraries aren't written to teach, and some being a good teacher is a coincident. When you are learning a new language, you really have no idea whether the standard library is a good source for beginners. I'd suggest a less poetic, more pragmatic approach to learning a new language: ask the most active forum of the language, and use the most common learning materials.
- themodelplumber 5y agoBetter really depends on who you are. Born academics can learn better by reading foundation libraries and principles, and they write articles advising others to do the same :-) What you described as better could be a really good fit for business-first coding opportunists who would get annoyed by perceived inefficiencies and petty politics in academia... The article is a terrific example of basic analysis BTW. This underappreciated skill can be a huge blindspot for opportunists...
- oreally 5y agoNo, even academia and pure theorists could take a fresh perspective with actual skin in the game in making software. > The article is a terrific example of basic analysis BTW. Hahaha. It's some cherry picked examples and you're already claiming it's 'a terrific example of basic analysis'. The hyperbole is real in software.
- themodelplumber 5y agoCherry picking is 100% compatible with analysis, which is closed subjective logic, not open opportunistic logic. Plus I don't think the author is exactly trying to go head to head with your personal favorite method. Could be wrong though.
- johnnycerberus 5y agoReminds me of Nassim Taleb's works. Reading and rereading the standard library is a good way to learn a language or get depth. I don't see how reading an actual implementation can be considered academic, as it is real-life engineering. It is not pseudocode or theory, some algorithms in Java and C++ are using some ugly shortcuts that only an engineer would find interesting while an academic would think it's heresy.
- Fellshard 5y agoI don't think this is a good read. A standard library is very concrete - it's the core of the language in action, and the shape that its code takes will likely be repeated regularly in 3rd party code written in that language. There's nothing academic or abstract about it. EDIT: As others note, a good chunk of a stdlib may involve system interop that isn't representative, so that tempers my comment with regards to whether that code is idiomatic. But my case still stands regarding concrete vs. abstract.
- Kranar 5y agoHere is a basic structure implemented in C++: https://github.com/llvm-mirror/libcxx/blob/master/include/vector https://github.com/llvm-mirror/libcxx/blob/master/include/ve... I would not recommend anyone ever look through that as a way to learn C++. Heck just something as basic as a struct that stores two member variables is a 200 line of code horror show in C++: https://github.com/llvm-mirror/libcxx/blob/78d6a7767ed57b50122a161b91f59f19c9bd0d19/include/utility#L297 https://github.com/llvm-mirror/libcxx/blob/78d6a7767ed57b501...
- tsimionescu 5y agoWell, that's still instructive about how library code that aims to be efficient and portable has to look in C++. It's not representative of most application / business layer code, and it's definitely not good learning material. But, if choosing C++, at some point you will have to write code like that as a project matures and must target different compiler versions and platforms.
- Kranar 5y agoNo, at no point should you use the standard library to understand how to write C++ code. The standard library has a specific clause in the C++ standard that exempts it from rules about undefined behavior. For example, that link I pasted to implement a std::vector is not something that is permissible to use by non-standard library code, it is full of undefined behavior that is permissible for use by the standard library but not permissible for use by ordinary code. To the extent that one can learn how to write cross-platform efficient and generic C++ code, there is always a better example to learn from than the standard library.