http://weblogs.java.net/blog/bondolo/archive/2004/04/complexity.html

——————————————————————————————————————————————————————————

Complexity

Posted by bondolo on April 20, 2004 at 2:09 AM EDT

On April 21st the JXTA Community will turn three years old. The "terrible twos" weren't actually too terrible and the future of JXTA looks really, really exciting. The JXTA project has gone through a lot of changes over the last three years and it's been really interesting to see how the technology has evolved. The coolest part is, of course, that the path evolution has taken has been entirely unpredictable. I've decided to devote my first couple of blogs to some of the issues we've encountered in developing JXTA and perhaps there might be some insights for developing evolving technologies.

Complexity Is The Enemy

New users to JXTA often complain that it is too complex. I don't agree, but then again I am one of the primary JXTA authors. It is very possible that I am entirely biased. As a programmer I do often use other people's APIs and I do find some of them to be too complex. I have been doing a lot of security work lately with the Java JCE and often I swear (occasionally literally) that the Java JCE APIs are themselves encrypted!

Over the years I've encountered a number of APIs or libraries that left me befuddled on first exposure. In many cases I've needed to continue using APIs that had me stymied because my application needed the functionality. In some cases time and experience changed my opinions.

What could make JXTA or any technology complicated for new users? There are far too many possibilities:

  • Installation hell - You want to use the API or technology, but before you can begin you need to decipher the website and download the right installer, install component XYZ and set your classpath to ABC and so on. Since you are new to the technology you can't be certain that you have installed it correctly. Oh well, hope for the best and press on.
  • Configuration hell - It's not enough that I had trouble installing the technology, but now before using it you are required to configure it. What should I set MAX_THRESHOLD_INTERVAL to? How about CONTROL_PATH? Hmmm, I'm not yet even sure what these parameters are for let alone what values are permitted or what values should be used. Maybe I'll just stick with the defaults, hope for the best and press on.
  • Starting hell - The technology seems to be installed, I hope, and seems to be configured, I hope, so its time to start using it. Hmmm, what do I do to start it? No, that's not it. Ummm, well that sort of worked, but there are a couple of messages I don't understand. Maybe the configuration isn't correct or maybe I ran the wrong command.... perhaps the documentation will provide some insight.
  • Documentation hell - What? No manual! How about a FAQ or a Wiki? Hmmm... these entries seem all to be completely out of date. Or are they? This one says that in version 1.3 the database file must be in the home directory. I don't remember the installer mentioning a database file. Maybe I don't need one. Oh, there's an example. Hmmm, it's just "Hello World" and doesn't actually do anything. Oh, and it doesn't even run. Maybe I will look at the Javadocs. Ick! Most methods are missing all docs. None of the methods specify the behaviour or performance characteristics. Oh this is wretched.
  • API hell - I sort of mentioned this one in the last blog and I'll mention it again in my next blog. When you start working with a new technology you are confronted with a vast seemingly featureless wall of API calls. Which ones do you start with? Are some preferred to others? How do I create a sub-class for a class that has 200 methods? (I recently had to make my first Swing component, a sub-class of JComboBox. I may one day recover from the experience). Perhaps most importantly, how do I begin architecting an application out of 80 classes and 500 methods that I have never used?
  • More hells - The preceding were only a sample.... yes, sadly, only a sample. A truly devious technology could add support hell (in which all pleas for help go unanswered and you can find no-one to ask your questions), web hell (in which you are flooded by millions of pages of generic material all of which is obsolete), reliability hell (in which things only sometimes work and you never know why) and so on infinitely.

There are clearly a lot of hells in which the the poor developer can find themselves. Even Dante would probably have difficulty coming up with descriptions and purposes for all of them. And yet, software does get written. There are must be coping strategies for dealing with the complexity which abounds.

Scaling the wall

Different people attack a new complex technology using different approaches. Some people prefer to start with a working sample program and then radically refactor it step by step until it becomes their application. Other people insist on reading an entire book or a whole lot of web sites to gain perspective and broader understanding before starting. Still others will write a number of small test programs to develop an understanding.

My personal approach is more about finding out how the functionality behaves rather than just getting the syntax right. I'll run a program from the first moment it compiles just to see how it breaks or so that I can single step through it in the debugger. Once I think I understand how things work together I can usually make progress.

Easy is hard, hard is easy

There has been a lot of discussion lately about the usability of open source software. See ESR's The Luxury of Ignorance : An Open-Source Horror Story and an article I liked responding to ESR's article Ronco Spray-on Usability. A lot of the summary is that while most open source software isn't actually bad the authors do not seem to have spent a lot of effort on keeping it simple. A number of times the equation "If I can write five features that only one person can use in the time it takes me to write one feature everyone can use why would I penalize that one person?" seems to come up in the discussion. This is a total fallacy of course in that the maximum value of one person times five features is always five whereas the maximum value of one features times everyone is infinite. The equation is right in one thing, there may be a cost in quantity of features in order to achieve quality of features.

It's your problem too

In order for a product or technology to be successful the developers must provide some form of support. What obligations does a technology user have? When does it cease to be solely the original developers fault that a technology is too complex and start to become a shared shame?

First off, if you start working with a new open source technology plan right from the start to become a contributor. You are beginging the process of becoming an expert on the technology as a result of your using it. Given time you will find many ways, perhaps small at first, to improve the technology. On one project to which I have contributed to my entire contribution is a single word, "relative". However, it's carefully placed and makes the usage of a key API much more obvious.

Second, whether the project is open source or not, submit bugs. Something wrong or not clear? Submit a bug. If it seems after six months that the bugs are simply going into a black hole then perhaps you can stop (this will also be a good sign that its time to consider an alternate technology). Good projects respond to bugs.

Third, share your "Eureka" moments. People who have been using a technology for while usually forget what was hard for them when they started using the technology. If you suddenly say "A-ha", then share your realization. It may be the crucial insight some other struggling fellow user is missing. Or it may remind one of the "pros" of something that could be more clear. Or, and it does happen even for very mature technologies, it may be an insight that has never occurred to anyone else before. There's a great article on the history of the "ping" command in which the author admits to being very jealous of a user who figured out how to do something he (the expert and author) hadn't considered.

Fourth, take the time to share your knowledge, but also make it better for everyone. If there's a forum or mailing list you are reading to assist with your understanding then be sure to contribute back to it. Better yet, add your answer to the FAQ or the wiki. If the answer points to a needed improvement in the technology, then file a bug too. Best yet, submit a patch which makes the problem never re-occur.

Fifth, be an expert. Your experience extends beyond the single technology in question. Undoubtably your perspective on the technology and its' relationship to other technologies is unique and that's valuable. Take the opportunity to pontificate (a blog perhaps?) and share your opinion.

转载于:https://www.cnblogs.com/cuizhf/archive/2011/10/24/2222291.html

Complexity相关推荐

  1. Foundations of Machine Learning: Rademacher complexity and VC-Dimension(2)

    Foundations of Machine Learning: Rademacher complexity and VC-Dimension(2) Foundations of Machine Le ...

  2. 什么是空间复杂度(What is actually Space Complexity ?)

    属于空间复杂度(Space Complexity)在很多情况下被错认为是附属空间(Auxiliary Space),下面是附属空间和空间复杂度的定义. 附属空间(Auxiliary Space)是算法 ...

  3. 如何计算并测量ABAP及Java代码的环复杂度Cyclomatic complexity

    代码的环复杂度(Cyclomatic complexity,有的地方又翻译成圈复杂度)是一种代码复杂度的衡量标准,在1976年由Thomas J. McCabe, Sr. 提出. 在软件测试的概念里, ...

  4. 【LE AUDIO】LC3 - Low Complexity Communication Codec

    [未完成,先提交后面再改...有兴趣可以先参考我上传的文档 LC3_Spec_v1.0] [刚刚上传了从 Spec v5.2 整理的 LE_Audio 相关知识框架,就当是 Spec 读后感吧... ...

  5. Handling Complexity in the Halo 2 AI

    原文:http://www.gamasutra.com/view/feature/130663/gdc_2005_proceeding_handling_.php Developers of game ...

  6. 5328笔记 Advanced ML Chapter3-Hypothesis Complexity and Generalisation

    预先定义的假设类:我们假设是最好的模型 Predefined hypothesis class 机器学习的本质就是找x到y的映射函数h.h就是我们说的模型.H就是所有映射方式的集合. Pretrain ...

  7. chapter8 Pull Complexity Downwards

    Pull Complexity Downwards 这章主要讨论如何创建一个更深的类 例子:配置参数 接口提供一些会控制接口行为的参数,比如缓存的大小或者是请求重试的次数. 接口的使用者必须提供参数合 ...

  8. Refactor this method to reduce its Cognitive Complexity from 65 to the 15 allowed. [+22 locations]

    Sonar常见问题及修改建议(201912):Sonar常见问题及修改建议2021(持续更新!!) Refactor this method to reduce its Cognitive Compl ...

  9. Cognitive Complexity of methods should not be too high Refactor this method to reduce its Cognitive

    1.问题 Cognitive Complexity of methods should not be too high Refactor this method to reduce its Cogni ...

  10. [Paper Summary] Evaluating repres. by the complexity of learning low-loss predictors [Whitney 2020]

    Evaluating representations by the complexity of learning low-loss predictors [Whitney 2020] tl;dr Pr ...

最新文章

  1. linux基础篇-02,linux时间管理date hwclock cal 简述
  2. TP-link 设置MAC地址过滤
  3. ajax中的让渡,jQuery必须掌握的API
  4. 【文章】论文写作知识积累
  5. 自定义异常时exception is never thrown in the corresponding try block和unhandled exception
  6. 多个线程访问统一对象的不同方法_不会多线程还想进BAT?精选19道多线程面试题,有答案边看边学...
  7. msf各种弱口令爆破
  8. HIS系统两种收费模式比较:前计费和后计费
  9. gcc编译的几个重要参数
  10. 关于configure: error: no acceptable C compiler found in $PATH
  11. springboot图书管理怎么实现借书时间到期提醒_东和店镇第一小学图书数字化管理先进做法...
  12. win7 64位系统PSD缩略图补丁
  13. ong拼音汉字_儿童拼音汉字入门
  14. 计算机 无法自检,电脑开机不能自检的五大原因
  15. 3.2Abstraction data type
  16. 提高工作效率的工具[分享]
  17. php qq登陆网站实例代码,QQ登陆网站实例代码
  18. ping命令的基本格式
  19. nginx的rewrite中last和break 及 permanent和redirect的介绍
  20. 加入立人图书馆的十本必读书

热门文章

  1. java实现人机猜拳小游戏
  2. iPad娱乐之----最新电影下载!
  3. 6-1 邻接矩阵存储图的深度优先遍历 (20 分)(C语言版)
  4. linux中bash有错导致insmod,linux insmod error ko文件
  5. 重写与重载的区别与作用
  6. CSS---rem用法
  7. 交通学习网,自动播放,自动下页,自动下一章,c1驾照使用
  8. 5G时代:连接和计算无处不在数据释放价值
  9. 性能测试基本概念之什么是吞吐量
  10. mysql创建视图,动态传入参数