TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Introducing Malicious Code Reviews

28 点作者 jasonmc超过 16 年前

5 条评论

jbarciauskas超过 16 年前
I showed this to my roommate, and he mentioned in his product, the lexer is similarly written. The reason for this is, apparently, it is a really simple way of implementing a finite state machine.<p>Wikipedia mentions the pattern as well:<p>"The lex/flex family of generators uses a table-driven approach which is much less efficient than the directly coded approach. With the latter approach the generator produces an engine that directly jumps to follow-up states via goto statements. Tools like re2c and Quex have proven (e.g. article about re2c) to produce engines that are between two to three times faster than flex produced engines.[citation needed] It is in general difficult to hand-write analyzers that perform better than engines generated by these latter tools." (<a href="http://en.wikipedia.org/wiki/Lexical_analysis" rel="nofollow">http://en.wikipedia.org/wiki/Lexical_analysis</a>)
cschneid超过 16 年前
Is the PHP community open to refactorings of the code? Do they have the tests in place to make that possible?
评论 #452029 未加载
评论 #451179 未加载
slackerIII超过 16 年前
Yawn. Sometimes, code is both messy and perfectly functional. At that point, the best thing for the business/community is to spend time thinking about something else until you need to make changes to that chunk of code.
tptacek超过 16 年前
The best you can come up with is how tangled the code in a hand-written lexer looks? I may have skimmed a bit towards the end, but, did you actually find a bug?
评论 #451305 未加载
评论 #451188 未加载
评论 #451148 未加载
coliveira超过 16 年前
This guy is not doing a fair review. He is just badmouthing the code without providing alternatives. The code doesn't look good, but a constructive review would be much more appreciated by everyone. By acting this way, he is just making a fool of himself.