惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
News and Events Feed by Topic
GbyAI
GbyAI
博客园 - Franky
宝玉的分享
宝玉的分享
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
人人都是产品经理
人人都是产品经理
Microsoft Azure Blog
Microsoft Azure Blog
The Register - Security
The Register - Security
腾讯CDC
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
I
InfoQ
The Cloudflare Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Engineering at Meta
Engineering at Meta
MongoDB | Blog
MongoDB | Blog
有赞技术团队
有赞技术团队
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
F
Full Disclosure
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Vercel News
Vercel News
博客园 - 【当耐特】
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Schneier on Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Project Zero
Project Zero
量子位
M
MIT News - Artificial intelligence
Stack Overflow Blog
Stack Overflow Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
美团技术团队
Attack and Defense Labs
Attack and Defense Labs
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Blog of Author Tim Ferriss
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Troy Hunt's Blog
Google Online Security Blog
Google Online Security Blog
罗磊的独立博客
P
Proofpoint News Feed
Schneier on Security
Schneier on Security
Spread Privacy
Spread Privacy
S
SegmentFault 最新的问题
L
LINUX DO - 最新话题
Simon Willison's Weblog
Simon Willison's Weblog
爱范儿
爱范儿
博客园 - 聂微东
A
About on SuperTechFans
PCI Perspectives
PCI Perspectives
D
Docker

Henri Sivonen’s pages

Parin vuoden tutkimattomuus crates.io: Rust Package Registry Asiakirjatonta toimintaa It’s not wrong that "🤦🏼‍♂️".length == 7 Koulutartuntojen tilastointimenettely Perusteasiakirjoja hallussapitämättä ikärajoitettu Asiantuntijat ja nukkuva vallan vahtikoira Koronapassilausunto Suppealla tietopohjalla ohimeneväksi väitetty Text Encoding Menu in 2021 The Text Encoding Submenu Is Gone An HTML5 Conformance Checker Not Part of the Technology Stack Browser Technology Stack Bogo-XML Declaration Returns to Gecko A Look at Encoding Detection and Encoding Menu Telemetry from Firefox 86 Why Supporting Unlabeled UTF-8 in HTML on the Web Would Be Problematic Rust Target Names Aren’t Passed to LLVM Toimintamalli Activating Browser Modes with Doctype Johtopäätöksiä mallin rakenteesta Tehtävänmäärittelyä kirjoittamatta ja kuolemia laskematta laumasuojamallinnettu Character Encoding Menu in 2014 Erillissuosituksen tarpeettomuudesta yleissuosituksen poikkeukseksi? STM:n maskiaikajana Rust 2021 Oma-aloitteisesti mallinnettu Kokopinovaatimuksin kilpailutettu chardetng: A More Compact Character Encoding Detector for the Legacy Web Varauksia paisutellen tiedotettu Perusteasiakirjoitta tiedotettu Always Use UTF-8 & Always Label Your HTML Saying So IME Smoke Testing The Validator.nu HTML Parser About the Hiragino Fonts with CSS It’s Time to Stop Adding New Features for Non-Unicode Execution Encodings in C++ Rust 2020 The Last of the Parsing Quirks About about:blank Rust 2019 a Web-Compatible Character Encoding Library in Rust How I Wrote a Modern C++ Library in Rust Using cargo-fuzz to Transfer Code Review of Simple Safe Code to Complex Code that Uses unsafe A Rust Crate that Also Quacks Like a Modern C++ Library #Rust2018 No Namespaces in JSON, Please A Lecture about HTML5 Julkisesti luotettu varmenne ikidomainille TLS:ää (SSL:ää) varten -webkit-HTML5 Lists in Attribute Values The Sad Story of PNG Gamma “Correction” If You Want Software Freedom on Phones, You Should Work on Firefox OS, Custom Hardware and Web App Self-Hostablility HTML5 Parser Improvements ARIA in HTML5 Integration: Document Conformance (Draft, Take Two) Schema.org and Pre-Existing Communities Lowering memory requirements by replacing Schematron HTML5 Parsing in Gecko: A Build Introducing SAX Tree NVDL Support in Validator.nu HOWTO Avoid Being Called a Bozo When Producing XML An Unofficial Q&A about the Discontinuation of the XHTML2 WG Thoughts on HTML5 Becoming a W3C Recommendation Four Finnish Banks Training Users to Give Banking Credentials to Another Site Unimpressed by Leopard Sergeant Semantics The Content Sink Inheritance Diagram – 2006-06-30 What is EME? About Points and Pixels as Units The Performance Cost of the HTML Tree Builder Social Media Impression Management The spacer Element Is Gone Openmind 2006 Performance Mistake XHTML and Mobile Devices WebM-Enabled Browser Usage Share Exceeds H.264-Enabled Browser Usage Share on Desktop (in StatCounter Numbers) HTML5 Parser-Based View Source Syntax Highlighting Vendor Prefixes Are Hurting the Web Accept-Charset Is No More Dualroids Writing Structural Stylable Document in Mozilla Editor ISO-8859-15 on haitallinen Hourglass The Scientific Method According to Hixie Maemo Source Code Karpelan lukkovertaus ontuu Digitaalisesta arkistoinnista ARIA in HTML5 Integration: Document Conformance (Draft) XHTML—What’s the Point? (Draft, incomplete) Mac OS X Browser Comparison HOWTO Spot a Wannabe Web Standards Advocate An Idea About Intermediate Language Trees and Web UI Generation Thoughts on Using SSL/TLS Certificates as the Solution to Phishing Bureaucracy Meets the Web Europe Day HOWTO Establish a 100% Literacy Rate What to Do with All These Photos? Charmod Norm Checking Validator Web Service Interface Ideas DTDs Don’t Work on the Web EFFI’s Day in Court
Eclipse CDT – 2006-06-27
Henri Sivonen · 2011-12-22 · via Henri Sivonen’s pages

After working in TextWrangler (and a bit in XCode) for a couple of weeks, I really started to miss Eclipse. So I installed CDT. After almost two weeks, I am not satisfied. In fact, I am disappointed.

On the Goodness of Eclipse

Before 2003, I had written Java in BBEdit Lite, (X)Emacs and Project Builder. I hadn’t seen anything better. In 2003, I was introduced to NetBeans. The moment was epiphanic. Later that year, I tried Eclipse. First, I could not use it, due to CVS problems, but after the CVS issues were resolved, it was obvious that it was even better than NetBeans (well, at the time, at least).

The Eclipse JDT is extremely powerful and has improved my Java productivity immensely. It seems weird that in the old days, I wrote Java without Eclipse. Now writing Java without Eclipse seems unbearable. The interesting thing with Eclipse is that it makes Java development so great that in some cases, it is easier to attack problems in Java even though in terms of languages Python might be more suitable. Though Java is terribly verbose for writing in a text editor, with JDT’s autocompletion and templates, writing Java in Eclipse may take less work than writing Python in TextWrangler.

Much of JDT’s coolness derives from the integration of the compiler with the editor. The integration of the compiler front-end in the editor makes context-aware errors messages and autocomplete possible. It also makes smart refactoring—full with liveness analysis of variables, etc.—possible. And it enables smart search that is based on static analysis of the code (what code calls what, etc.). And it works great! Moreover, running the compiler back end in the background while editing cuts away the time of waiting for builds. When you want to launch, the classes are already there.

But while NetBeans is a Java IDE, Eclipse is more like the Emacs of the new millennium. So far, everything worth developer attention had to have an Emacs mode. Now, everything worth developer attention should have an Eclipse plug-in. For example, I use TeXlipse for my BibTeX and LaTeX needs.

My Expectations

I was expecting to get the Eclipse experience with C++. I was expecting the IDE to fulfill the function of LXR. A couple of years ago when I was modifying a large Java app written by others, a big part of my productivity was thanks to the code comprehension features of JDT. I was also expecting CDT to provide a working gdb front-end. I was expecting to get error markers in margins. I was also expecting some refactoring support albeit not as good as with Java.

On the Brokenness of CDT

  • CDT is way too eager to do full builds. I fooled it to doing incremental builds when it thinks it is doing full ones. That’s probably the wrong way to curb full builds, but I had to do something.

  • XCode can debug Firefox just fine through gdb. Eclipse cannot. Firefox behaves badly on launch. It relaunches itself. Eclipse can’t connect to the process after the relaunch.

  • Eclipse wants to rebuild when launching a debug target. I can’t figure out how to prevent it without breaking the ability to build in general.

  • JDT takes away most of the pain caused by deep Java package directory hierarchies. No such luck with CDT and the Mozilla module directory structure.

  • The indexer is slow. (Improvement coming, though.)

  • The identifier search is slow. (Why isn’t it as fast as on the JDT side once the index is built?)

  • Even an incremental build pokes everything in the whole source tree. CDT isn’t smart about the Mozilla make hierarchy, so it can’t use the knowledge of which source files changed.

  • Moreover, the build involves make and gcc instead of a compiler integrated in the editor.

  • The refactor menu is sad compared to JDT.

  • Autocomplete is so horrendously slow (SBBoD for one minute upon each invocation) that it cannot be used.

  • Can’t figure out how to make tab insert two spaces!

In fairness, most of the brokenness of CDT results directly from the brokenness of C++. C++ has all kinds of pathologies that make sane IDE support really hard.

  • The C++ compiler would be totally lost on its own, so it needs make sitting in front of it and hand-holding it through the build moving the compiler further from the IDE.

  • C++ separates declarations in header files, but there can be definitions in headers and declarations in non-headers.

  • C++ has a preprocessor, which can do things that e.g. cause identifiers not to appear as whole strings in the source files. Also conditional compilation means that it is hard to figure out whether a given line participates in the program.

  • C++ has templates, which can make it hard to track what is going on.

  • Mozilla has additional complications like generating headers from IDL.

  • Even though there is a standard, compiler-specific subsetting of the standard is important enough that you can’t trivially substitute compilers.

Solving the Problems in Theory

It seems to me that solving some of the key problems would be a huge undertaking. First, CDT would need to implement GNU make–compatible functionality so that it could drive the build itself and learn the dependencies from makefiles in order to build in smart increments. Second, to support quick error reporting, smart autocomplete and refactoring, CDT would need to have a full C++ compiler front-end integrated into the editor. Developing such a thing would be even more difficult that developing a standalone non-interactive C++ compiler front-end.

If that could be pulled off, throwing in non-optimizing compiler back-ends for key platforms wouldn’t be such a big deal.

Anyway, getting CDT on par with JDT is not a small task.

Conclusion

The only thing that I expected and that worked was putting the error marker in the margin. And even that involved running make, which is slow with Mozilla.

I am rather disappointed and have spent too much time on this tool. Still, I think that CDT is the best candidate for a sane C++ IDE and, with time, it may get better. Unfortunately, so many important pieces of software are written in C++ that it is futile to wish the problem (C++) away.