5 ms·
Big step, congratulations to everyone who worked on it. When I get some more time I need to look into the code in those projects. It's too bad that they chose t
by Locke1689 17y ago
Big step, congratulations to everyone who worked on it. When I get some more time I need to look into the code in those projects. It's too bad that they chose to use C++ (as opposed to C) to implement it though (yech, personal preference).
- yan 17y agoTheir C++ is amazing though. Exceptionally clean and well-designed.
- capablanca 17y agoHow can you tell? Did you work on it for a few months or you can just browse the SVN and notice it's well designed? I look and all I see at first is indentation style and directory organization.
- jey 17y agoBy studying the code? If all you noticed from seriously looking through the source is that it is well indented and well organized, you're probably not an experienced enough C++ programmer to evaluate the merits (no offense intended).
- capablanca 17y agoIndeed... So by clean you mean looking for usages of certain C++ features that should be avoided? How can you "infer" the design only by looking at a pile of C++?
- pohl 17y agoOne probably couldn't by merely looking at it. Reading it with the specific intent to understand it, on the other hand, can make design intent pretty clear. (One would hope that the structure of the program is at least homomorphic to the intended design, if not isomorphic.)
- jey 17y agoIt's truly excellently written C++ code, and they don't go nuts with fancy C++ voodoo template meta-trans-factory-programming tricks or whatnot. And have you seen what happens when you write a huge compiler in C? This: http://gcc.gnu.org/wiki/reload http://gcc.gnu.org/wiki/reload And I don't think you can reasonably argue that GCC's hackers are sub-par either. ;-) Language features for abstraction and encapsulation are pretty important for something that huge.
- krakensden 17y agoI'd argue that there is an age factor at play- GCC is older, designed under different (ie, much more stringent with regards to resources) constraints. GCC also has a perennial problem attracting and managing developers, which LLVM seems to have avoided.
- jey 17y agoIt's really not the age or resources that hamper it (from experience hacking it). Well, OK, the age does matter -- but only because it's C. It wouldn't have been so bad if they didn't have to reinvent basic things. GCC has its own garbage collector, a set of bizzare hacks to replace inheritance, amongst other atrocities. None of these have to do with resource constraints, and nearly all have to do with the low-level nature of C.
- beza1e1 17y agoI'm hacking on a compiler written in C, which isn't worse than LLVM: http://libfirm.org http://libfirm.org
- sreque 17y agoAfter doing application-level programming in C for a while at a job, I learned to re-appreciate some of the abstractions that C++ gives you that you have to code by hand in C. Once you get used to the ridiculous compile errors and slow compilation times, isn't it nice to have access to a built-in string library and efficient data structures? To not have to roll your own implementation of a v-table and inheritance if you want OO? To be able to do compile-time generic programming where the compiler can more easily do things like function inlining? I'm no longer certain which I consider is the better language to code in overall. I've heard the C++ hate from Yossi Kreinin, Linus Torvalds, Steve Yegge, and other high profile people, and I've experienced the pain and misery of trying to understand and use its more complex features myself, but in the end, for most applications are you really better off sticking with C than using a "tasteful subset of C++" like the LLVM team does?
- ighost 17y agoI wish someone would publish this "tasteful subset of C++," kind of like Douglas Crockford's Javascript: The Good Parts. Then I could just learn that and skip all the crazy template shit.
- mullr 17y agoThey did, and it's called "Effective C++". Okay, it's not exactly the same thing. But they both tell you what NOT to do.
- haberman 17y agoCheck out the Google C++ Style Guide. I'm biased (being a Googler), but I think it leads to pretty nice and readable C++: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml http://google-styleguide.googlecode.com/svn/trunk/cppguide.x...
- Locke1689 17y agoThis is fantastic. My main gripe with C++ in non-system code is that there are too many features which complicate the code base and should never be used. This seems like great guidelines and a good subset.
- jpcx01 17y agoI've always hated C++ as a language syntax, but I'm coming around. rubinus, llvm, and mongo all use it and their codebases are really well built. So maybe the language isnt so bad after all, as long as you have geniuses using it.
- jlangenauer 17y agoIt's not so much about having geniuses coding in it, it that when you do use it, you use it to make conceptually elegant code. When I work in C++, I simply do not use templates, because I find the make the code impossible to grok - the complexity can overwhelm you (let alone a new developer unfamiliar with a given C++ code base). Treat C++ like Ruby, and try to use it to make beautiful, and elegant code. That's where it shine, IMHO.