good programmer habits

19
GOOD PROGRAMMER HABITS It’s about doing the right things Kodelokus

Upload: kodelokus

Post on 23-Jun-2015

1.404 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Good programmer habits

GOOD PROGRAMMER

HABITSIt’s about doing the right things

Kodelokus

Page 2: Good programmer habits
Page 3: Good programmer habits

BE LAZYWoot??

Page 4: Good programmer habits

I’m not sure I’m doing something useful

Page 5: Good programmer habits

Class FindUniqueWord {

def alphabets = [‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’, ‘g’, ‘h’, ‘i’, ‘j’, ‘k’, ‘l’, ‘m’, ‘n’, ‘o’, ‘p’, ‘q’, ‘r’, ‘s’, ‘t’, ‘u’, ‘v’, ‘w’, ‘x’, ‘y’, ‘z’]

function getWeight(String word) {

int weight = 0;

for (i=0; i<word.length(); i++) {

for (j=0; j<alphabets.length(); j++) {

if (word.chartAt(i) == alphabets[j])

weight += j;

}

}

return weight;

}

function getUniqueWords(String[] words) {

List<int> unique = new ArrayList<int>();

for (i=0; i<words.length; i++) {

int weight = this.getWeight(words[i]);

if (!unique.contains(weight)) {

unique.add(weight);

}

}

return unique.count();

}

}

Class FindUniqueWord {

function getUniqueWords(String[] words) {

List<String> unique = new ArrayList<String>();

for (i=0; i<words.length; i++) {

char[] c1 = words[i].toCharArray();

Arrays.sort(c1);

if (!unique.contains(new String(c1)) {

unique.add(new String(c1));

}

}

return unique.count();

}

}

Find the number of unique word by letter combination

(`aab`, `aba`, `bba`, `baa`) = 2 unique words

simpler, more efficient, need less time

Page 6: Good programmer habits

What I Imagine When I’m Coding

Page 7: Good programmer habits

The Reality…

Page 8: Good programmer habits
Page 9: Good programmer habits

The Point of being lazy is, you stop doing anything but think, to find an easy way to solve.More simple means less bug.

Page 10: Good programmer habits

the greatest enemy of lazy!

So prepare before he come…

Page 11: Good programmer habits

Gather all mighty equipment and weapon while you can

I hope can win with just one click

Page 12: Good programmer habits

CONCEPTUAL

Page 13: Good programmer habits

Imagine if I’m an Architect

Page 14: Good programmer habits

Software Architecture

Object-Oriented

Functional

Imperative

Logic Programming

Encapsulation

PolymorphismInheritance

Abstraction

Programming Paradigm

Design Pattern

MVC

Observer

SingletonBuilder

Abstract Factory

Adapter

Decorator

Strategy

Programming Technique

Anonymous Function

Inner Class

Dependency Injection

Multi threading

Software Development

Event Driven Development

Domain Driven Development

Service Oriented Architecture..?

Page 15: Good programmer habits

WTF?

Page 16: Good programmer habits

The invisible one is impossible to noticed

Unless we understand our coding in design perspective

Page 17: Good programmer habits

PASSION

Page 18: Good programmer habits

That’s Interesting ….

Page 19: Good programmer habits

And to improve, simply you need to enjoying the process…..