最近Stack Overflow上有一群讨厌perl的人,所以我想我应该把我的“关于你最喜欢的语言你讨厌的五件事”的问题带到Stack Overflow上。拿你最喜欢的语言来说,告诉我你讨厌它的五件事。这些可能只是让你烦恼的事情,承认的设计缺陷,公认的性能问题,或任何其他类别。你只需要讨厌它,它必须是你最喜欢的语言。

不要拿它和其他语言比较,也不要谈论你已经讨厌的语言。不要用你最喜欢的语言谈论你喜欢的事情。我只是想听到你讨厌但能容忍的东西,这样你就可以使用所有其他的东西,我想听到你希望别人使用的语言。

每当有人试图把他们最喜欢的语言强加给我时,我就会问这个问题,有时是面试问题。如果有人找不出他最喜欢的工具的5个缺点,那他对它还不够了解,不能提倡它,也不能利用它赚大钱。他还没有在足够多的不同情况下使用它来充分探索它。他把它作为一种文化或宗教来倡导,这意味着如果我不选择他最喜欢的技术,我就错了。

我不在乎你用什么语言。不想使用特定的语言?那就不要。你通过尽职调查做出了明智的选择,但仍然没有使用它?好吧。有时正确的答案是“你有一个强大的编程团队,有良好的实践和丰富的Bar经验。改成Foo是愚蠢的。”


This is a good question for code reviews too. People who really know a codebase will have all sorts of suggestions for it, and those who don't know it so well have non-specific complaints. I ask things like "If you could start over on this project, what would you do differently?" In this fantasy land, users and programmers get to complain about anything and everything they don't like. "I want a better interface", "I want to separate the model from the view", "I'd use this module instead of this other one", "I'd rename this set of methods", or whatever they really don't like about the current situation. That's how I get a handle on how much a particular developer knows about the codebase. It's also a clue about how much of the programmer's ego is tied up in what he's telling me.

憎恨并不是衡量人们了解多少的唯一尺度,但我发现它是一个相当不错的尺度。他们讨厌的事情也让我知道他们对这个话题的思考有多好。


c# / .net:

Classes should be sealed by default There should be no lock statement - instead, you should have specific locking objects, and there should be methods such as Acquire which return disposable lock tokens. Corollary: there shouldn't be a monitor for every object. GetHashCode() and Equals() shouldn't be in System.Object - not everything's suitable for hashing. Instead, have an IdentityComparer which does the same thing, and keep the IComparer<T>, IComparable<T>, IEqualityComparer<T> and IEquatable<T> interfaces for custom comparisons. Poor support for immutability Poor way of discovering extension methods - it should be a much more conscious decision than just the fact that I'm using a namespace.

这些都是我想出来的,明天问我,我会想出一个不同的5个:)


我的常用语言是爪哇语。这就是我讨厌它的地方:

5)。缺少指针 4)。异常捕捉 3)。布尔类型 2)。BigDecimal类型 1)。c#爱好者和Java爱好者

布尔值可以为空。我觉得这是违反直觉的。

BigDecimal是一个库,而不是一个语言特性。我对BigDecimal和Exception捕获的烦恼主要源于编写测试类,这些测试类必须跳过一堆箍才能完成实际工作。我应该澄清一下,我对这些事情很恼火,我不打算游说改变。


C++

模板的语法 钻石传承问题 现代语言所拥有的标准库过多/缺乏(尽管boost也很接近)。 iostream IOStreams周围使用的语法

Python

空格是有意义的(有时) 强调关键词 有限的线程支持(至少目前) 用self代替this 空格是有意义的(有时)


Python:

Too slow! list operations don't return the list, so you can't do list.append(4).append(5). (I mean a reference to the same list, not a copy). This is a minor gripe; it's only come up a few times. statements don't return values (if, print, while, for, etc). This is only a problem when dealing with lambdas. lambdas can only be one expression. There's no real need for this restriction, as they are equivalent to functions in every other way. What if I want a button press event which calls two functions? I'd need to create a named function to supply that functionality to an action listener, while doing "lambda: f1(); f2()" would not hurt. you can only put standard a-zA-Z_0-9 as names. Having functions like "true?" and "+" would be great. Of course, this could lead to terrible obfuscation, but I'm not saying we immediately rename all functions to "p@$%3". Which do you find clearer to read: "dec2bin" or "dec->bin"? ("store_results" or "storeResults") or "store-results"?


C

字符串操作。

必须手动处理字符串缓冲区是一个容易出错的痛苦。由于如此多的计算实际上是移动和修改字符串(计算机并不像人们想象的那样用于大型数字运算),因此能够使用托管语言或c++的字符串对象来处理这些非常好。当我必须在直发C时,感觉就像在流沙中游泳。


以下是我不喜欢Java的一些地方(它不是我最喜欢的语言):

Generics type erasure (i.e. no reified generics) Inability to catch multiple exceptions (of different types) in a single catch block Lack of destructors (finalize() is a very poor substitute) No support for closures or treating functions as data (anonymous inner classes are a very verbose substitute) Checked exceptions in general, or more specifically, making unrecoverable exceptions checked (e.g. SQLException) No language-level support for literal collections No type-inference when constructors of generic classes are called, i.e. the type parameter(s) must be repeated on both sides of the '='


Python:

缺少静态类型 默认参数处理(特别是可以为未来的调用者更改默认参数的事实!) 需要的下划线太多(构造函数必须调用__init__) 缺少适当的私有成员和函数(惯例只是说大多数以下划线开头的东西都是私有的,除了像__getattr__这样的东西不是) 有趣的打印到文件的语法(但他们在Python 3中修复了这个问题)


PHP:

人们永远无法确定某些几乎常见的扩展在所有web服务器上都可用。 试图成为未来的一切(goto,闭包,…) 对于没有经验的用户有很多安全风险 更多的操作符重载会很好 所有不学习如何使它正常工作的可怜的程序员,给它一个坏名声

尽管如此,PHP是(脚本)语言。: -)


我使用Java,我最大的不满是字符串操作的低效率。当你使用+运算符时。说真的,难道编译器不能计算出我添加了多少字符串,然后在后台为我生成StringBuffer的东西吗?

通常,使用+的代码比StringBuffers操作序列更具可读性。

另外,我讨厌本机数组和集合框架之间的冗余。. toarray()的语法极其丑陋。


C(好吧,这不是我最喜欢的,但当时还没人做过。)

套接字库语法。 没有函数重载。 c风格的字符串。 缓冲区溢出。 神秘的语法。我不知道有多少次我查到像atoi这样的东西,拍着我的额头,然后大喊“当然!”

编辑:如果我使用更多的库代码(就像我用套接字做的那样,但那些特别糟糕),我可能会想出更多的库代码,但我已经觉得我选择C语言是在作弊。许多语言的存在只是为了取C语言的好的部分,取代坏的部分,这有点像在徒劳无益。


我讨厌Java(目前它是我最喜欢的语言)的五个方面,排名不分先后。

As much as I am a fan of Java Generics, there are a lot of oddities that arise from the way it was designed. As such there a myriad of annoying limitations with generics (some of which are the result of type-erasure). The way Object.clone() and the Cloneable interfaces work is totally broken. Instead of taking the high-road and making everything an object (a.la. SmallTalk), Sun wimped out created two distinct categories of data-types: Objects and primitives. As a result there are now two representations for fundamental data types and wierd curiosities such as boxing/unboxing and not being able to put primitives in a Collection. Swing is too complex. Don't get me wrong: there's a lot of cool stuff one can do with Swing but it is a great example of over-engineering. This final complaint is equally the fault of Sun and those whom have written XML libraries for Java. Java XML libraries are way too complicated. In order to simply read in an XML file, I often have to worry about what parser I am using: DOM or SAX? The APIs for each is equally confusing. Native support in the language for easily parsing/writing XML would be very nice. java.util.Date sucks. Not only is it unnecessarily complicated but all the useful methods have been deprecated (and replaced with others that increase complexity).


Groovy和Grails

动态类型 约定优于配置,假设您了解约定 你讨厌春天的一切 你讨厌Hibernate的一切 [Groovy]跨集合的常见操作不是(但最近的版本对此进行了改进)


C++

太容易随机破坏内存并创建几乎不可能找到的错误(尽管Valgrind在修复这个问题上走了很长的路)。 模板错误消息。 在使用模板时,很容易将所有内容都包含在一个文件中,然后进行愚蠢的编译。 标准库在现代是一个笑话(默认情况下仍然没有线程或网络?) 大量令人讨厌的C语言(特别是所有在short/int/unsigned/等之间的转换)。


德尔菲:

IDE有点不稳定。 代码洞察有时令人困惑。 调试有时是有bug的。 更新多个项目文件可能会很麻烦。 如果启动时一个或多个包不可用,错误消息会弹出几次。


闲聊

我不想再用java、delphi、c#或ruby进行开发(这是不切实际的,因为我公司的主要开发语言是c#、delphi和java)。 从左到右的评估。 有类注释但没有方法注释(至少在Squeak中) 没有真正的标准库,在细节上有很多差异 缺少名称空间


Common Lisp:

关键词往往太啰嗦。 库支持是可怜的。 在希望更严格地处理内存的操作系统中不能很好地工作。 没有与操作系统交互的良好工具。 “循环”功能没有很好地定义,当然看起来也不像Lispy。


数组部分选择不能给你所要求的。

[1]给出一个元素 A[1:2]给出一个元素,而不是[A [1], A [2]] A[1:3]给出2个元素

我讨厌这样,但可能是因为我大部分时间都在Verilog上工作。


我偶尔会用我喜欢的PHP,而Python会用得太多。

No namespace; everything is in a kind of very big namespace which is hell in bigger environments Lack of standards when it comes to functions: array functions take a needle as a first argument, haystack as second (see array_search). String functions often take the haystack first, needle second (see strpos). Other functions just use different naming schemes: bin2hex, strtolower, cal_to_jd Some functions have weird return values, out of what is normal: This forces you to have a third variable declared out of nowhere while PHP could efficiently interpret an empty array as false with its type juggling. There are near no other functions doing the same. $var = preg_match_all('/regexp/', $str, $ret); echo $var; //outputs the number of matches print_r($ret); //outputs the matches as an array The language (until PHP6) does its best to respect a near-retarded backward compatibility, making it carry bad practices and functions around when not needed (see mysql_escape_string vs. mysql_real_escape_string). The language evolved from a templating language to a full-backend one. This means anybody can output anything when they want, and it gets abused. You end up with template engines for a templating language... It sucks at importing files. You have 4 different ways to do it (include, include_once, require, require_once), they are all slow, very slow. In fact the whole language is slow. At least, pretty slower than python (even with a framework) and RoR from what I gather.

不过,我仍然喜欢PHP。这是网页开发的电锯:你想要一个小型到中型网站的速度非常快,并确保任何人都可以托管它(尽管配置可能不同)?PHP就在那里,它无处不在,只需要5分钟就可以安装一个完整的LAMP或WAMP堆栈。好吧,我现在要回去用Python工作了……


VBA(含MS Office IDE):

1)文件不足 2)错误信息差 3)数组操作例程不足 4)必须重复DIM语句的类型 5)无法彩色打印(必须购买第三方插件)


我有一本书探讨了SNOBOL中的各种项目。第一章探讨了SNOBOL编程和语言的历史和文化,并花了一些时间论证一个优秀的程序员喜欢一种语言不是因为它的缺陷,而是尽管有缺陷。

我最喜欢的语言是Icon/Unicon。但还是有一些事情让我很恼火:

它不是很出名,也不是很受欢迎。 与PHP、Perl、Java等相比,它的库要小得多。数据库访问是通过ODBC完成的,这实际上非常烦人。 对于所有其他出色的列表处理,我想念PHP内置的explosion()和implode()。 它没有表常数。列表,是的,表格,不是。 它是一种编译(实际翻译)语言。


Ruby有许多与速度相关的缺陷,但我并不讨厌它们。它也有社区传福音过度的缺陷,但这并没有真正困扰我。以下是我最讨厌的:

Closures (blocks) have 4 different creation syntaxes, and none of them are optimal. The elegant syntax is incomplete and ambiguous with hashes, and the full syntax is ugly. The community tends to be against real documentation, favoring ‘read the code’. I find this childish and lazy. Metaprogramming abuse, particularly in libraries, makes bugs a nightmare to track down. On a related note, pervasive metaprogramming makes a comprehensive IDE difficult, if not impossible, to make. The way block passing to functions is done is silly. There is no reason blocks should be passed outside the parameter list, or have odd special syntax to access (yield). I am of the opinion that blocks should have been given a less ambiguous syntax (or hashes could have used different delimiters; perhaps <> rather than {}), and passing as parameters to methods should have been just like all other parameters. object.method(1, {|a| a.bar}, "blah") These oddities, like the block must be the last parameter passed and passing more than one block is different with longer syntax, really annoy me.


ColdFusion

大型Flash表单的编译时间。 动态变量类型(有时我讨厌它们) CFScript缺乏特性。 CFTable(永远不能正确显示)。 CFChart中缺少图表类型。 完全缺乏NTLM支持(企业就绪-是的) cfc中的低能变量作用域 没有一个真正的NULL的概念-你的变量只是消失! 没有办法测试某些东西的存在(比如作用域,只是它们内部的成员)


JavaScript

数字作为字符串-数学可以 数字令人沮丧 解释为字符串。5 + 2 = 52? 叽阿… 权限-所有最好的东西都需要用户的权限! 屏幕更新—浏览器必须处于稳定状态才能更新屏幕。似乎没有一种方法可以强制在脚本中间更新屏幕。 慢-虽然谷歌的Chrome很好… 浏览器的差异使语言的使用[审查]。


PHP:

1)强迫我创造不必要的变量:

$parts = explode('|', $string);
$first = $parts[0];

2) lambdas的实现如此蹩脚,它大致相当于使用eval(),而且如此糟糕,我从未使用过它(参见http://www.php.net/create_function)。

3) try/catch系统只能捕获大约80%可能发生的错误。

4) Regex支持和lambda支持一样蹩脚,因为它必须在常规字符串中编写,这使得最难学的编程工具之一变得困难了三倍。PHP应该是一种“简单”的语言吗?

5)没有办法安全地从$_POST中取出东西,而不写两次或构建自己的函数,或使用'@'操作符:

$x = isset($_POST['foo']['bar']) ? $_POST['foo']['bar'] : null;

6)额外答案:“@”。如果你懒得写正确的代码,那就添加'@',这对以后调试你的代码的人来说太糟糕了。


JavaScript:

All the coolest things are insanely complex, but then, all the coolness is also wrapped up in such a small amount of code that you feel stupid for struggling to follow it '+' is an absurd choice of operator for concatenation in a weakly-typed language. Were they trying to scare off the noobs? It's a cross-browser compatibility minefield (never mind if it's even turned on or not) It's generally untrusted - associated with scummery such as blocking the back button, pop-ups that never die, etc. It's nearly impossible to debug because there are only a few different error messages and a few different types (Number, String, Object, etc.)

如果不是jQuery,我可能还是会像以前一样讨厌它:)


Perl

Mixed use of sigils my @array = ( 1, 2, 3 ); my $array = [ 4, 5, 6 ]; my $one = $array[0]; # not @array[0], you would get the length instead my $four = $array->[0]; # definitely not $array[0] my( $two, $three ) = @array[1,2]; my( $five, $six ) = @$array[1,2]; # coerce to array first my $length_a = @array; my $length_s = @$array; my $ref_a = \@array; my $ref_s = $array; For example none of these are the same: $array[0] # First element of @array @array[0] # Slice of only the First element of @array %array[0] # Syntax error $array->[0] # First element of an array referenced by $array @array->[0] # Deprecated first element of @array %array->[0] # Invalid reference $array{0} # Element of %array referenced by string '0' @array{0} # Slice of only one element of %array referenced by string '0' %array{0} # Syntax error $array->{0} # Element of a hash referenced by $array @array->{0} # Invalid reference %array->{0} # Deprecated Element of %array referenced by string '0' In Perl6 it is written: my @array = ( 1, 2, 3 ); my $array = [ 4, 5, 6 ]; my $one = @array[0]; my $four = $array[0]; # $array.[0] my( $two, $three ) = @array[1,2]; my( $five, $six ) = $array[1,2]; my $length_a = @array.length; my $length_s = $array.length; my $ref_a = @array; my $ref_s = $array; Lack of true OO package my_object; # fake constructor sub new{ bless {}, $_[0] } # fake properties/attributes sub var_a{ my $self = shift @_; $self->{'var_a'} = $_[0] if @_; $self->{'var_a'} } In Perl6 it is written: class Dog is Mammal { has $.name = "fido"; has $.tail is rw; has @.legs; has $!brain; method doit ($a, $b, $c) { ... } ... } Poorly designed regex features /(?=regexp)/; # look ahead /(?<=fixed-regexp)/; # look behind /(?!regexp)/; # negative look ahead /(?<!fixed-regexp)/; # negative look behind /(?>regexp)/; # independent sub expression /(capture)/; # simple capture /(?:don't capture)/; # non-capturing group /(?<name>regexp)/; # named capture /[A-Z]/; # character class /[^A-Z]/; # inverted character class # '-' would have to be the first or last element in # the character class to include it in the match # without escaping it /(?(condition)yes-regexp)/; /(?(condition)yes-regexp|no-regexp)/; /\b\s*\b/; # almost matches Perl6's <ws> /(?{ print "hi\n" })/; # run perl code In Perl6 it is written: / <?before pattern> /; # lookahead / <?after pattern> /; # lookbehind / regexp :: pattern /; # backtracking control / ( capture ) /; # simple capture / $<name>=[ regexp ] /; # named capture / [ don't capture ] /; # non-capturing group / <[A..Z]> /; # character class / <-[A..Z]> /; # inverted character class # you don't generally use '.' in a character class anyway / <ws> /; # Smart whitespace match / { say 'hi' } /; # run perl code Lack of multiple dispatch sub f( int $i ){ ... } # err sub f( float $i ){ ... } # err sub f($){ ... } # occasionally useful In Perl6 it is written: multi sub f( int $i ){ ... } multi sub f( num $i ){ ... } multi sub f( $i where $i == 0 ){ ... } multi sub f( $i ){ ... } # everything else Poor Operator overloading package my_object; use overload '+' => \&add, ... ; In Perl6 it is written: multi sub infix:<+> (Us $us, Them $them) | (Them $them, Us $us) { ... }


C++

编写一个简单的代码片段要花很多时间。 对于(std::vector::const_iterator iter =[…] Vector.remove()不移除。 Vector.push_front()不存在。 头文件 没有λ 如果至少有一个虚函数,则没有自动空虚析构函数。


Haskell:

惰性计算导致空间泄漏。 数字层次结构不是根据数学抽象构造的。 严格的单元IO会使调试更加困难。 大型实现处理I/O的方式似乎与标准不太兼容。(特别是,输出字符只输出低8位——然后构建代码,使用这个假设来执行二进制I/O。我吐!) ($)运算符的结合性可以被改变以使某些表达式更漂亮。

大多数问题都不会上升到讨厌的程度,有些人试图解决或为每一个问题构建可靠的变通办法。

编辑:关于第5点有些困惑。特别是有些人似乎认为我指的是论证的顺序,但我不是。我不解释我的意思,我只想让人们去下面的链接http://hackage.haskell.org/trac/haskell-prime/wiki/ChangeDollarAssociativity,它很好地表达了我的意思。


objective - c

1)没有命名空间,只有手动命名约定——我不介意在类分离方面,但我确实怀念能够在一行命名空间中导入所有类定义(如import com.me.somelibrary.*)。

2)库在像RegEx支持这样的重要领域仍然存在一些漏洞。

3)属性语法有点笨拙,需要三行(在两个单独的文件中)来声明一个属性。

4)我喜欢保留/释放模式,但它比应该的更容易释放一个引用,然后意外地使用它。

5)虽然不是真正的语言特性,但Xcode与Objective-C的使用是如此交织在一起,我不禁想到这方面……基本上自动补全,是很可疑的。它更像是一个奖励你找到你想要的东西的系统,然后把它作为一个选择。但我想我从来都不喜欢自动补全引擎。


VB6

仅Windows。 不再支持。 数组可以从任何数字开始,而不是全部归一化为0。 已编译的应用程序依赖于许多dll才能正常运行。 许多复杂的控件(如浏览器控件或复杂的代码段)在运行未编译的代码时往往会破坏IDE,但在编译后却可以正常工作。


C / C + +

缺乏完整的SWAP功能 模板的语法 你不能#define一个#define(没有多通道) 编译器之间的结构打包不兼容 Char是有符号的还是无符号的?

Java

边缘上的不变性 没有像c#一样的ref关键字 到处尝试/捕捉积木 运行时性能差 所有与字符串相关的东西

Python

没有“main”(我已经习惯了!) 强调关键词 有限的线程支持 用self代替this 缺少类似C/ c++的语法


C#

泛型参数是不变的,c# 4.0为泛型类型引入了协方差和逆变性 可覆盖的类成员必须显式地标记为virtual

Java

缺少无符号数字数据类型 基本数据类型不是对象


Ruby是我最喜欢的语言,以下是我不喜欢的语言:

绿色线程+阻塞C库=巨大的失败 慢得令人痛苦 标准库本身与其使用bang!方法 模块包含+扩展是混乱的。 “开放类”不能是范围-我想添加一个String#dostuff,但我不希望泄漏到所有的第三方库 没有二进制部署打包解决方案。


VB。网

The behavior AndAlso / OrElse and And / Or seems backwards. Perhaps they should be switched. When can only be used for exception catching. The ability to do a When conditional would be nice for some other things. There is no friggin Refactoring in the VS IDE (not really the language's fault) like there is with C# Not <obj> Is Nothing. Yes, this has been remedied by IsNot, but for some reason I see the Not Is being used too often. (I see it much more frequently with devs who speak english as a second language, does it make better sense from that angle?) It doesn't require the () on ToString() and most functions. (Leads to sloppy coding habits) Having to do _ when breaking a line. It allows optional parameters. (Leads to sloppy coding habits) declaring an array is done by UpperBound and not by capacity. "Dim arr(2) as String" will actually hold 3 elements. Having = be a comparison and assignment operator.


哇,我很惊讶SQL还没有出现在这里。我猜这意味着没有人喜欢它:)

跨实现的语法不一致 细微的代码差异可能会因为看似模糊的原因而产生巨大的性能影响 对文本操作的支持很差 入门成本低,但掌握这门语言的学习曲线陡峭 最大限度地标准化社区的最佳实践,这包括语法风格。

...还有一些额外的讨厌它的理由,不需要额外收费

the WHERE clause goes last, making it easy to prematurely execute an UPDATE or DELETE, destroying the whole table. Instead, the WHERE should go somewhere up front. It's difficult to implement relational division. I can set a value to NULL, but I can't test it for equality with NULL. I can check IS NULL, but that just complicates code -- needlessly so, in my opinion. Why do we need to completely respecify the formula for a GROUPed column, rather than setting an alias on the column and then GROUP BY the alias (or column index as with SORT)?


PHP

如果你不能控制服务器,就没有调试功能,即使这样也很糟糕 大量糟糕的PHP代码给所有PHP程序员带来了坏名声 不一致的函数命名 如果我想要一个静态类型变量,就不能有一个静态类型变量(我90%的时间都是动态类型的忠实粉丝) REGISTER_GLOBALS是魔鬼


Objective Caml

缺少名称空间。 啰嗦类和对象注释。 复杂的构建系统。 不方便制作中缀。


Python:

速度 静态分析(缺乏) 匿名函数仅限于一个表达式


VB。网

1)如果不是x是"foo"(而不是<> "foo") 2)“OrElse”和“AndAlso”短路(而不是简单的“Or”和“and”,它们的作用不同) 3) Nothing(而不是Null)


Delphi(又名Object Pascal),我将讨论本机版本,而不是。net。

Var块! 语言中的接口在设计时就考虑到了COM的使用——因此比c#或Java要复杂得多。ie。涉及引用计数,除非显式禁用它。 没有尝试,只有最终结束; 对象创建过于显式: var obj: TMyObject; ... obj:= TMyObject.Create; 试一试 ... 最后 obj.Free; 结束;

而是像这样

auto obj: TMyObject; // compiler adds the default constructor call and the destructor call in a try/finally block. 

好吧,语言太好了,我真的想不出更多,所以我在这里强迫自己:内置类型,如字符串,整数..或者枚举最好有方法。ie。i. tostring代替IntToStr(i)。


Ruby:

重要的空白。对于解释器,行尾=语句的结束,除非看起来语句应该继续(或者显式转义换行符)。 慢 在线文档不如Python的好(为了辩护,Python的很棒) 我刚才提到慢了吗?


Python:

Global Interpreter Lock - Dealing with this complicates parallel processing. Lambdas functions are a bit clunky. No built-in ordered-dictionary type. Depending on how Python is compiled, it can use either UCS-2 vs UCS-4 for the internal Unicode encoding, many string operators and iterators may have unexpected results for multi-byte characters that exceed the default width. String slicing and iteration depend on the bit width rather than checking and counting characters. (Most other programming languages do similar things as well and have similarly odd behavior with these characters.) There are inconsistencies surrounding GUI frameworks for Python.


Python

错误/异常在调试时是模糊的 我工作时不用 在类中使用__init__, __repr__, __str__等 不能简单地编译可执行文件(.exe或其他) 还有一件事我还没试过,但肯定会让我心烦

对于所有的c语言程序员来说,self对我来说更有意义,因为对象引用的是它的self


Ruby

无类型推断 方法/函数不是一级对象 变量的范围不是词法的,尽管块变量的范围是词法的 Def内部的Def super和super()的区别


C++

Strings. They are not interoperable with platform strings, so you end up using std::vector half of the time. The copy policy (copy on write or deep copy) is not defined, so performance guarantees can not be given for straightforward syntax. Sometimes they rely on STL algorithms that are not very intuitive to use. Too many libraries roll their own which are unfortunately much more comfortable to use. Unless you have to combine them. Variety of string representations Now, this is a little bit of a platform problem - but I still hope it would have been better when a less obstinate standard string class would have been available earlier. The following string representations I use frequently: generic LPCTSTR, LPC(W)STR allocated by CoTaskMemAlloc, BSTR, _bstr _t (w)string, CString, std::vector a roll-my-own class (sigh) that adds range checking and basic operations to a (w)char * buffer of known length Build model. I am sick to death of all the time spent muddling around with who-includes-what, forward declarations, optimizing precompiled headers and includes to keep at least incremental build times bearable, etc. It was great in the eighties, but now? There are so many hurdles to packing up a piece of code so it can be reused that even moms dog gets bored listening to me. Hard to parse This makes external tools especially hard to write, and get right. And today, we C++ guys are lacking mostly in the tool chain. I love my C# reflection and delegates but I can live without them. Without great refactoring, I can't. Threading is too hard Language doesn't even recognize it (by now), and the freedoms of the compiler - while great - are to painful. Static and on-demand initialization Technically, I cheat here: this is another puzzle piece in the "wrap up code for reuse": It's a nightmare to get something initialized only when it is needed. The best solution to all other redist problems is throwing everything into headers, this problem says "neeener - you cannot".


诚然,其中许多内容超出了严格的语言范围,但在我看来,整个工具链都需要进行判断和发展。


方案:

缺乏用户/社区小


我觉得最喜欢的语言是不可能选择的。动态类型和静态类型不能进行比较,所以我只列出我使用的是哪一种类型

C++:

Template metaprogramming syntax is ugly. An implicit ::value would make it much more concise ->. Why can't the compiler figure out that I'm doing a ptr.thing and just do -> for me? I hate whitespace. So the whole vector<vector<int>> has to be vector<vector<int> > makes me get the jitters and then I can't focus whenever I see that line of code and I end up trying to figure out a way to use int[][] or something Macros. I personally love the concept of macros. But with C++, I that the system is a hack I'm a hater of ;

Python:

字符串是不可变的。这样我就不能用string[4]="b" 通过引用隐式复制列表。哪个泄漏到[[0]*width]*height问题 缺少尾递归(每当我输入错误递归函数时,我必须安装IDLE以避免吐出1000条错误消息) 字典键不接受列表/字典 缺乏深度范围。当我做一个列表推导时,我不希望其中的变量影响到外部作用域


Python:

处理数字太慢了。这不是什么大问题,除非…… 不能简单地在程序中包含导入时自动编译的C代码。 在py3k接管之前,我们仍然要忍受愚蠢的整数除法规则。 在py3k接管之前,像imap和izip这样的好东西仍然存在于一个单独的模块中。 在py3k接管之前,我们还有很多工作要做。


c#中缺少预处理器。

我知道他们把它放在一边是因为有些人会滥用它,但我认为他们把孩子和洗澡水一起倒掉了。代码生成被认为是一件好事,在c++中,预处理程序是我的第一个代码生成器。


我讨厌Java的五个方面:

没有一级函数。 没有类型推断。 缺乏理智的默认值在eg图形。 NullPointerException不包含更多关于什么是null的信息。 毫无意义的“可配置”框架/服务提供者接口/工厂类/依赖注入系统的激增。可配置性几乎从未使用过,严重违反了DRY,代码的大小增加了四倍,易读性减少了一半。

我知道,我应该试试Scala。


Python

1-3:没有一个明显的打包/构建/文档系统的选择(比如Perl的cpan、POD或Ruby的gem、rake、rdoc)。 4: Python 3.0是不兼容的,需要两个源分支(2。x和3.x)用于每个Python项目。但是Python 3.0的不兼容性还不足以证明它的合理性。大多数py3k的优势都太微妙了。 5: Jython, IronPython, CPython不兼容。


C++

The inconsistencies in the libraries related to char* and std::string. All C++ libs should take std::strings. Characters are not bytes with respect to iostream. I do a lot of byte-oriented work. Having a "byte" type and a "character" type would significantly make it simpler. That, too, would permit scaling to Unicode somewhat easier. Bit operations should be easy on a value. I should be able to access and set the n'th bit of a value without playing AND/OR dancing. The lack of a standardized interface for GUIs. This is where Microsoft has really been able to position themselves well with C#. A standard interface binding that OS makers provide would go really far for my work.


JavaScript

Function object syntax: f = new Function( "foo", "bar", "return foo+bar;" ); (It takes n arguments, the first n-1 are arguments for the function, then nth is the actual function, in string form. Which is just silly.) Function arguments can be repeated. f = new Function( "foo", "foo", "return foo;" ); The last repetition is the only one ever used, though: f( "bye", "hi" ) // returns "hi" f( "hi" ) // returns undefined E4X should just die. My users are always complaining that it doesn't work the way they think it will. Let's face it, when you need a page and a half of psuedocode for a setter, it's time to rethink things. A standard notion of stdin/stdout/stderr (and files!) would be nice. null != undefined It's irritating to have to handle them both. Sometimes it's useful, but most languages manage to limp along fine with one.


再给c++投一票…仍然是我最喜欢的语言,有几个亲密的追随者——C和Python。以下是我目前最讨厌的名单,排名不分先后:

Plethora of integer types inherited from C - way too many problems caused by signed vs. unsigned mistakes Copy constructors and assignment operators - why can't the compiler create one from the other automatically? Variable argument madness - va_list just doesn't work with objects and I'm so sick of problems created with sprintf(), snprintf(), vsnprintf(), and all of their relatives. Template implementation is required to be fully visible at compile time - I'm thinking of the lack of "export" implementations or at least usable ones Lack of support for properties - I want to have a read-only member like "a.x" that can be read publicly and only assigned internally. I really hate the "val=obj.getX()" and "obj.setX(val)". I really want properties with access control and a consistent syntax.


Lua

我喜欢用Lua编程,但下面是让我头疼的事情:

没有办法用这种语言编写API——不像C .h文件或Java接口 语言有一流的功能,但有人忘记告诉设计库的人。 编写函数的语法太重量级了。 语法分为语句和表达式。 表达式形式是贫乏的:没有let形式,没有真正的条件表达式,……

尽管如此,我还是坚持认为Lua非常棒:-)


F#

Type inference is limited. It propagates forward only. F# won't try to infer an object type based on the methods and properties used: you'll get "lookup of indeterminate object type" errors when it doesn't have a clue. One cannot mix floats and ints: 1 + 2.3 is a type error. It's a little awkward to have to create a builder object in order to define a monad or computation expression. In Haskell or Scala, you can define the monad operations directly on the monadic object. Though the #light syntax is preferred, the indentation rules are sometimes not very intuitive or become cumbersome.


Perl 5:

All the really good stuff nowadays seems to require mod_perl, which has low availability everywhere I want to go. Some really incredible functionality can be encapsulated in modules, but what is under the hood is often fragile or frightening: source filters, typeglobs, whatever Moose is doing... DateTime is brilliant but still made some very bad design decisions (not returning a stopwatch duration when subtracting two DateTime objects) Dual-lifed modules in core and on CPAN still cause conflicts module authors still put interactive stuff in their module configuration scripts so that they can't be automatically installed


Python

__init__ 有些库很笨拙,比如smtplib self必须在方法声明中!! (3.0之前)对unicode的支持有点差 缺少内联尝试捕获 没有直接引用"this"/current模块(相反必须使用sys.modules[__name__])


JavaScript:

The Object prototype can be modified. Every single object in your program gets new properties, and something probably breaks. All objects are hash maps, but it's difficult to safely use them as such. In particular, if one of your keys happens to be __proto__, you're in trouble. No object closure at function reference time. In fact, no object closure at all -- instead, this is set whenever a function is called with object notation or the new operator. Results in much confusion, particularly when creating event callbacks, because this isn't set to what the programmer expects. Corollary: calling a function without object notation or the new operator results in this being set equal to the global object, resulting in much breakage. Addition operator overloaded to also perform string concatenation, despite the two operations being fundamentally different. Results in pain when a value you expect to be a number is in fact a string. == and != operators perform type coercion. Comparisons between different types involve a list of rules that no mortal can remember in full. This is mitigated by the existence of === and !== operators. Both null and undefined exist, with subtly different, yet redundant meanings. Why? Weird syntax for setting up prototype chains. parseInt(s) expects a C-style number, so treats values with leading zeroes as octal, etc. You can at least parseInt(s, 10) but the default behaviour is confusing. No block scope. Can declare the same variable more than once. Can use a variable without declaring it, in which case it's global and probably breaks your program. with { }. Really difficult to document with JavaDoc like tools.


我可以为Python添加另一个:

给定一个列表l = [l1, l2,…], ln],那么repr(l) = [repr(l1), repr(l2),…, repr(ln)],但str(l) != [str(l1), str(l2),…, str(ln)] (str(l) = repr(l))。之所以这样做,是因为列表中可能有模糊的条目,如l = ["foo], [bar,", "],["], str(l)将返回"[foo], [bar,],[]",这“可能会使用户感到困惑”。然而,这使得str不可能仅用于转储数据,因为list杀死了“仅以可读格式转储数据”。Augh !


JavaScript

Every script is executed in a single global 'namespace'...something which you have to look out for when working with scripts from different sources If a variable is used but hasnt been defined before hand, it is considered a global variable Browser vendors making up standards as they please, making coding for us developers using such a beautiful language harder than it should be Case-Sensitivity - considering that there is no decent IDE for developing js with compile-time checking Workarounds (such as the use of hasOwnProperty method) to perform some, otherwise simple operations.


ActionScript / AS3

没有抽象类 没有私有构造函数(所以单例是一种hack) FP10之前没有类型化数组 Flash IDE中的编译/发布时间慢得离谱 内置函数(例如Math)的性能较慢

除此之外,它实际上是一种很好的语言——与流行的观点相反,它比JavaScript好得多,比PHP之类的语言好一百万倍。


计划

缺少静态类型 没有静态函数重载(由于上述原因)导致字段访问器的名称很长 没有统一的对象系统 有点慢 相对较小的社区


MEL(玛雅表达语言):

Single dimensions arrays: Forcing me to manually sync two or more lists, or use delimited strings to simulate more complex data structures. Naturally, they're immutable too. Single threaded and slow: Causing the entire Maya application to hang while it completes a task. Bonus points for not being able to kill long operations, instead having to close and re-open Maya. Script sourcing paths aren't recursive: Meaning every directory you want to store scripts in must all be added to the script path. No namespaces: Forcing the inconsistent use of naming conventions to make sure global procedures don't collide. Modal commands: Each command is modal, meaning the Create, Modify, and Query operations are all handled by setting flags. This also forced the developers to cause most of the commands to return arrays Inconsistent command style: Most array commands actually return arrays, but the Tokenize command has to take an array as a reference which it then populates, rather than spitting out an array. This among other inconsistencies.

这些以及其他几个原因是AutoDesk采用Python作为次要脚本语言的原因,这带来了其他一些令人讨厌的因素:

并不是所有的MEL命令都受支持:大多数都受支持,但有时您会发现自己不得不使用MEL()函数来执行一些任意代码。更糟糕的是,你不得不对它进行所有烦人的逃避。 继承了模态命令风格:必须使用相同的create=True, query=True, edit=True的东西。


Perl代表了一种可怕的语言。

No "public" or "private" or "protected" declarations/definitions. The "my $variable_name;" does not declare a global outside of a subroutine. The "my $variable_name;" gets accessed by subroutines but "use strict;" or other "use " creates warnings. Function prototypes end up unexplained, undemonstrated, unwanted, or some other excuse. Overzealous symbol use ends up "cool and quick" when reading globs of symbols. When one gets hot they like to stay hot, and need nothing to cool them. After a week of Perl, I end up unable to write a function and prototype it. What exactly is a module and does it actually NEED a ".pm" extension? If you want to create a public variable and access it from inside a subroutine, how do you accomplish this without creating a warning? Where do you find some neat scripts that teach one some neat Perl?


.NET框架(库)

嵌套类型很少使用(例如MessageBoxButton应该是MessageBox.Button) 可变结构体(Rect, Point) 系统名称空间中有太多东西 太多不同的平等概念(对象。等于,对象。ReferenceEquals, operator ==, operator !=, IComparable.CompareTo() == 0) 数组的成员是可变的,但长度是不变的。

还有一点:

XmlSerialization不适用于不可变类型


C#

I wish I could switch() on any type, and that case could be any expression. Can't use object initializer syntax with 'readonly' fields / private set autoprops. Generally, I want language help with making immutable types. Use of {} for namespace and class and method and property/indexer blocks and multi-statement blocks and array initializers. Makes it hard to figure out where you are when they're far apart or mismatched. I hate writing (from x in y ... select).Z(). I don't want to have to fall back to method call syntax because the query syntax is missing something. I want a do clause on query syntax, which is like foreach. But it's not really a query then.

我真的到达这里了。我认为c#非常棒,而且很难发现它有什么缺陷。


C#

我的大部分抱怨都与假设c++约定自动成为c#的最佳选择有关

Class接口中不允许静态。这仍然是课程的一部分。为什么它不能成为界面的一部分?我不得不想出这么愚蠢的变通办法。 区分大小写。我知道在这一点上它会破坏遗留的应用程序,但为什么不区分大小写不是一开始的规则

对于。net的好处之一(不是c#特有的)

编译器不够聪明。在。net 3中。X,编译器可以找出“var”在编译时,为什么不其他常见的优化?我们都知道string和StringBuilder / immutable和mutable的区别。为什么编译器不为你转换它在很多情况下,显然StringBuilder比多个connect .s更好?我相信在默认情况下,编译器可以为我们做大量的其他优化(带有否决选项),并为我们节省大量的时间。


C++:

缺乏象征意义。 过度迷恋C语言的兼容性。 极其复杂的预处理器。 模板错误几乎是不可理解的。 没有垃圾回收。


Javascript;

the dynamic binding of "this" is very confusing and dangerous if you don't know exactly what you're doing. a function declaration requires the keyword "function". It's not the typing I object to, it's the reading it when I want to do something slightly clever. Hrm now I think of it maybe that's a plus. Discourages me from doing clever things. As a result of number 2, it's often less code (in terms of characters) to just copy/paste a code segment than to declare it as a function, if it's a fairly short idiom. This unfortunately promotes bad practice, especially in my own code. Javascript makes motions at being a functional language by having first class functions and closures, but there's no way to verify referential transparency in a function, at either runtime or compile time. Without this, some architectures become either risky or bulky. Its fantastically bad reputation, and thus my inability to say "I program in javascript" to anyone without being laughed at.


C是我最喜欢的,但也很糟糕。

It has the worst pre-processor ever. Why didn't they use something like m4? The whole header vs source file model is broken. Pascal got it right with units. It needs case ranges in the switch statement. Unions and casts from void* break the type system. This makes garbage collectors impossible. No nested functions. GNU C has this, but it should be standard. No boundary checking for allocated memory. There are tools that discover this but they don't detect errors where a piece of code miscalculates an address and writes to an allocated region which isn't related at all. I hate the whole pointer arithmetic. No bounds checking for arrays. Too many issues regarding portability. Even wchar_t differs across platforms.


C#

它是一种很棒的语言,特别是在LINQ中,但是与c++相比泛型支持较差。它有如此多的潜力,但目前的实现只对强类型集合和类似的琐碎事情有用。下面举几个例子:

A generic argument cannot be restricted to enums (only classes or structs). A generic argument cannot be a static class. Why? This seems like a completely artifical restriction. You cannot specify that a generic type must have a constructor with a certain signature because you cannot have constructors on interfaces. Why not? It's just another method with the special name ".ctor". Similarly, you cannot specify that a generic type must have a static method, because those also cannot be declared on interface. Something like static T Parse(string s) would often come in useful. The compiler is too eager in prohibiting some casts which the programmer knows would actually work, so they require uglyness like (TheRealType)(object)value No covariance, eg. IList<string> cannot be converted to IList<object>, even though string[] can be converted to object[]. (Microsoft might be fixing this in C# 4.0, though.)


PHP

没有构造函数重载 不一致的函数命名(str_replace,但strtolower) define()不像c++那样逐字替换全局变量。 在与XHTML组合时,像if-语句这样的语句必须以不缩进开始,即使为了保持XHTML缩进一致,XHTML是缩进的。

Ex:

你必须输入:

<?php
if($x == NULL)
{
?>
                     <p><?= $x . ' is null' ?></p>
<?php
}
?>

错误捕获非常糟糕

(不知道为什么又把5号改成了1号,随便了)


R (R- project for statistics)

糟糕透顶的字符串支撑 对于一些简单的描述任务,比如交叉表格,是非常困难的 大型数据集操作是在内存中完成的。


Emacs Lisp

目前还没有足够的商业市场让人们全职用elisp编码 GNU Emacs vs XEmacs不兼容 Scheme中的嵌套函数很整洁,我希望elisp有[1]的概念 用于简单遍历列表的do循环或其他一些工具不是标准的(当然,您现在可以使用lambda进行映射)[1] (function (lambda(…)))[1]应该有一个简写

当然,Lisp的一个美妙之处在于,用一行代码在你自己的代码中修复这些问题并不难。但这并不是与生俱来的,这让我很恼火。

好的问题;我有点不好意思,因为我想不出更好的东西来恨,但说实话,法官大人,没什么好恨的。


Self

没有真正的代码浏览器 数百个小窗户飞舞 周围。 只是一个研究项目, 不够稳定,没有活动 社区。 没有相当快的版本 适用于Linux或Windows。只有Mac OS X。 不支持标准键盘 命令。 哦!关于编写本地插件的文档也太过时了!


Python。

虽然前面提到了python处理作用域的奇怪方式,但我觉得最糟糕的结果是:

import random

def myFunction():

    if random.choice(True, False):
        myString = "blah blah blah"

    print myString

也就是说,if块内部的作用域与函数的其余部分相同,这意味着变量声明可以出现在条件分支内部,并且可以在条件分支外部访问。大多数语言要么阻止你这样做,要么至少为你提供某种严格的模式。

此函数有时会成功,但有时会抛出异常。虽然这是一个人为的例子,但这可能会导致一些微妙的问题。


c#(好吧,我猜一部分是VisualStudio IDE):

No covariance (yet), like Class<D> cannot be used in place of Class<B> even though type D derives from type B. Graphic designers don't support generic based inheritance (or inheritance from abstract classes), even though the inheritance itself works just fine if you work around the designer problems by adding extra inheritance levels just so designers always see concrete non-generic variants of your code. No constructor inheritance No constructors in where clauses of generic type parameters VisualStudio seems to have a tendency to mysteriously check out files (like project files and/or unit test definitions) when opening a solution, even though the files do not seem to actually get altered.

如果你明天再问我,可能会有不同的名单。即使协方差和设计师的麻烦将在我的前5名,直到他们被解决(随着方差添加到c# 4.0,这似乎已经发生了至少一个…)


Lua

我喜欢这门语言,但是有一些事情困扰了我很多年!

No (built-in) support of binary operations (as of 5.1, it might come with 5.2). Should have a built-in binary buffer implementation, allowing for example in place long string concatenation. I know it doesn't fit well in the syntax, but sometime I miss longVariableName++ or verboseVariableName += 5. Reference assumes knowledge of C (I have it but it is a minus for newcomers) and defers some help to C reference! And sometime it is too terse. It is starting to have a good deal of libraries, but you have to get them from various places. On the other hand, the download is very small! ;-)


Lua:

I understand the reasons, but seriously. Variables should be local by default, with a global keyword, not vice versa. I'm in general not a huge fan of the do/end style semantics. I much prefer C-style braces. Dynamic typing. I know, some of you go "Huh?" but I've been entirely spoiled by knowing exactly what type of data will be in a given variable. Constant if (type(var) == "string") then stuff() end is a pain. Variables need not be defined before they're used. I would much rather be explicit about what I'm trying to do than risk a typo causing what I like to call "wacky beans".

PHP:

同样,动态类型。 缺少闭包。你可以用$function($arg);但这不算。 同样,变量可以在定义之前使用。我有一个个人策略,总是在使用任何变量之前显式地将其初始化为已知值,并且我将其扩展到我可以控制的任何最佳实践文档。

C / C + +:

头疼=脖子疼。 不支持闭包。(我对c++ 0x很兴奋,因为c++ 0x有这些功能。) 静态类型。“等等,”你说。“你刚才说你不喜欢动态类型!”是的,我确实这么说过。但是静态类型也会让人头疼。(如果有选择的话,我仍然会选择静态类型。)最理想的情况是,我希望语言默认是静态类型的,但也支持动态类型。(我还想要一匹小马,500亿美元,还有整个世界。)


Ruby:

太慢了 自负的群体 这不是闲谈 在nil上调用方法时出错,而不是返回nil à la Objective C 非线程


C:

Lack of distinction between function pointers (executable) and data pointers (you really don't want to execute this). Extreme unreadability. Making code look like it does what it does is orders of magnitude more difficult than making it do the task in the first place. Lack of clear support for lisp-think. Doing functional things is possible, barely, but it's not clear. Serious inconsistency between libraries about how error codes are returned. Antiquated string handling. The strings aren't strings, they're null-terminated blobs. This is all manner of wince-worthy.

Lisp:

()需要按shift键。每次我口齿不清的时候,我就把它和[]交换。


Java:

没有过程编码,它编译成过程代码,所以让我使用它! 没有多重继承,试图用15,000个接口做同样的事情很糟糕。 约会课,我还需要多说吗。 我不能充分利用多态性。Java不会覆盖不同的参数类型来触发。 我想不出第五个原因,如果我知道,我会回来编辑这篇文章。


Python

慢 我终于习惯了打印语句,现在有了这个打印函数??(py3k) 从来没有得到py2exe或cxFreeze工作 不标准化(轻微挑剔) 递归深度只有100 (iirc)


Perl

我喜欢这门语言,我不想添加已经被使用过的东西,但还没有人提到过这一点,所以我就把它扔到锅上。当我使用这个特性时,我发现这是我一生中最可怕的经历(而且我用过汇编语言):

write()和format()函数。

它们的语法是最糟糕、最丑陋、最可怕的,但是它们并没有提供比printf()更好的功能更多的功能。任何人都不应该尝试使用这两个函数进行任何输出,因为它们有多糟糕。

我相信有人会不同意,但是当我研究它们,希望它们能解决我的问题时,我发现它们是一个“痛苦的世界”(引用Big Lebowski的话),我希望Perl6已经消除了它们,或者更好的是完全重写它们,使它们在某种程度上更可用和有用。


Oracle SQL

DUAL表。 不能通过别名分组。 我永远记不住分析函数的语法,所以我忘记/懒得使用它们。 缺少组合的LIKE和IN条件运算符。(不过,在10g之后,有一个REGEX_LIKE操作符可以做到这一点。) 笨拙的连接语法。

SQL并不是我最喜欢的语言,但它是我每天使用的三大语言之一。可能还有更多的项目,但这些是我脑海中最重要的。

我有一大堆SQL*PLUS的问题。我写了一个Perl的替代品,从命令行做我想做的,我使用sql。Emacs中的el用于交互式SQL会话。这些工具可以帮助我解决SQL*PLUS问题。


说到这里:

Perl

"Only perl can parse Perl." (But this is mostly an issue in syntax highlighting, which I don't prefer to use much anymore for any language.) I'm sometimes surprised by "the simple (but occasionally surprising) rule...: It looks like a function, therefore it is function, and precedence doesn't matter." (From perlfunc(1)) Dereferencing complex data structures can be confusing at times. I can't decide if this is a true flaw in Perl or just a consequence of having really powerful data structure facilities. Either way, I can normally get it right by taking a few minutes to think about what I'm doing. No option to cause system calls to raise their errors like the DBI module. (Thanks to brian d foy, I now know the autodie module on CPAN does this, but I'd like it built-in.) Warnings and strictures not enabled by default in scripts. (The -e option would turn them off for command line use.)

同样,肯定还有更多的事情,但这些是我最近注意到的问题。我还要加上=over and =back和古怪的L<…>语法在POD中,但也许那应该是一个单独的列表。


现在来看看三连冠:

康壳牌

Sourcing a file with arguments replaces the values of the parent script's arguments. (Executing . file arg1 puts arg1 in $1.) ksh is not an ideal interactive shell and defaults to vi key-bindings, rather than emacs. (My solution is to use bash for interactive shells.) Common utilities (such as grep) are implemented differently across different platforms thereby preventing perfect portability. Some useful commands need to be installed on some platforms and are part of the OS core on others. The syntax for conditionals is overly heavy. (if [ ... ]; then ... fi) Although it is Turing Complete, you are eventually going to want to move up to a more expressive language like Perl.

第4个问题的一个解决方案是习惯短路评估:

[ ... ] && ...

D

we have in operator, but no !in operator? dynamic array 'length' property - ya canna do array.length += 512; no exit statement - as in python's sys.exit(), etc. Sure, you can call C's exit, but unflushed output don't get flushed associative array literals + string literals suck string literals found as is inside an associative array literal are interpreted as static, thus this char[][char[]] hash = ["hello":"world","goodbye":"angels"]; doesn't work without some extra casting due to different length string literals despite a. I didn't ask it to be interpreted as static arrays b. static arrays aren't allowed in associative arrays anyways cyclic dependencies disallowed (want to port that java lib? Have fun redesigning the class hierarchy)

谁帮我检查一下;不确定它们是否都有意义。


C

bit fields -- they aren't well specified by the language and how they work is compiler dependent and architecture dependent. It's often hard to find where a particular symbol is defined in a large mass of code, esp. if that symbol is produced by a macro. Which reminds me... The preprocessor is a rather ugly hack, amenable to all sorts of abuse. lack of standard sized integers (remedied by uint*_t lately, but there is lots and lots of old code floating around out there with custom typedefs or #defines for DWORD, WORD, BYTE, etc.) Lack of something akin to Perl's cpan.org (would love to be wrong about that one.)

编辑: 在考虑C的CPAN时,我想……我该怎么称呼这样的东西,然后想到了“ccan”,然后谷歌了一下,我看到了这个: http://ccan.ozlabs.org/

不过,它似乎还处于起步阶段。


我是在冒险,因为我不能全职使用它,但无论如何我会尝试一下!

Perl 6

func("frew") != func ("frew") It annoys me, but there is good reason for it. In Perl 5 print (5 + 6) * 10 still gets me every now and then It may be easier to parse than Perl 5 in a lot of places, but it still kills my editor sometimes It still has a lot of the line noise Perl 5 which scares a lot of people. That means it's harder to get them excited etc. There are no libraries yet. This will be a non issue if Perl 6 does indeed end up supporting Perl 5, but that may be a burden not worth bearing. There's no REPL, or what rubyists would call irb. A solid interactive Perl 6 with tab completion, color coding, etc, would make using and learning it so much nicer. Currently the documentation is basically the English spec. Not exactly an easy read. I know it's a stupid cliche, but it's not out yet! (I am allowed to complain because I am helping :-P)

前三点是语言;剩下的并不是语言本身,而是它还没有问世的事实。


C#

当被枚举的集合中的对象发生变化时,foreach命令弹出, UI控件吐出假人,因为它们在错误的线程上访问。当然是所有的调度员。调用可以移动到CLR管道, PInvoke,编组等, 我浪费了两年时间学习远程遥控, 它没有露比性感。


C

It's so flexible and powerful that it's really easy to write really awful, or downright dangerous code (or, if you prefer, "with great power comes great responsibility"). '=' for assignment, and '==' for equality; easy to confuse in 'if' statements. The implementation of a number of fundamental parts of the language are compiler-dependent; e.g. the size of the basic types, order of bits in bitfields, padding and byte order in unions. Bitfields aren't parameterisable (i.e. you can array of ints, but you can't have an array of bits). String handling could be improved.


我知道我迟到了,但恨是永恒的!

Java

Runtime.exec(). So, if I don't manually clear the STDOUT and STDERR buffers, my code will hang? Wow. Die, plz. Null Pointer Exceptions. Responsible programming means I have to treat most objects like they're unexploded bombs, which is kind of a pisser in an object-oriented language. And when the inevitable happens I kinda need to know which object blew up in my face, but Java apparently feels telling me would be cheating. File I/O. Why do I have to jump through this many hoops to read a dang text file? And when copying files, I have to funnel the source file into my code and manually handle the output byte buffer? You're serious? Primitives vs. Primitive Wrappers. Note that Java now has a number of features that allow you to treat primitives and their wrapper objects as interchangeable in some places, but not in others; don't worry, the compiler will let you know which is which. This feels like a hack to work around a fundamentally broketastic design decision. And it is. (EDIT: Actually, the compiler is a much crappier safety net than I thought, particular when doing equality checks. If `a` and `b` are integers, `a == b` is guaranteed to behave as expected only if at least one of them is of type `int`. If they're both type `Integer`, then that statement will do what you think only if the two numbers are between -128 and 127. `Integer a = 1000; Integer b = 1000; return a == b;` will return `false`. Really.) XML. I have this dirt-simple little XML file I need to create and I have to do what?


Java

已检查的异常 类型擦除 缺少操作符重载(例如BigInteger/BigDecimal) 缺少regexp/date/duration /复杂文字 对不可变性的支持很差


Python

No statements in lambdas. GRRRR foo( a for b in c if d ) feels wrong, it surprises me every time I get away with it. Shouldin't it be foo( (a for b in c if d) )? Can i have a dict comprehension? map and filter operators have special syntax in list comprehensions, how about something for reduce? or sort? Just by having a yield statement in it, a function is magically transformed into a generator, and its interface changes completely. Also, that generator cannot do any work before the first next(). at least, not without using a function that returns a generator.

JavaScript

No brief syntax for making modular code libraries. You have to call a function that returns a dictionary of public methods. And you have to edit that in (at least) two places every time you alter the interface of your module. Creating closures involves returning it from a function that returns a function from ('sup dog) yo' function. Clutter! for each ( foo ) syntax and behavior feels like an afterthought. Knowing when your code will actually run (and in what order) is more of a dark-art. The only way to get it right for sure is put everything (yes, that too) in one big file. and even then you still need to wait for a document.onload Am i missing something? is there no trivial way to get json serialized values without building them by hand? (yes jQuery can do this, sort of).


Objective Caml

Non-concurrent garbage collector. I can write multi-threaded programs all day long, but they're only ever going to get one of my eight cores at a time. This makes me sad. No type classes (or their moral equivalent). There's Furuse-san's GCaml, but it's A) not quite as good as type classes, and B) not in the INRIA distribution. Badly in need of a Cocoa bridge. Seriously. If I wrote more code with actual interfaces to DNA-based life forms, then I'd probably break down and write the damned thing myself. Why hasn't anybody else done this yet? Functors are abominable. Seriously, modules ought to be first-class values. There should be only one kind of function. Read Montagu and Rémy before you flame me for this. Should use LLVM for its back-end. Who do I have to murder to get OCaml to compile for my stupid little ARM6 core?

是的,我有一些问题。我仍然非常喜欢这门语言。这太棒了。


Python:

1) It's a scripting language and not a fully compiled one (I'd prefer to be able to compile binaries—I don't care about bytecode). This is very annoying if I have to use very many libraries (i.e. everyone who uses my program has to install all the libraries, and this basically means no normal people will be able to, or have the patience to, properly set it up—unless I do a ton of work that should be unnecessary). I know ways to make binaries, but they don't always work, and I'm guessing they bundle the interpreter in the binaries anyhow (and I don't want that). Now, if I could get a bytecode compiler that would include copies of all the files that I imported (and only those) to be placed in my program's folder, that might be a suitable compromise (then no one would have to download extra libraries and such). It would also be nice if the compiled python files could be compressed into a single file with one specified as the file to run the program before this is done.

2)有时看起来有点bug;有几次,应该工作的代码根本没有工作(没有程序员错误),特别是与“from moduleX import *”和其他导入相关的问题有关的代码,以及一些与全局和局部变量有关的问题。

3)最大递归深度可以更高。至少有一次,我觉得我需要它去更高的地方。

4)没有switch语句(更不用说允许数字、字符串和范围的语句)

5)新版本的Python似乎取消了很多有用的字符串操作,而且似乎没有简单的文档说明如何在没有它们的情况下做同样的事情。

6)强制自动垃圾收集(我希望能够手动执行,尽管不一定强制执行)。

7)没有预先制作的定时器类没有使用GUI(好吧,可能有一个,但在我所做的所有搜索之后,它肯定不方便找到!我确实找到了一些东西,但当我尝试时,它根本不起作用。)所谓计时器,我指的是每隔x秒执行一个指定函数的排序,并能在需要时关闭它,等等。

8)社区里举例的人很少告诉我们他们导入了哪些模块,以及他们是如何导入的。

9)与Lua集成的支持并不多。

10)似乎没有办法向一个类的特定实例(而不是整个类)添加一个额外的函数,除非你动态地向该类添加一个对象变量,该对象具有所需的函数(但仍然,你必须为此创建另一个类)。


C

No parametric polymorphism (i.e. C++ templates). It makes writing reusable data structures and algorithms a pain (and there's hardly any static checking). See for instance the comparator argument to qsort and bsearch: the comparator takes void pointers :( No library of data structures. I really hate writing my own hash table. I also really hate scouring the web for a library of reusable data structures. Especially if it turns out to be incomplete. Strings. Inefficient representation, unwieldy if you make it sane, too hard to safely input a string. No standard for snprintf. Too hard to create a format string with sprintf, then use that to create a string with sprintf again, in a safe way. Only lexical macros. If different compilers expects function annotation in different places, I have to put the same HAS_NO_SIDE_EFFECTS in different places. Why can't I just grab the function, switch over the compiler type, and then insert it at the right place by a macro call? No portable libraries for common functionality. For sockets and threading, I use SDL---a frigging game library. For .ini-style parsers, the only library I could find which was packaged for ubuntu, I posted on the daily wtf (it calculates an array of hash values, then does a linear scan through it...)

C++

Template syntax is heavy and unweildy. Let's see, for(map<string, int>::const_iterator it = mymap.begin(); it != mymap.end(); ++it). Design errors in the STL. Should changing allocation strategy for your vector really change its type? Overly complex type system. Type T1 has a convert-to-T2 method, and T2 has an implicit from-T1 constructor. Which is called? How does overloading, overriding and multiple inheritance interact? Poorly, I guess... Incredibly long and unwieldy error messages from templates. You know what I mean... References means you can't see output parameters at call sites. In C, you can guess what foo(bar, &baz) can and can't modify.


VBA(因为你认为你的语言不好)

Whitespace inside a line is rigidly enforced. Statements just end, and require a " _" to break to the next line, but not every line can be broken. No ++,--,+=,-= statements. Seriously? Arrays can begin at any index, not just 0. Some types (i.e.: fixed-point "Decimal" value) must be subtypes of Variant, and aren't available as their own type. != and <>. "=" is used as both comparator and assigning, instead of splitting into "=" and "==". "Option Explicit". UI hasn't been updated since 2000. Office2k7 didn't upgrade to VB.NET Most object models are non-sensical and overly verbose.


REBOL

REBOL是我最喜欢的语言之一。我不能说我有一个最喜欢的,尽管Haskell排名也很高。

Its odd syntax scares off many developers before they even give it a try. use [email rules url] [ ; A small DSL that sends email to people about URLs. rules: [ some [ into [ set email email! set url url! (send/subject email url reform [ "Check Out" url ]) ] ] ] ; Global context notify: func [ [catch] dsl [block!] ] [ unless parse dsl rules [ throw make error! "You screwed up somehow." ] ] ] notify [ [ a@b.com http://www.google.com ] [ b@c.com http://www.yahoo.com ] ] Recursive dialects are very easy to validate with PARSE but very difficult to evaluate. (Stacks can be helpful here.) REBOL has very poor integration with many popular technologies, particularly XML. I suspect this is partly arrogance, because the REBOL BLOCK! datatype can do almost everything XML can do. However, the real world has XML in it. No Unicode. Thanks to AltMe, REBOL's user community is very insular. I can understand why they want to use AltMe. It's written in REBOL and shows off its strengths. Unfortunately it also puts them off on their own little island.

即将到来的REBOL 3有望解决许多这些问题,除了最后一个。


c#:

1)静态方法必须是类的成员

2)静态扩展方法只能添加到静态类中

3)接口函数的实现不会被标记为“override”之类的东西来显示它们来自基类或接口(这使得你很难确保你正在重写你所期望的方法(具有正确的签名))。

我只有3个。我想那很好。


第一个帖子,所以对我放松点:)…很棒的社区网站,顺便说一句!

我试着阅读其他所有的c#回复,这样我的回复就不会重叠了

c#……排名不分先后:

1) switch语句中的case没有fallthrough。如果没有转机……为什么必须显式的类型中断;呢?这只是弱智和令人困惑,因为它意味着没有休息的能力;!!

2)不能在子作用域中声明同名变量,但可以声明与类变量同名的变量?要么都允许,要么都不允许。否则,就没有意义了。

3)函数中没有可选/默认参数

4) finally{}中的异常应该隐式地捕捉每一行。或者至少,只有NullReferenceException异常。例如,在访问数据库后,应该总是清理。所以,finally块应该看起来像这样:

finally
{
  if(par1 != null)
    par1.Dispose();
  if(comm != null)
    comm.Dispose();
  if(conn != null)
    conn.Dispose();
}

如果可以写成这样,就会简洁得多:

finally
{
    par1.Dispose();
    comm.Dispose();
    conn.Dispose();
}

但是,不……你必须检查你是否正在访问一个空对象,否则它可能会从finally块抛出一个NullReferenceException。谁真的需要finally块中的异常呢?

5)泛型:你可以指定new()来实例化你的泛型对象,但是这个对象需要有一个默认构造函数。为什么不能指定一个签名,这样就不需要在还没有空构造函数的情况下创建空构造函数,而只使用已有的构造函数。


Haskell。

默认情况下导入Prelude。 类型类的范围是通用的。 模块不是一流的。 类型不能依赖于值。 单子不统一Functor。


Python:

我仍然是python的一般用户,所以我的抱怨可能只是知识的锁或误用。欢迎提出意见。我很喜欢这门语言。

Poor thread support and GIL. If you'd like to take use of multicore platform, most of the python programmers would probably recommend multiprocessing or some sort, don't use threading. It wouldn't give you the performance you are expecting. property only for instance variable. _class_var = property(classmethod(some_method)) just wouldn't work. How can I get a property wrapped class variable? no access control. All access controls are syntax mangling. Like private is __private, protect is _protected, etc... And hope that everyone programs python follows the naming convention. Come on, we can do better than that. I agree the python philosophy of being simple and clear syntax but some simple and clear syntax not being supported seems lock of good judgement, in my opinion. Such as, a++, ++a, a-- and --a, self-de/increment, what's wrong with those? foo = (a > b ? a : b) unary operation, what's wrong with those? (I know py2.6 has something similar introduced, but given the massive support of almost every other language for those simple syntax, why reinventing the wheel? why not just follow the best practice? Shouldn't a good thing just keep in its good "form"?) Program to interface. Python has no interface or abstract class concept (py3k has something called abc), everything is concrete. Providing an "interface" or "abstract" keyword to build class skeleton and guard class inheritance and extension wouldn't be a bad idea I think. It helps on top-down design. Currently, I just have to fill the each of methods with NotImplementedError, quite a tedious job. I have to add this. version less than 3.x has str and unicode types. This is a true nightmare. It makes ascii and non-ascii/unicode mixing most likely to fail (bad, bad)

我看到人们抱怨速度。我不明白。它是一种解释语言,代码直到运行时才编译成机器代码,这就是它的本质。你不能比较解释语言和编译语言的速度。据我所知,在解释/脚本语言中,python并不慢。


我自己最讨厌c++的5个地方:

自动生成构造函数、析构函数和赋值操作符。伙计,每当我在课上没有声明什么东西时,这意味着我不需要它,而不是我忘记了。你们这些编辑们,听到了吗?!

[4]模板语法。哦,我真的需要输入所有这些“<”和“>”,每当我决定从类主体提取定义?

[3]字符串。天啊,我受够了“const char*”,我必须处理NULL情况,我必须浪费O(N)来获得它的长度,我必须为concat操作分配缓冲区。

[2] Macroprocessing。每当我不明白,什么是我的编译器,我开始寻找宏。

[1]操作符重载。我看到代码“A + B * C”,在我看到A、B和C的实际类型之前,我说不出这个代码是关于什么的。


那"我讨厌某些语言的五件事"清单呢?: D

把橙色涂成红色并不能让它成为苹果。

当设计一种语言时,设计者通常会考虑它的用途。用它做一些完全不同的事情是可以的,但是当它不起作用时抱怨是愚蠢的。Python。我相信总有一天会有人用Python代码创建exe工具。你到底为什么要这么做?不要误解我的意思,这样做很好,但没有任何用处。所以别再抱怨了!

一个设计良好的项目很可能包含来自多种语言的代码。这并不是说你不能只用一种语言完成一个项目。有些项目可能完全在您所使用的任何语言的能力范围内。

4-你是用木腿站着吗?

The platform can be a large influence of what the language can do. With nowadays garbage collectors, or well even pascals early attempt at "garbage collection", can aid in memory fade (maybe malloc more ram??). Computers are faster and so of course, we expect more out of our languages. And quite frankly, we probably should. However, there is a huge price to pay for the convenience of the compiler to create hash tables or strings or a variety of other concepts. These things may not be inherit to the platform of which they are used. To say they are easy to include to a language just tells me you may not have a leg to stand on.

3-到底是谁的错?

Bugs. You know. I love bugs. Why do I love bugs. Because it means I get to keep my job. Without bugs, there would be many closed pizza shops. However, users hate bugs. But here is a little splash of cold water. Every bug is the programmers fault. Not the language's. A language with such a strict syntax that would significantly reduce how many bugs were possible to generated would be a completely useless language. It's abilities could probably be counted on one hand. You want flexibility or power? You've got bugs. Why? Because you're not perfect, and you make mistakes. Take a really identifiable example in C:

int a[10];
for (int idx = 0; idx < 15; idx++) a[idx] = 10;

我们都知道会发生什么。然而,也许我们中的一些人没有意识到…这种功能是非常有益的。这取决于你在做什么。缓冲区溢出是该功能的代价。上面的代码。如果我真的把它公之于众。这是再一次. .和我一起说。“我的错”。不是C,因为你允许我这么做。

2-我们不应该把它放进回收站吗?

It's very easy to point at a feature in a language we don't understand because we don't use it often and call it stupid. Complain that it's there etc. Goto's always entertain me. People always complain about goto's being in a language. Yet I bet your last program included a type of goto. If you have ever used a break or a continue, you've used a goto. That's what it is. Granted, it's a "safe" goto, but it is what it is. Goto's have their uses. Whether "implicit" gotos like continue or break are used or explicit gotos (using the actual keyword "goto" for whatever language). Not that language developers are flawless, but typically... if functionality has existed since the dawn of time (for that language). Likely that aspect is a defining quality of that language. Meaning.. it's being used and likely is not hanging around because of backwards compatibility. It's being used today. As in 5 minutes ago. And used properly. Well.. arguably someone is using it improperly as well, but that relates to #3 on my list.

1. -一切都是客体。

Ok.. this one is really a subset of #2. But this is by far the most annoying complaint I see in hate lists. Not everything is an object. There are a great many of concepts that do not belong or need to be objects. Putting things where they don't belong is just ugly and can decrease efficiency of a program. Sure. Maybe not much depending on the language. This also relates to #5. This means... yes. Global are ok. Functions as apposed to static methods are ok. Combining OO programming with global functions is ok. Now.. that doesn't mean we should all go out and "free" our code from it's object models either. When designing a section of code or a whole project, what happens behind the scenes should be considered when putting it together. Not only where that concept lives and many other factors. Why wrap global functions within classes or name space concepts if it serves no purpose? Take static member variables. That greatly amuses me because.. well..Depending on the language and implementation of course, but generally speaking, you just declared a global. Yes, there are some reasons to wrap these non-OO concepts in OO wrappers. One of course being self documenting code. That can make sense. So.. like I say. Don't go out and "free" your code. But any good modern language will have a global concept outside of it's OO modeling. Yes I'm specifically meaning to point out that an OO programming language without a global concept most likely has a serious design flaw. Again though.. depends on the intention and design of the language so I'm not attempting to pick on any specific language and there are far too many to analyze right here. Anywho, Consider where the code should live and be the most effective. Adding a bunch of flare to something which doesn't add functionality or support just wears down the keyboard faster. It doesn't do anybody any good. Well.. unless you like brownie points from the person who probably incorrectly taught you that everything is an object.

In short, programming isn't just mindlessly tapping on the keyboard. There are a lot of design considerations to any project. I know it's cliche, but you have to look at it from every angle. Even with nowadays type-safe languages. You don't just chuck code out and expect it to work well. Sure.. it may work, but it may not be the right way to go about it. Overall, pick the language and format that is best suited for the specific job AND the environment. But no language takes away the thought behind it. If you're not thinking.. you're just typing.


Haskell:

空间泄漏——懒惰的默认代价——也许代价太高了? 甚至像head和tail这样的纯函数也会调用错误并引导您进入IO。 fail from Monad -带回MonadZero。 Num类-(+)应该在AdditiveGroup或类似的类型中。 那个单子不是一个应用程序。


c++缺乏好的重构工具,缺乏受控异常

Java缺少模板,缺少const关键字


Objective-C / Cocoa / Cocoa Touch:

Lack of namespaces Difficulty using primitive values with any of the interesting and powerful techniques of Cocoa, e.g., distributed objects, notifications, KVO Inconsistency with the use of the shortcut dot syntax for accessing properties, often having to use the full length accessors No GC on the iPhone, and generally GC came rather late to an otherwise highly dynamic language Inconsistent library support, at least in Cocoa Touch; some very basic things have only recently gotten high level support, e.g., audio handling. Lack of blocks!


PHP

几乎每个标准函数都在全局作用域中 不一致的函数参数顺序 不一致的函数命名 不区分大小写的函数 脚本的行为可能会因php.ini文件的不同而有所不同 能够使用未定义的变量 在某些情况下,必须将结果赋值给变量,然后才能在函数中使用它

更主观地说:

动态类型


Common Lisp

缺少提供更现代功能的标准库(套接字,线程,…) 是否可以使用映射到本机窗口系统的标准化UI Scheme将lambda表达式赋值给变量并将变量直接作为函数调用使用的能力看起来比APPLY for FUNCALL更整洁。我猜这是使用多个名称空间的副作用 标准化的库源代码级打包系统,以便可以从多个实现中轻松使用它们

我想知道强类型的口齿不清会是什么样子


Haskell(包括所有GHC扩展,而不仅仅是Haskell'98的基础规范)。

我讨厌它的一点是:它不是主流。


C#

1)缺乏为值类型编写泛型的实际能力。例如,任何白痴(好吧,大多数白痴)都可以编写一个例程,用c++计算int, float, double等列表的标准偏差,它写起来很简单,易于阅读,并作为快速的非泛型代码执行。我认为,如果你能用c#写一些东西,接近于达到这三个中的任何一个,而在其他两个上又不荒谬,你就是一个真正伟大的程序员。

2)协方差和反方差,尽管这被添加到4。

3)非常糟糕的LINQ文档(好吧,并不是语言的一部分)。

4)尝试使用foreach/迭代器,当我每次都想做同样的事情,除了上次略有不同(如连接一串字符串与逗号之间的单词和最后两个)。如果我用一个IEnumerable来写它,它很难写和读,而用一个for (int I =0 I <…)它并没有好到哪里去,而且效率更低。

5)我知道我会收到抱怨,但是缺少受控的例外。这并不需要像在java中那样实现(框架开发人员确实提出了一些很好的观点,为什么他们没有这样做),但我很乐意看到编译器警告不喜欢受控异常的用户可以关闭。


我不敢相信,我最讨厌的Python竟然还没被提到:

(Prior to 3.x) Relative imports look like absolute imports. import foo Does this import foo from the directory you're standing in or from the sys.path? Zipped eggs, leading to a sys.path full of shite. Zipped eggs means you can't use grep and find (to among other things debug problem 1)! Fortunately, there's pip. Use pip. Some of the included batteries are unpythonic. It grates to use them. Might be the fault of distro's and packagers, but still: sourcefile-encoding set to fscking ASCII on install/compile. WTF? Means I have to put the "# coding: UTF-8"-stuff in every single .py I ever make.

Py3k解决了我的其他几个讨厌的问题,例如坚持字符串是unicode的,8位的东西是不同的……


C#

5. 空合并运算符

的? ?运算符允许你写:

x = y ?? z;

而不是:

x = (y == null) ? y : z;

我喜欢这个运算符,但我想要另一个:

x = y ??? y.foo() : z.foo();

而不是

x = (y == null) ? y.foo() : z.foo();

我一直在使用这种东西,而且我发现输入== null部分很烦人。


4. 平等应该有更好的支持

我必须启动每个Equals(object obj)方法: MyClass other = obj作为MyClass; If (other == null)返回false;

你只需要写:

public override bool Equals(MyClass other) {...}

语言应该注意提供Equals(object obj)方法。 注意:other必须保证不为空。


3.不能使用不同类型的三元运算符

这不能编译,我认为它应该编译!

string foo = "hello";
int bar = 4;
object baz = foo == null ? foo : bar;

2. 缺少命名空间private

我喜欢内部保护,但我希望有一种保护只允许从同一名称空间内进行访问。这样可以更好地控制大型类库的访问。


1. 没有多重继承

我实际上只对接口的默认实现使用实现(类)继承,但很多时候我想这样做。


Quenya

• Community is too small. It's next to impossible to get a good language-immersion program going when there's no easy to find another speaker nearby. • Irregular verbs. Yes, I know English and Spanish mentioned them, too, but Quenya was invented. Why does there still need to be irregular verbs? • No Unicode support. I have to have three different Tengwar fonts on my computer before I can read most messages, and several of them are poorly kerned. This wouldn't really be a huge issue given the existence of a Romanized transcription, but Tengwar is so beautiful, you don't not want to use it. • Not all concepts can be easily referenced in Quenya, leading to annoying circumlocutions, or resorting to Sindarin, Númenórean, or (Manwë save me) Klingon to get my point across.


我最喜欢的是c#,但是已经有很多关于c#的答案了,所以我将选择我的下一个“最喜欢的”:

t - sql

The GO statement, and the fact that you need it for all manner of DDL/DML scripting, and the fact that it also breaks transaction semantics, making it far more difficult than it needs to be to write an atomic script, which you really need to have in order to upgrade a production database. Inconsistent semicolon semantics. 99% of the syntax doesn't need it, MERGE statement has to end with it, WITH statement has to begin with it... make up your mind! WITH CHECK CHECK / WITH NOCHECK CHECK. Uuuu-gly. Optional parameters in UDFs aren't really optional. Caller must specify DEFAULT (and don't even try using NULL instead). Compare to SPs where they are truly optional. "...may cause cycles or multiple cascade paths." HATE HATE HATE HATE HATE HATE HATE HATE HATE HATE HATE


TCL

这是我最喜欢的语言,几乎可以做任何事情。多年来,它已经(慢慢地,非常缓慢地)演变为解决大多数让我烦恼的事情。而且这门语言非常灵活,很容易实现语法来覆盖那些仍然困扰我的东西。但是语言中有一些东西是不能轻易改变的,只是打破了它的禅意:

Arrays (of the associative kind, what Perl calls hash) don't have proper value semantics. This makes them awkward to pass to and return from functions. Also, this means that they can't be nested. For this reason dicts (dictionaries) were invented but too late, the nice array access syntax: $array($foo) is now forever taken by stupid arrays for backwards compatibility. We're now stuck with: dict get $dict $foo which is much more verbose and to me feels less readable. No real closures. Though it can be emulated somewhat by globals or namespaces but that defeats the reason for closures in the first place. Although, I can't really see for now how closures can be implemented in a pure value semantics system. Teacup is hard to use and is not at all intuitive compared to all other repository tool out there. This is more ActiveState's fault than tcl-core and doesn't really break tcl's Zen when coding but it is still very annoying.


C++

(除了lambda函数,我已经避免了Cpp0X中可用的东西)

不强制使用"this"访问成员变量,::GlobalFunction访问全局命名空间。 (更具体地说,算法中缺少lambda函数,将在0x thou中修复)中的所有内容 处理依赖文件/头文件和源文件 基本数据类型上的愚蠢名称(应该命名为uint8, int16等) const_cast功能


C#

c#最让人讨厌的是:

(1)事件具有对所有侦听器的强引用,从而防止了侦听事件的任何东西的垃圾收集。如果你想看到这造成的问题,只需在网上搜索所有试图通过创建某种“弱引用事件处理程序”来解决问题的人。

(2)在调用一个事件之前,需要检查它是否等于null,这似乎应该由语言来处理。

(3) XML序列化器无法读取/写入XML文件中的注释。在手工修改XML文件和用c#编写的工具修改XML文件的环境中,情况并不好。可以通过使用原始的XmlDocument来解决,但如果能够将其抽象到一个类中会更好。

(4)构建过程不允许您直接访问xsd文件之类的东西,相反,您需要一个中间步骤,即创建一个c#部分类。这也会导致XAML文件出现问题,有时需要重新构建两次才能使更改正确地通过。

(5)不支持CPU intrinsic,如MMX和SSE 1,2,3,4,因此这些有价值的CPU特性在运行c#应用程序时无法使用。

其他没有进入我的前5名:

(6)不能将字段标记为属性,所有属性必须从一开始就显式地实现:

目前有:

public class MyClass {
    private int someInt;

    public int SomeInt {
        get {
                return someInt;
        }
        set {
                someInt = value;
        }
    }
}

public class MyClass {
    [IsProperty(public, get, set)]
    private int someInt;
}

(7)不支持多个返回值,例如:

public int, string, double MyFunction()
{
    ....
    return x,y,z;
}


public void TestMyFunction()
{
    int x, string y, double z = MyFunction();
}

(8)不支持协变返回类型

我对泛型实现有一些不满,但我就此打住。我认为c#是一种很棒的语言,可以完成所有的GUI、网络和配置管道,并且是我的首选语言,可以以一种可以长期支持的方式快速启动和运行。


VB。网

默认情况下弱类型(Option Strict修复了这个问题,但默认情况下没有启用) 在方法上不需要括号(myFunction而不是myFunction()等等) 是否使用括号来定义数组/使用(myArray(12)而不是myArray[12]) 不支持直接递增(i++) 是否支持遗留的On Error关键字和整个VB6-Namespace


Python

那些我不理解的…

math.ceil() and math.floor() return floats, not integers (probably to avoid an integer overflow in the underlying C function - but why not cast to a Python long?) len() is a function not a method reload() is very limited, does not reload a module 9 times out of 10, only reloads an imported label if it is a module - i.e. cannot do from bar import foo; reload(foo) if foo is not itself a module Mutable default arguments have a single reference (why not a new instance each function call?!) All these underscored variables - if they are so private, how come we see inbuilt ones so much in code? Get a namespace! Strings are not mutable - maybe there is a good reason for this but I have come across many situations where I would like to tweak one particular character ...

那些基于实现有意义但令人讨厌的……

array.sort()不返回数组(我认为它发生在原地) 列表/生成器推导式不定义新的作用域(只是for循环的语法糖,对吗?)

以及几个在Python 3中修复的

默认为整数除法 Global只能引用顶级名称空间


生存巨:

标准库的奇怪之处:它并不总是显示最佳实践,而且文档不足 硬编码FunctionX, TupleX类 缺乏属性:getter和setter是分开的,这违反了DRY,并且使得像FRP这样的事情几乎不可能实现 需要= _来初始化属性


C#

Lack of multiple dispatch based on the runtime type of the method arguments. dynamic should solve most of this, but it hasn't been released yet. Interface implementation is declarative not structural. I really like the way Google's Go language is doing types Making asynchronous method calls is really bulky (and I'm pretty sure all threads are OS threads, not lightweight threads) No macro system. I'm not talking about C-style macros here; I'm talking LISP/Scheme style macros Operators are static methods and their signatures are overly constrained (and you can't create new ones).


我对特尔斐的5分:

Procedures and functions aren't necessarily distinguished from variables if not parameterized (eg, I can have statement such as x := GetPositionOnScreen; instead of x := GetPositionOnScreen();) Try/Finally and Try/Except needs to be nested (stated once before, but it's still one of mine as well). Not case sensitive. Can have a multiple objects (functions, global variables, local variables) named the same and Delphi will happily try to figure out what you mean. names should be unique. Odd if condition rules. a single conditional check doesn't require a () around it, but if I do multiple checks, I need a () around each one, and sometimes multiple nested sets for bigger checks. No inherited includes. If I need to reference functionality from the Windows unit in a base and an inherited form, I have to include Windows in both.


HyperTalk:

很久很久以前就死了 没有简单的赋值(你不能说a:= 3,你必须说把3放进a 没有嵌套函数 没有真正的数据结构,只有字符串。要创建“列表”,您可以使用itemDelimiter分隔项并手动转义它们。你也可以得到行和单词比如txt的第5行第2个单词

说句题外话,我认为HyperTalk最酷的独特功能之一是特殊的it变量:

ask "How many years old are you?"
answer "You are " & it*12 & " months old."

我讨厌Python的地方:

没有编译器 它没有被认真对待

Python让我恼火的地方:

(自我, 没有私人 打破兼容性

我讨厌PHP的五个方面:

“按预期工作”,而这显然是一个bug 没有转到 有bug的引用(foreach $arr => &$val…Foreach $arr => $val) 没有多重继承 没有一个编译器能够真正工作,而不需要向黑暗之神牺牲一只羔羊


Python

没有名称空间。 伪私有属性/名称混淆(主要使用getattr)。 文件路径操作分布在多个模块中。串在一起的os。路径调用是丑陋的,难以读取,并且在大多数情况下违反了DRY。常见的文件路径操作仍然没有方便的函数,比如获取目录下的文件列表。修复此问题的路径类型模块被拒绝。

([f for f in os.listdir('/file/path') if os.path.isfile(os.path. isfile)加入(/文件/路径,f))))

Python文档(我非常、非常、非常感谢有文档,而且它的格式很好,但我讨厌费力地在5000行快速入门使用示例中找到特定模块的单个函数文档(我正在查看optparse和logging))。内置类型在近10个不同的地方被零碎地记录。


Lua

If you do foo.bar(1,2) then 'self' is nil inside the bar method. You must remember to do foo:bar(1,2) instead. I'd rather have that switched ('self' should be defined by default unless you use the ':' operator, or you call a function that isn't a method). Variables are global by default. I'd rather ditch the 'local' keyword and have a 'global' one instead. Undeclared variables are assigned the nil. I'd rather receive an error message. You can sidestep this by manipulating the global env's metatable, but I'd rather have it implemented by default and be able to deactivate it. Multiple returned values on parameters are not handled very nicely. Say you have a function foo() that returns 1,2,3 (three values) and bar() returns 4,5 (two values). If you do print(foo(),bar()) you will get "1,4,5" ... only the "last" tuple is expanded on calls. The # (table length) operator only works in tables indexed with continuous integers. If your table isn't like that and you want to know how many elements does it have, you need to either parse it with a loop, or update a counter each time you insert/remove an element from it.


C++:

1:头文件。

链接代码比编译代码更难。同样,模板在翻译单元中包含完整源代码的要求也是荒谬的。在那边的那个文件里。你两秒钟前编译的那个。去那里看看。愚蠢的编译器。

2:空标准库。

我的意思是,是的,在c++ 0x中有std::thread,但没有std::socket或任何类似的东西。没有跨平台代码的主要原因是,您必须为希望在多个平台上执行的每个函数学习一个新的库。没有作为标准提供的OS头文件或OS函数,c++只适合推位。

3:没有多次返回或返回值重载

Double x, int y, char z = func();和void func(double x, int y, char z)一样有效;请。没有返回值重载的唯一原因是我们“可能”编写了模棱两可的代码。可能!请在我真正写出模棱两可的代码时给我悲伤,而不是之前。

4:不反思

可以将反射设置为编译时反射。的确如此。没有任何库使得编写大量的库变得困难,并且严重地惹恼了我。我可以滥用预处理器,但是..

5:在模板上鸭子打字

Yaargh。请,概念和正确的模板错误消息。使用Boost这样的库实际上是不可能的,因为如果你用错了,你就是在瞎猜。


我刚刚发现,在c#中创建泛型方法时,我不能使用Enum作为类型约束。

微软有一个足够好的解释,但仍然。我疯了

public static T MyFunc<T>(string arg) where T:Enum //wont work :(

JavaFX

Type inference sometimes doesn't behave like you would expect, so you often need to explicitly declare the type. def behaves likes const in C and not final in Java you can insert a value in a sequence by accessing an index >= seq.length, which should actually throw a compiler error (according to the reference). if you assign null to a String, it defaults to "". If you assign null to an Integer, a compiler error is thrown (in contrast to what the reference says). handles CheckedExceptions the same way as RuntimeExceptions


C#

Cannot create a reference (var &t = struct) No local scope destructors (IDispose comes close but its not the same) ToString, i almost dislike that every object has it but it turns out i dislike everything using it like string.format does. I rather have things that accepts a certain type (like ints, floats, text, chars only). So instead of passing in any object i need to pass in something with a implicit typecast or interface. I ended up writing something like this to safely escape text for html which worked great. Cannot use a virtual typecast (blah)obj; does not work if obj does not inherit/has an interface of blah. Simple workaround is to supply an interface with a convert function. Has no local creation. Instead of writing var o = new Item(); i would like to write (something like) Item o() (with an automatic dispose if it has one).


经过一些思考后重写了这篇文章…

虽然我喜欢PHP,但我讨厌它的五个方面(排名不分先后):

内置函数中的命名和参数顺序不一致。 面向对象的数组方法多亏了SPL,但遗憾的是还没有字符串。 PHP本身没有真正的并发,只有通过托管web服务器的多处理 没有像JavaScript那样的异步调用 只能通过扩展进行操作码缓存。不是很糟糕,只是有点烦人。

这些是令我烦恼的语言特性(或缺乏),但更大的问题是这些与人/社区相关的东西:

事实上,很多使用PHP的人,对编程和良好实践一无所知,从而产生了非常混乱的代码。JavaScript也有同样的问题。 大量的教程/书籍传授了非常糟糕的做法和风格。这可能是第三条的主要原因。 它的坏名声主要是因为第三条和第四条。


C#

Reference types are nullable by default; in-language null keyword is untyped. Lack of discriminated unions Exceptions as default, non-exceptional error handling method - there's not much of an alternative. archaic switch statement syntax and limitations Needless distinction between constructors + static methods Static methods can't be part of an interface Lack of by-shape interface implementation rather than explicit interface implementation - leading to numerous language design hacks such as the linq query syntax, foreach, collection & object initializers -- none of which can be flexibly reused. For example, the object initializer syntax may be nice, but plays poorly with immutable objects. Cannot inherit "interface" of a class independently of implementation - leading to code duplications and overarchitected code that provides interfaces, abstract base classes, a few common implementations, and no way to pick and choose the bits of each to use. Also; leads to too many code that's tightly coupled to a particular implementation since it's common to explicitly refer to the implementation type rather than an interface. Cannot multiply inherit via composition since a classes "interface" is tightly coupled to it's implementation; effectively lack of mixins. The above limitations of interfaces lead to a proliferation of virtually identical interfaces that don't overlap naturally in any kind of type hierarchy. IComparable vs. IEquatable vs. IComparable<T> vs object.Equals vs. operator == etc. etc. By extension, making a custom type that satisfies all these things is a lot more work than necessary (in particular for collection classes). Obviously, the language designers realize this, hence the various workarounds for things like linq, foreach and collection initializers which work by-shape rather than by-interface. Redundant use of parentheses and braces rather than layout-is-structure. Return values can be ignored, limiting the effectiveness of type inference. Enums aren't a normal type and can't have methods. Also, enum values aren't typesafe and may be initialized to 0 despite not having a 0 value. Mixing metaphors by lumping flag and non-flag enums together. Lack of proper value type support. Value types can't be inherited, have different constructor semantics, and perform poorly due to CLR limitations. Also, confusing semantics regarding value types: some values are really values (and can't be modified), and others are really non-aliased, non-null references (variables). This gets particularly confusing with regards to the next issue: Semantic distinction between fields and properties, particularly in conjunction with lack of mutability modifier (ala C++'s const) Can't specialize generics Cannot provide default generic type parameters (e.g. factory generics) lack of typedef makes generics a pain to use (using is a limited but good-to-know substitute!) Can't genericize over things other than types (e.g. functions, plain values, or names). This means you can't do something like make a generic implementation of a dependancy property leading to, well, nasty implementations of things like dependancy properties and the overuse of code-snippets and poorly readable code as a result. Limited capability to specify generic type requirements e.g. generic sum method that takes both int, double and a bigint (without tricky and often slow hacks). An interface method implementation or virtual method override cannot return a more specific type or accept a more general type; i.e. limited co/contravariance support even in C# 4.


我讨厌内梅尔的五个方面:

局部函数不能让步 编译lambda的能力有时取决于它是否内联 元组的值/引用类型语义不一致 数组下标和类型参数之间偶尔会出现歧义 缺乏普遍采用


不得不假设我们有语言。我们做什么?


Clojure

Lack of built-in syntax for optional and keyword parameters in function definitions. Sure, you can add it easily enough, but that means library writers don't use it. Pervasive destructuring hasn't proven to be a good substitute yet Lack of method combination (before/after/around methods of the sort found in Common Lisp) Too much reliance on Java interop, e.g. there's no built-in file IO Sometimes I want static typing. This one isn't pure hate; I usually prefer dynamic, and attempts to mix the two have been largely unsatisfactory There's no built-in fast binary serialization format for the built-in data structures, though I hear people are working on it


Python,:

No switch keyword. And NO, dictionary is not a replacement for it. Not even a bunch of elif statements. Inconsistent line break handling. Why can I do: test = (1, 2, 3) And not: from itertools import cycle, islice, izip Why can't I do: if stuff \ and foo \ or bar: return "Formated string with %(arg)s" % \ {'arg': "bloody slash"} without using slashes? There is not one obvious and only one way to do it. Python fails on its motto just like Java failed on "Write once run anywhere". # what somebody from an another language would do if not test.has_key('foo'): test['foo'] = 0 n = test['foo'] = test['foo'] + 1 vs # what an agnostic beginer would do try: test['foo'] += 1 except KeyError: test['foo'] = 1 n = test['foo'] vs # what you end up after looking for dictionary default value in the python doc test.setdefault('foo', 0) n = test['foo'] = test['foo'] + 1 vs # what I would do n = test['foo'] = test.get('foo', 0) + 1 And the worst is that they don't do exactly the same thing. There are subtle differences. Choice between spaces and tabs. There should be no choice. Pick on, set it in stone and stop fighting. Why can you do that: test = {} test['foo'] = 0 but not: test = [] test[] = 0

附注:" ".join(l)是优秀的人。不要抱怨它,这并不明显,但考虑到迭代器模式,这是正确的方法。


C#

我对c#非常满意,但这两个真的让我很恼火:

Constructor-based initialization for immutable classes is less convenient, less intuitive (when you read the code you don't understand what you assign to what), has less IDE backing than inline object initialization. This makes you lean towards mutable classes inevitably. I know this has been mentioned before, but I strictly have problems with initialization syntax for immutable classes. switch is too verbose. Whenever I see a situation where a switch would be proper, I'm really inclined to use an if..else if.. just because it's more terse (~30% less typing). I think there should be no fallthrough for switch, break should be implied, and case should allow comma separated list of values.


Erlang

没有静态推断 就像在哈斯凯尔发现的一样。这 会导致运行时错误和一个 有认真写代码还是使用 透析器(1)发现 差异。动态类型是 慢的:也被认为是慢的; 与C、Java等语言相比,它几乎是未知的; 的lists(3)模块有时相当精简 我缺少用于列表处理的有用函数 (就像在数据。例如Haskell中的List); 让我在每句话的结尾都加上 在从句中,和。最后是后者。


很多人认为Java很慢,但我同意一定程度的使用。

Java是戏剧性的。他们为你想做的一件事提供了很多课程。但是你知道灵活性属性XD。

Java一开始很难,但总是很有趣。

当你写一个简单的代码打印“Hello,World!”请不要使用java !XD我相信我是有道理的。

Java是一种混合,所以不要说它是纯粹的面向对象语言。

还有很多,但我只局限于5个XD。谢谢!


Common Lisp

conditions aren't classes (since classes came later), even though their interface is almost identical some of the names are just weird, e.g., flet / labels (only difference: scope), and defvar / defparameter (only difference: behavior when already defined), or any of the bit-twiddling functions (dpb, ldb, etc.) packages are ... really hard to get right -- every time I think I understand them, they don't do what I want built-in data structures and functions aren't as generic as they could be (e.g., why can't I define my own hash function portably?) multiple namespaces for functions, variables, etc. (I'm not opposed to this in principle, but CL made it too complex; Norvig has said he can't tell from the spec but there appear to be at least 7 namespaces)


length属性很容易与length()函数混淆;请改用size() 在选择器字符串中插入变量的语法('" +$。Month + "')臭死了 $(event.currentTarget)并不总是适用于冒泡和捕获 属性语法("[class='foot']")在选择器语法(".foot")不返回任何结果的地方起作用 包含选择器([class~=done])有时会在JavaScript (this.className.search("done") > 0)工作时失败


Haskell

Sometimes the type system feels backwards. What if I don't want the compiler to infer types for my variables? What if I want the opposite, where it does constraint checking on said variables? For example, instead of inferring the type of the elements of a list, it instead makes sure that they all belong to a particular typeclass. This is a subtle but huge difference that makes it difficult for me to program UIs. It can be done, but it takes more effort than it does in some other languages. Haskell rocks for the non-UI parts, but the UI I leave to an untyped language. Allowing the construction of infinite values leads to some really frustrating errors sometimes. NoMonomorphismRestriction. Bytestring handling bites me in the ass sometimes and you don't know it until your program crashes because you mixed them up improperly. Something is wrong here, when we are losing type information that should have prevented this. Typeclasses should be automatically derived for trivial cases, like witness types, but there's a strong potential for abuse there.


C#

我知道这很愚蠢,但我希望数据类型转换为我自己想要的,而不是我必须添加(int)或转换。ToInt32或者别的什么。这样可以节省我的时间。让我烦恼的是,如果我写了一些东西来输出一个int型,结果我需要一个long型,然后我经常不得不从头到尾修改我所做的一切来让它工作。就为了我!

抱歉,我想不出5个,但我是新手,所以也许我以后会回来添加更多:P


C#

No easy way to check if a type is Numeric It means you are probably stuck using most of the microsoft stack, IIS and MSSQL Instead of being a specific tool for a specific problem, C# tries to be a language for every paradigm. Lack of community. Sure, there are starting to be open-source frameworks and libraries for C#. The same ones that have been available to Java developers for years. Hard to find good help. The internet is littered with poor examples of how to solve problems with C#. This goes back to problem #3.


Erlang不在此列表中。在我最喜欢的语言中,但有一些缺陷是肯定的:

Syntax. This includes the 3 terminating tokens (,;.) and aesthetics, but more generally on how the semantic meaning of the code is expressed in text. An example is on how all lowercase tokens are atoms, so to refer to a function you can't just name it, you have to fun my_function/1, and ?PRECEDE_CONSTANTS_WITH_QUESTION_MARKS. Coming from Scheme, Haskell, etc. you just wish you could use a name. Library support is lame. This is mostly external libraries, but even the old standard library. Newer versions of Erlang have sensible POSIX regexes, but the old one had a pretty horrible library for basic string manipulation. You also never know when you're getting the value, or {ok, Value}. Related: non-uniform tools for building and distribution. Ruby has gem and rake, RSpec. Perl has CPAN. I'm unaware of decent equivalents in Erlang. The few Erlang specific tools are pretty strange. Mnesia is a great database, but coming from SQL you have lots of trivialities to learn. Same with the documentation @spec, which has a strange way of describing signatures. Often the functional paradigm hurts when you just want that little bit of mutation. Supposing you want a Hash Table, you can't just hack it as in Scheme, or SML. ets and dets alleviate some of the pain, but not much.

第六,奖金:

模块的导入和导出语法是一堆失败,这与Java的80多行导入语句没有什么不同。

综上所述,Erlang是一种乐趣^_^


下面是关于Perl 5的更多内容,来自创建了大量Perl模块,特别是在Moose上工作过的人的观点。

The horrible brokenness that is overloading and tied variables. Both of these features are a failed attempt to allow transparent extension to the built-in types. They both fail in various ways, and require module authors like myself to either implement horrible hacks to support them, or to say "never pass an overloaded object to the foo() method". Neither alternative is really acceptable. Lack of proper hooks into the compilation process and the meta-model. Moose in general, and role usage in particular, could be made much safer if the Perl core allowed us to affect the compilation process via a sane API that allowed us to hook into the meta-model (packages, classes, etc.) Lack of named parameters built into the language. Instead, everyone reinvents this. It's annoying. Similarly, lack of optional types. I don't want a static language, but the ability to specify types and constraints, particularly on function/method parameters, would be great. Perl 6 gets this right. Types are optional, but very rich, and there's no fundamental difference between built-in and user-defined types. The backwards compatibility police. This is more of a cultural issue. A number of the above issues can never really be fixed, since Perl 5 has a very strong commitment to backwards compatibility. So even if something were to be added that effectively replaced the current ball of shit that is tie and overloading, those features will never be removed. Of course, backwards compatibility is also one of Perl 5's greatest strengths. Bonus hate: Perl's built-in exception mechanism is a joke. The fact that exceptions may be a string or object makes for an eternity of fiddly exception-catching code, and the lack of a catch in the language syntax is the wart on the wart.


我讨厌c++的五个方面

联系时间。使用分布式构建,我可以在同一时间重新构建我们的整个项目,它需要我们的链接器运行。 没有防止内存操作重新排序的标准方法。使用写组合内存通常需要滥用volatile关键字。防止读重排序(在处理SIMD数学管道时通常是优化的关键)通常是通过在例程中间注入空ASM块来实现的。 多步宏来解决字符串化问题:

#define STR_LINE2(x) #x
#define STR_LINE(x)   STR_LINE2(x)
#define LINE_NUMBER STR_LINE(__LINE__)

做字符串操作通常是很痛苦的。 大量的非标准化printf变体(vsnprintf_s vs _vsnprintf_s)。


SAS

从不有自己的想法(一切都是借来的)。 贪婪于庞大的数据集。 使用Java,但从未学习过什么是对象。 窃取Perl,但将其隐藏在其数据步骤中。 统计学家总是撒谎!


JavaScript

ECMAScript 5规范:

7.6.1.2未来保留词: 类,enum, extends, super, const, export, 进口 严格模式:实现、let、private、public、interface、package、protected、static、yield 11.9.4严格等于操作符(===)对比11.9.1 TheEqualsOperator(==) 11.9.6严格相等比较算法(NaN === NaN is false) 8.5数字类型-没有实整数,所有都是浮点数。 4.2.1对象——原型继承

好吧,我有点喜欢最后一个,但它有7种让人困惑的地方


C++

cryptic error-messages when templates are involved lack of template constraints (many cases can be worked around with template metaprogramming, but this will result in unreadable code (at least for average programmers) in most cases) pointer to member-function syntax c++ standards committee should release offical standards more often (or at least release separate updates to the standard library itself), i mean really TR1 was released 2005, and we still dont have a shared_ptr, bind and alike in the standard library. -


但这只是因为VB6毒害了整整一代程序员

我在一个曾经是VB6商店的VB . net商店工作,而在这里工作的每一个曾经是VB6开发人员的人都顽固地拒绝学习任何关于. net的知识。他们编写的代码就像VB6一样,他们的应用程序就像VB6应用程序一样糟糕。我的老板非常不鼓励使用LINQ,因为她担心其他人很难理解,这是事实,因为没有人想要理解它。

我认为如果微软只使用c#,我们会过得更好,这让我很难受,因为我认为花括号远不如VB的冗长结束语句。


关于c#:

I hate that there is no keyword to specify which exceptions are thrown from a method like in java. Its a much better way to document exceptions than using an XML comment. I would also want a much better syntax for generic constraints like oring and anding of constraints. Why a method can't return more than one value? Lack of support for aspect oriented programming in the language. Why can't you annotate each one of the property accessors with an attribute? Lack of builtin regexp support like in perl.


R

不是我最喜欢的语言,但我经常使用它,有很多抱怨……

S3对象只是美化了的列表,S4类仍然将所有数据公开给用户 赋值操作符可以是<- ->或=,参见Mike Dewar的咆哮 我的。var是一个非常令人困惑的OO语言变量命名约定,参见谷歌的风格指南 我不应该后悔使用循环 神秘的错误消息


Ruby。

Strange scoping rules - variables, constants, and methods each behave differently from each other. The rules change also depending on which keyword you used to create a closure. Or on whether you're in a class, eigenclass, object, module, or module's self. Then there's instance_eval, which changes the rules to a different set of rules. And they change again when a module is "included" or "extended", which themselves do different things to scope. And some sets of rules can't be emulated by metaprogramming, so you have to use eval. Unless you're on ruby 1.9, where all of this is different. Namespacing is basically useless. If you have Foo::File, then the stdlib File is probably broken for all of Foo. require statement is broken. If two files require eachother, the behavior of those files can change dramatically depending on which is loaded first from elsewhere. libraries change APIs dramatically and suddenly, so you have to require specific minor revision numbers of all of your dependencies. For every single ruby application on your system. The rubygems package system overrides "require" rather than putting files in the search path - because why use a system when you can replace it?


Python 3

both tabs & spaces allowed for indentation And you'd think people learn from the past (Makefile). Just pick spaces and forbid tabs. YAML got it right. lack of popular third-party libraries The standard library is great, but a lot of what makes Python 2 so powerful lies in the third-party realm. Python 2 got this right :-). IEEE floats Floating points in programming languages are confusing because they're different from the way we use them in math. Instead, the number operations should be viewed as expressions that are only converted to a decimal point format when needed (i.e. printing to a screen). Maple and Mathematica did this right I think. the character set for identifiers is too restricted list.empty? is better than list.is_empty or even len(list) != 0. Similarly, process.kill! would be better than process.kill. Ruby and lisp got this right. when calling a function you must always write parentheses It would be nice if we could omit them in unambiguous cases. How is it again? dict.items or dict.items()? Ruby got this one right, too.


Python

Standard library disobeys their own style guidelines in many places. (PEP-8) Py3k's super keyword is full of unwanted magic (you can't assign it to a different name, works without self, why do we have this explicit parameter at all?) Unicode support is incomplete in Py2k and sucks in Py3k (standard input in unicode, no binary data! WTF? Creating a new WSGI standard is hacky.) The GIL. Very limited multi-threading support (with CPython) PyPI (Python Package Index) sucks. Envious glance at rubygems


Python:

No standard GUI toolkit (the community goes round and round about this but never seems to settle on anything). The evolution of tools and methods to distribute and install Python apps and libraries has been, well, rocky. (Although lately this seems to be moving closer to getting fixed.) CPython is still slow as interpreters go (although PyPy is looking pretty good these days, if it becomes the "standard" Python this problem goes away). You can't subclass built-in classes (e.g., list and dict) without overriding a lot of methods, even if all you want to do is a simple hook into an event (e.g., to hook into an item being added to or removed from the list, you need to override delitem, append, extend, insert, pop, and remove--there's no subclassable "change" event notification, nor any "protected" methods that factor out common code used by all the above methods). Up until virtualenv was invented, keeping separate Python environments for different purposes on one machine was a real pain.


PHP:

荒谬的assert()函数…它对里面的代码运行eval() ?>标签删除了它后面的换行符?! 奇怪的数字字符串处理(尝试将它们作为数组键) 令人痛苦的unicode支持似乎将不再被PHP 6解决 入门成本低意味着95%的人给PHP程序员起了一个可怕的名字——试图在这5%中找到一个人来雇佣是疯狂的。


Python

没有Django for Python 3。 静态类型。是的,动态类型是很棒的东西,但有时我确实想让它成为静态的。 正确的unicode支持(在Python 3中修复) Construtors命名。我讨厌代码中的所有这些下划线。 线程的效率不是很高


Scala是我最喜欢的语言。五件讨厌的事?容易:

Takes a long time to learn properly. I know you can write Scala as a 'better java'. That is what we used to say about C++ and C too. I agree this is an inevitable consequence of the deep ideas in the language. But still ... Methods vs. Functions: def f(x: Int) = x*x defines a method f, not a function f. Methods are not functions despite a lot of early Scala tutorial material blurring the distinction. The language tries to blur it too because if you supply a method in some places where a function is expected it is accepted. Do we have to have both methods and functions? Yes it is fundamental. But it was initially confusing to me. Composing classes or objects from mixins in the 'cake' pattern is prone to NPE's. e.g. trait X { val host: String; val url = "http://" + host } is a mixin that will NPE on instantiation, or not, depending on its position in the class declaration. The compiler could tell you if it will fail but doesn't. (In 2.7 anyway.) It is hard to diagnose the problem in complex inheritance graphs. Arrays in 2.8 rely on implicits to mesh with the main scala collection types. But implicits are not applied everywhere. An Array can be supplied where a Seq is expected. But an Option[Array] cannot be supplied where an Option[Seq] is expected. I know there are no completely 'right' ways to handle java Arrays. Type erasure. Enough said.


Python:

没有分隔符表示块的结束会导致歧义,这样自动缩进就不能处理格式不佳的代码。 没有宏(修饰符不算) 没有像haskell的cabal或perl的CPAN那样的库自动获取 不能声明变量const(是的,可以自己定义变量,但是…) 元编程被削弱 差点忘了全局解释器锁


BrainF * ck

你的亮点是图灵完备?!我可以在Perl正则表达式中做更多的事情! 缺少对象。来吧,人!就像,你好… 没有网络库。我只想刮一个网页,天哪。 没有一级函数。恭喜你——你可以同情你的Java朋友了。 一个无限的磁带存储,没有其他。这是如此的矫情,我们可能还在写Lisp。


我只有一个,但我相信它值得分享。

CSharp / .NET

我们有Length属性来获取数组中的元素个数,还有Count属性来获取集合中的元素个数。如果考虑到CLR在后台自动将IList、ICollection、IEnumerable添加到基于零的一维数组,那么它看起来就更奇怪了。

我相信CLR团队和BCL团队在讨论这个问题时遇到了困难;)


C#.

我最讨厌的是:

No multiple inheritance - imagine you could provide whatever GUI framework base class (Control, Window, whatever) with MVC - related stuff, etc... framework / base class agnostic! No "friend" keyword... I know, the RAD - victims would abuse it for all kinds of stinky code and for hilarious malpractices, but it would be nice for the OOD - guys to enforce the law of demeter No language integrated DBC features, there are the Contracts, but I would rather have that Spec# - style with a general purpose "!" - postfix operator No AOP (I don't get it... this language has attributes, it would have been SO EASY to add interception code in the compiler!) No weak event delegates - the observer pattern becomes nothing but a memory leak bait as it is now... :-(


帕斯卡对象:

There's a lot of jumping back and forth in the file you're editing since the interface and implementation are split into two parts but still jammed into the same file. Dynamic indexing of arrays, strings start at 1, you specify the starting index when declaring fixed arrays and dynamically allocated arrays always start at 0. Classes and objects (not to speak of interfaces) are bolted on top of the language and among other things can't be stack allocated like records can. When calling functions without parameters the () are optional, leading to a lot of pain when you are dealing with function pointers or trying to refer to the result of a function using the function name. Parameter lists can't handle fixed array types or function pointer types without external type definitions.

这仅仅是一种语言,一个标准库的遗憾借口,而脆弱的IDE应该有自己的列表。


Java -不支持语言级别的组合


德国

我的母语……虽然它听起来比克林贡语更美,但它是一个语法地狱……

conjugations: even regular verbs have different forms for each person and time (with few exceptions)... Example: I see, you see, he/she/it sees, we see, you see, they see translates into: Ich sehe, du siehst, er/sie/es sieht, wir sehen, ihr seht, sie sehen. polite form of address: equals 3rd person plural, used to equal 2nd person plural in the middle age... I really hate the concept of distinguishing between "Du" and "Sie" for my philosophy is that each human being should be considered equal in the amount of respect for it deserves (I mean, what are swear words for, hm?) punctuation: show me a language that uses more commas regularly! missing suitable words: eg. there's no real German equivalent of "convenience" or any derivate of this word... in almost every case you just can't translate it into another German word and keep the meaning... instead you would have to make up a whole subset to describe it somewhat adequate... Anglicisms and Denglish: Sure, the English language has "Kindergarten" or "Poltergeist" and what not but the German language is overflowing with Anglicisms nobody needs... Even worse: We redefine some words we adopt, eg. in German "Handy" means a cell phone and has nothing to do with the adjective it is in English... There are influxes on grammar as well, leading to "Denglish" expressions (see linked article at Wikipedia) There's more, but I don't want to exaggerate this and those are my personal Top5 of what I hate about the German language...


我讨厌所有语言的五件事(至少就我所知):

Does what I say/type, not what I mean Will undoubtedly meet people who think they are experts in the language, but just make a mess of it (e.g. people who insist that removing comments/unused local variables will speed up execution time for a program) Unless the language is obsolete, then it will probably continue to evolve (either the actual language, or the concepts behind using it effectively) requiring you to actively develop with it so as to not fall behind. Can't modify the lexer/compiler (add in own context sensitive grammar) No perfect language (every language is missing some sort of useful feature that usually is either impossible to simulate, will unavoidable have an ugly interface or just require far too much time to implement and get it right)


objective - c 2.0

严格遵循语言和运行时,而不是库,并且没有任何特定的顺序:

Lack of cVars. No modules. I'm not terribly unhappy with a lack of namespaces, but modules would be nice to have. Ivar-based property syntax requires declarations using the variable name in 3 places. It's fairly hideous. C heritage. Anything to hate about the C language, except for OO and GC, is present. Objects can't live on the stack. Not a problem with Obj-C so much as what it does to programming practices in other languages. I find it strange when I get a return value on the stack in C++, for instance. If I'm not actually looking at the library documentation when I write the code, I'll assume that every function returns a pointer, which often makes for some siginificant cleanup later.


c# 4.0

“动态”关键字,被滥用的时机已经成熟。如果你想要/需要使用反射,使用并让它明显地显示你正在使用它,不要试图用动态来伪装它。


Python:

1) line continuation syntax: "...\" works, but "...\ " does not, and that trailing space is generally invisible, without unusual eol-marking by editer. 2) a bare 'raise' is invisible in the stack trace, as the stack trace looks like the previous raised exception. 3) slow 4) poor integration into web-servers (mod_python: dead, mod_wsgi: limited scope of operation). This is complicated by 3], requiring daemonization or some sort of memory-persistance to perform well. 5) overly tolerant of mixed tabs and spaces, allowing changes to control flow to sometimes remain hidden. (maybe fixed in recent versions)


Java:

很不一致。 图形api有时使用起来很痛苦 nullpointerexception不会告诉你什么是null 我写的程序有时不能在不同的JVM上运行,这是一个巨大的痛苦,与Java的“一次编写,随处运行”语句相矛盾。 Swing并没有达到应有的效果。


Python:

You usually have the entry point of the program at the end of the file. (Because if it calls any function defined in the module, it has to occur after those functions in the sources.) I hate it when you have to spend time looking for the entry point of a program, so I always have a simple main.py file with: def main(): ... if __name__ == '__main__': main() When an exception is raised, it can only be catched by the main thread. Or something like that. Destructors are quite useless, because when written in Python they may break garbage collection IIRC. I've never figured out how relative imports work in Python 2. I'd like to see more collections in the standard library. For example: linked lists, thread-safe collections, ...


Lua:

元表是如此令人困惑,直到他们“点击” 缺少像a += 20这样的赋值操作符是一种痛苦 没有集成的面向对象的解决方案意味着每个人和他的狗都使用自己的口味 用于注释(——)的语法排除了加/减前后操作符的可能性 不入侵C端就不可能有任何先发制人的多任务系统


按最讨厌到最不讨厌的顺序排列。

1.) Backwards compatibility police. Yes backcompat is a strength but Perl 5 takes it too far. Now we don't really even get new features in our language without having to enable them explicitly. I'm much prefer the inverse, if a new feature causes a problem let me disable it or enforce old behavior. e.g. perl 5.10 added say I'd rather have no feature 'say' if I have my own say implemented than have to put use feature 'say'; or use 5.010; also if 5.8 worked but 5.10 didn't. I'd rather have use 5.008; to restrict my code to only use features available up to and including 5.8 if no use version; was defined then it should be defaulted to whatever version you're running, and a recommended practice of not to restrict it unless you have to.

2)。过度的样板。

#!/usr/bin/perl
use strict;
use warnings;
use utf8;
use autodie;
use English '-no_match_vars';
use 5.010;
package Package::Name;

BEGIN {
    Package::Name::VERSION = 0.1;
}

sub somesub {
    my $self = shift;
    my ( $param1, $param2 ) = @_;
}
1;

现在你可以开始编码了。这不会因为第一条而改变。当然也有一些捷径,比如使用common::sense;或者使用modern::perl;这将缩短上面的内容,你可能需要一些稍微不同的模块或pragma。但因为第一条,我们永远无法把它降低到。

#!/usr/bin/perl
package Package::Name 0.01;

sub somesub ( $param1, $param2 ) {
}

一些模块正在帮助这一点,在5.0.12中有新的包版本,它完全允许这种语法,尽管我认为它需要使用5.012;首先,和Method::签名,但它永远不会完全解决,(在语言)。

3)。糟糕的变量选择

吸吸文件

#!/usr/bin/perl
use strict;
use warnings;
open my $fh, "< foo" or die $!;
local $/; # enable localized slurp mode
my $content = <$fh>;
close $fh;

WTF是$!和美元/ ?重写为易读。

#!/usr/bin/perl
use strict;
use warnings;
use English '-no_match_vars';
open my $fh, "< foo" or die $ERRNO;
local $INPUT_RECORD_SEPARATOR; # enable localized slurp mode
my $content = <$fh>;
close $fh;

不要忘记,如果您不想受到性能影响,'-no_match_vars'必须存在。

不直接创建匿名标量怎么样?

#!/usr/bin/perl
my $scalar_ref = \do{ my $anon_scalar };

他们就不能想出点什么办法吗?

#!/usr/bin/perl
my $scalar_ref = <>;

哦,perl是线程不友好的,因为所有的变量(包括特殊的变量)默认是全局的。至少现在你可以使用我的$_;对其词法作用域,并对其他词使用local。

4.)非常难看的语法

MooseX::Declare是一个更好的语法。我也希望->被替换为。(个人喜好不太重要)

5)。太多的TIMTOWTDI或太多的最佳实践似乎你必须读3-5本书才能弄清楚你应该如何做事情。

6)。以前的(不再适用)。Un-sane版本。5.10.0有新功能5.10.1的新功能没有设定时间,直到下一个版本。现在是每年一次的特性发布,每季度更新一次。

7)。象牙塔视角。社区问题,似乎是许多开发者想要设置更高的准入门槛,并认为可以不尊重n00b(或任何不同意他们的人)。

8)。疯狂的版本号/字符串Perl有浮点版本号,它们很难看。开发人员不知道并不是所有的下游处理版本比较的方式都是一样的。不是语言问题

0.012 # simple
5.012001 # semantic 
4.101900 # time based + version (for multiple versions in a day)
0.035_002 # prerelease

所有有效版本的perl..我们就不能用…

0.12 # simple
5.12.1 # semantic
20100713 # time based (just use the date and be careful not to need to release more than 1 a day)
0.35-beta2 # prerelease

除了

9)。升级后没有明显的方法重新安装所有XS模块


Python (3.1)

奇怪的无序T if C else F语法用于条件语句。 字节字面值看起来太像STR字面值了。我们应该得到x'414243'而不是b' abc '。 str在某些平台上是UTF-16,在其他平台上是UTF-32。(尽管至少比2要好。x字符串。) 具有相同的加法和连接运算符。这对numpy.array这样的类型很不利。 运行缓慢。


EL -表达式语言,${…}和#{…JSF 2.0 Facelets用于从底层Java代码中提取数据。

All the fun things, like method calls with parameters and annotation based naming is only present in the EL in Java EE 6 which is only available in Glassfish v3. It is a royal pain to 1) get the right jars for an earlier Servlet 2.5 container, and 2) getting them to work without interfering with any previous implementation available in the container. Having only an earlier version of JSF like 1.2, takes away the method calls and leave you to work with f:setPropertyActionListener - http://weblogs.java.net/blog/2009/07/22/say-sayonara-spal - which, trust me on this, is not very nice. The EL parser has no idea of where the snippet it is to parse and interpret came from, so you tend to give everything an id so you at least can identify which tag made it grumpy. Eclipse gives a warning at every EL method call as it is JSF 1.2. only too.


Lua:

The built-in error system is absolutely horrendous You can implement a try-catch system by modifying the Lua interpreter; but it has no compatibility with the errors that are thrown by the built in functions. The fact they have __newindex instead of __setindex as the setter ... and __newindex is only fired when the key doesn't already exist. If it does, no metamethod is called at all. No good type comparison system. There's the type() function but it only handles the basic types (all tables are tables). It really needs to have a metamethod for type comparisons. I've implemented this before with an 'is' operator and a __type metamethod and it works really nicely. It's a bitch to define new keywords. You can do it, but the code inside Lua isn't well documented so it's kind of trial and error to find out how to get the result you want. This is a major issue when you want to implement the things I mentioned above yourself (not so much __setindex though, that's an easy modification). I can't use it in a web browser. Yeah not really a problem with the language itself, but damn, would I love to be able to use Lua instead of Javascript... :)


C

字符串处理 内存管理(决定谁应该分配内存,谁应该释放内存) 没有名称空间(最大的) 标准库中没有列表/数组和其他基本DS

JavaScript

使用不带var的变量会自动使其成为全局变量 分号不是强制性的 比较运算符“==”和“===”以及它们用法上的混淆 没有适当的支持来处理二进制数据 再一次. .没有命名空间 变量没有块作用域。(来自C世界的人很讨厌)


到目前为止,我最讨厌我最喜欢的语言的地方是我的选择总是在变。每次我以为我找到了命中注定的那个人,我就会发现我讨厌他的5个(或更多)地方。然后那边的草看起来更绿……