技术宅,fat-man

增加语言的了解程度可以避免写出愚蠢的代码

导航

07 2014 档案

一个消除if语句的例子
摘要:// 一个按钮点击事件,判断点击按钮是那一个显示出他的信息- (IBAction)buttonPressed:(id)sender { if (sender == self.leftButton) { NSLog(@"%@", self.leftButton.currentTit... 阅读全文

posted @ 2014-07-15 19:04 codestyle 阅读(1309) 评论(0) 推荐(0)

转载:如何避免代码中的if嵌套
摘要:http://top.jobbole.com/4960/http://stackoverflow.com/questions/24430504/how-to-avoid-if-chains在Stack Overflow上的一个挺有趣的问题,详细整理问题和部分巧妙的回答如下。假设我刻意写了一段代码:b... 阅读全文

posted @ 2014-07-09 10:35 codestyle 阅读(1205) 评论(0) 推荐(0)

java程序编译
摘要:Empoyee.javapackage Company;public class Empoyee{ String name = ""; public Empoyee(String name) { this.name = name; } public Str... 阅读全文

posted @ 2014-07-08 20:30 codestyle 阅读(318) 评论(0) 推荐(0)