Victor Hugo Germano apresenta sua visão sobre profissionalismo e os desafios na adoção de metodologias ágies.
Através de uma linguagem lúdica, conceitos relacionados a Qualidade, Teste de Software e comprometimento.
76. class Email {
public Email() { ... }
public void setFrom(String from) { ... }
public void setTo(String to) { ... }
public void send() {
// YOUR HOT CODE HERE
}
}
http://guilherme.pro/2009/04/05/why-i-dont-write-code-comments/
78. new EmailMessage( )
.from(quot;teste@localhost.netquot;)
.to(quot;destination@address.comquot;)
.withSubject(quot;Fluent Mail Examplequot;)
.withBody(quot;What a nice code!quot;)
.send();
http://guilherme.pro/2009/04/05/why-i-dont-write-code-comments/
80. What is a Clean Code?
“Quando você olha para o código, percebe que
ele faz exatamente o que você esperava”
Howard Cunningham
http://railsconf.blip.tv/file/2089545/
82. // create some properties and get the default Session
Properties props = new Properties();
props.put(quot;mail.smtp.hostquot;, _smtpHost); WTF?!
Session session = Session.getDefaultInstance(props, null);
// create a message
Address replyToList[] = { new InternetAddress(replyTo) };
Message newMessage = new MimeMessage(session);
if (_fromName != null)
newMessage.setFrom(new InternetAddress(from,
else
_fromName + quot; on behalf of quot; + replyTo));
WTF?!
newMessage.setFrom(new InternetAddress(from));
newMessage.setReplyTo(replyToList);
newMessage.setRecipients(Message.RecipientType.BCC,
_toList);
newMessage.setSubject(subject);
newMessage.setSentDate(sentDate);
// send newMessage WTF?!
Transport transport = session.getTransport(SMTP_MAIL);
transport.connect(_smtpHost, _user, _password);
transport.sendMessage(newMessage, _toList);
83. new EmailMessage( )
.from(quot;teste@localhost.netquot;)
.to(quot;destination@address.comquot;)
.withSubject(quot;Fluent Mail Examplequot;)
.withBody(quot;What a nice code!quot;)
.send();
http://guilherme.pro/2009/04/05/why-i-dont-write-code-comments/
109. Findbugs
DE_MIGHT_IGNORE: Method might ignore exception
MS_SHOULD_BE_FINAL: Field isn't final but should be
SBSC_USE_STRINGBUFFER_CONCATENATION:
Method concatenates strings using + in a loop
NP_NULL_ON_SOME_PATH: Possible null pointer
dereference in method
NM_CLASS_NAMING_CONVENTION: Class names should
start with an upper case letter