TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Introducing Malicious Code Reviews

28 pointsby jasonmcover 16 years ago

5 comments

jbarciauskasover 16 years ago
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>)
cschneidover 16 years ago
Is the PHP community open to refactorings of the code? Do they have the tests in place to make that possible?
评论 #452029 未加载
评论 #451179 未加载
slackerIIIover 16 years ago
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.
tptacekover 16 years ago
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 未加载
coliveiraover 16 years ago
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.