Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
Martin Fowler, "Refactoring: Improving the Design of Existing Code"
we're not kids anymore.
ojovivo
sheepfilms
DEAR READER
Misplaced Lens Cap
i don't do bad sauce passes
styofa doing anything
Cosmic Funnies

Andulka

shark vs the universe
Monterey Bay Aquarium
Show & Tell
h

Kiana Khansmith
NASA
tumblr dot com
Sade Olutola

ellievsbear

No title available

Origami Around
seen from Italy

seen from Germany
seen from United States
seen from United States
seen from United States
seen from United States
seen from United States

seen from Italy

seen from Singapore
seen from Germany
seen from United States

seen from United States

seen from United States
seen from United States
seen from Belarus
seen from United States
seen from United States

seen from Germany
seen from Argentina

seen from South Africa
@thisitgurl-blog
Any fool can write code that a computer can understand. Good programmers write code that humans can understand.
Martin Fowler, "Refactoring: Improving the Design of Existing Code"
buffer refers to a small portion of memory that is used to hold the characters before they are read by the program.
Java A Beginner's Guide, 5th Edition
'Bit' is short for 'Binary digit'
Language Random: Using '_' in ints in Java
In JDK 7, you can insert underscores ('_') in between digits to make it more readable!
Example:
// before
123456789
// after
123_456_789
See how much more readable it is? :) In compile time, the underscores are discarded but this really helps code readability ( o u o)b
Language Random: Java's Type Promotion Rules
Another interesting thing I learned about Java!:O
When Java evaluates an expression, Java promotes the different types within the expression so that they are all converted to the same type. The rules explained briefly in "Java A Beginner's Guide" by Herber Schildt:
First, all char, byte, and short values are promoted to int. Then, if one operand is a long, the whole expression is promoted to long. If one operand is a float operand, the entire expression is promoted to float. If any of the operands is double, the result is double.
So given this code:
byte byte_var = 10;
byte_var = byte_var * byte_var;
This will create a compile time error. To fix this you have to cast the result of the expression to match the type of the variable it will be assigned to, like this:
byte_var = (byte)(byte_var * byte_var);
Language Random: Java if-condition
I've been studying Java lately and I just learned something weird about it (coming from a C background).
I learned that if-conditions ONLY accept boolean expressions! You might be thinking, "Well duh!". But here's the catch, since it only accepts boolean expressions, an if-condition like this would generate a compile-time error in java (I'm using JDK7):
if (1) {
// some code here
}
This is not valid in Java! :O I'm definitely mind blown *A*.
Just something random I learned xD
Legacy Code
Like I mentioned on my previous post, I'm going to share here the introduction of one of the chapters in The Cucumber Book. I was really struck with the whole intro that I couldn't resist bookmarking it and sharing. So here it is:
In the real world, you don’t always get the luxury of working on shiny new code. Reading a book like this can be a little bit frustrating because the examples all deal with nice, simple problems, usually in a new codebase.
We all know that software development isn’t really like that.
Even in the best teams we’ve worked on, there have always been a few dark and ugly corners of the codebase where nobody really wanted to go. People would sometimes disappear into there for days at a time and emerge exhausted and confused, blinking in the bright sunlight.
Like an old abandoned mine, those areas of the codebase are dangerous. The code is fragile, and the slightest change can cause other parts of the code to collapse and stop working. Everyone knows this, and that’s why people are reluctant to go in there: it’s stressful work.
If you had to go down an old mine tunnel, what would you do to make it safer? You’d probably build some scaffolding to hold the roof of the tunnel up so that it didn’t collapse—just enough to help you get in and get out again safely.
You can think of automated tests like this. When you have to make a change to an area of the code that you know is brittle, it’s scary. What is the thing that you’re most afraid of?
Breaking something.
It speaks the truth!haha This just really hit home for me :)
The Cucumber Book
Long time no post! I'm just going to share with you what I've been up to recently.
Going Green with Cucumber!
Our team decided to use cucumber for our Automated tests so it was my pleasure to read, "The Cucumber Book: Behaviour-Driven Development for Testers and Developers" by Matt Wynne and Aslak Hellesøy.
This book was fairly easy to follow and introduced alot about the inner workings of Cucumber and how everything is wired up in the project. The book uses Ruby for the actual step definitions but the book says that you don't need to learn Ruby to follow the book. Indeed, I was able to follow the samples in the book even with no experience in Ruby :)
Quotable Quotes
As always, when I read books, I always jot down some text from it that struck me the most. So, here they are:
When writing scenarios, here’s a really important concept you need to grasp: 'Each scenario must make sense and be able to be executed independently of any other scenario.'
When writing a scenario, always assume that it will run against the system in a default, blank state. Tell the story from the beginning, using Given steps to set up all the state you need for that particular scenario.
Each scenario must be capable of being run on its own and should not depend on data set up by other scenarios. This means every scenario has to include enough Given steps to set up all the data it needs.
Cucumber features are all about communicating with business users in their language, and it’s important that we don’t force them to sound like robots.
It’s better to aim to make your examples illustrative or representative than exhaustive.
If subfolders are the chapters in your book of features, then tags are the sticky notes you’ve put on pages you want to be able to find easily.
When the state of the system is not reset between tests, we say that they allow state to leak between them. This is a major cause of brittle tests.
When one scenario depends upon state left behind by another earlier scenario in order for it to pass, you’ve created a dependency between the two scenarios. When you have a chain of several scenarios depending on each other like this, it’s only a matter of time before you end up with a train wreck.
If that first scenario, the one that happens to leave the system in just the right state for the next one to pick it up, is ever changed, the next scenario will suddenly start to fail.
fixing things becomes a habit, rather than something you put off to do someday later when you’re not in such a hurry.
Cucumber might just seem like a testing tool, but at its heart it’s really a collaboration tool.
The most common use of Before and After hooks is to clear up any residual state left in external systems like databases so that each scenario starts with the system in a known state.
In the real world, you don’t always get the luxury of working on shiny new code.
That's about it. I also liked a whole introduction of one of the chapters in the book. The last quote actually came from it but I'm going to post it separately :)
Have you tried Cucumber already? :)
...programmers seldom place a high priority on user documentation.
Roderick W. Smith, Linux Essentials
UML Distilled, 3rd ed. by Martin Fowler
Our company just added another book to our bookshelf and you guessed it from the title, it's "UML Distilled" by Martin Fowler. Anyway, I'm still not done reading this book so I decided on making this post a little bit unique. I tend to jot down quotes from the books I read but sometimes I lose them before I can post them here. So I decided that I'll post the quotes immediately then :) I kind of like the idea since I can also track my progress this way. So, here goes nothing.
March 15, 2014
One of the biggest debates about process is that between waterfall and iterative styles. The terms often get misused, particularly as iterative is seen as fashionable, while the waterfall process seems to wear plaid trousers. As a result, many projects claim to do iterative development but are really doing waterfall .
The essential difference between the two is how you break up a project into smaller chunks. If you have a project that you think will take a year, few people are comfortable telling the team to go away for a year and to come back when done. Some breakdown is needed so that people can approach the problem and track progress.
You certainly should not assume that all design is finished when coding begins.
My sense of industrial practice is that waterfall development is still the more common approach, however. One reason for this is what I refer to as pseudoiterative development: People claim to be doing iterative development but are in fact doing waterfall.
I like time boxing because people usually have difficulty slipping functionality. By practicing slipping function regularly, they are in a better position to make an intelligent choice at a big release between slipping a date and slipping function. Slipping function during iterations is also effective at helping people learn what the real requirements priorities are.
The majority of software projects experience significant requirements churn: changes in requirements in the later stages of the project. These changes shatter the foundations of a predictive plan. You can combat these changes by freezing the requirements early on and not permitting changes, but this runs the risk of delivering a system that no longer meets the needs of its users.
Analysis Paralysis in Programming and Everyday Life
Did you ever experience that feeling that you try to think of the best solution by thinking all the possibilities and weighing each option and then it confuses you and you end up not deciding anything? I have. That phenomenon where you overanalyze things and get bogged down by the details and end up doing nothing (or delayed in doing) is called Analysis Paralysis.
Now, what does this have to do with programming?
I’ve experienced this in programming when I just started working. I mostly experienced this in tricky problems and I have to decide which solution is best. I realized that I’m the kind of person that thinks too much. I can get caught up in the details and then ending up blowing the problem out of proportions.
I somehow realized that this is also related to the Waterfall SDLC. A significant amount of time is spent designing and planning to try and capture all that’s needed to successfully implement a project. However, you end up with a rigid design and something the client didn't even need in the first place.
In my everyday life, I mostly relate this with what I want to do/learn in life. I have too many interests that I would love to improve on or continue doing but all of which require a lot of time to master. I’m afraid I’ll neglect my other interests which paralyzes me on what I should do first. I have no clue where to start.
For a more simpler example, I have some chores in the house that have a significant time of doing… Ack, why am I even a programmer if I can’t even decide these things for myself? Note to self, pull yourself together woman!!
Why I just blabbed about this is because of a new distraction, well more of an opportunity has appeared that I wish to tackle on but is a potential hindrance to my reviewing for Philnits. I actually haven’t reviewed again since last time because I’m still watching the iOS vids on iTunes U.
Those videos are around an hour long each (sometimes even longer). It’s a video of a college lecture after all and my brain is too tired to study for Philnits by then. I’ll be done watching the video around 10pm something and I have to wake up early to go to work the next day. I only get to study when I forget to download the next video so I use that night to study.
This is starting to sound like a rant…so I’ll stop here. That is all.-__- Oh, and if you were wondering what that distraction is, our office bookshelf now has a copy of a cocos2d-x book and I’m actually been itching to learn that framework because it's cross platform! This means it’ll support both iOS and Android! How cool is that? I instantly downloaded the book to my phone so I could start reading it. I almost skipped my iOS lecture vid so I could continue reading!;)))
Okay, this post has sidetracked a bit with the title...So uh yeah, Analysis Paralysis. So if you're like me, a person that gets caught up with the details on a complex problem, here are some tips I could give you that helped me with this problem:
Attack the problem by breaking it down into simple problems
When you deal with a complex problem, try and break it down into little problems and start from there. This will help you focus on one simple problem at a time and work on each one to ultimately solve the big problem.
Another advantage of this approach is that it gives a sense of accomplishment. Because you get to tackle on simple problems at a time that are easier to solve, you get to accomplish something. And because you've conquered a part of that complex problem, you also gain confidence as you attack it little by little.
Learn to Prioritize
When you get too bogged down on the details and came up with possible problems or errors, don't panic! Keep calm and take a deep breath. When you encounter these little details, remember the big picture i.e. the minimum requirements.
So here's what you should do, when you encounter these new problems, I suggest you take note of them and then get back to them later. First work on the minimum requirements because this is what is expected of you. Once you've done that and still have some time, you can work on the possible problems. It would be best though to report these things to your supervisor so you can adjust your schedule and they won't wonder why you're taking too long.
If you get stuck, ask!
if you think that the possible problems or errors seem rather critical, ask a second opinion or your supervisor about it so you'll get to estimate which tasks to prioritize. Sometimes, the problem might affect the overall feature/requirement so ask your supervisors about it instead of deciding things for yourself when it could be a design problem.
Like what Robert Martin said,
It is unprofessional to remain stuck when help is easily accessible.
So those are my tips. These little things helped me when I get stuck in a rut and generally helped me decide better. Now for my problem with everyday life, I'm still working on it hihi.
Hoped this help :)
Keep Calm and git reflog
That Unspoken Agreement
For me, a programmer’s desk is sacred. You can’t just move things on his/her desk for fear that you will disturb the peace of these sacred grounds. Even if the desk is haphazardly covered with scratch paper, a mug that used to hold coffee that now houses a new form of species and the potato chip wrappers and toys, still, you are not to touch anything without the programmer’s consent. It is FORBIDDEN O.O
Yeah, just being random and exaggerating things. Mind you, I don’t have a desk like that. But I did use to have an officemate who tried to grow something in an unwashed coffee mug… -_-
Just wrote something random because the scratch paper I used that contained my notes were thrown away when I looked for them on my desk this morning. Now my notes are gone and I had to remake them that I got from researching. Even though it’s really my fault that I get a proper notebook for my notes, I still couldn’t believe that someone decided what was ‘trash’ on my desk without my consent. I feel like my desk was violated. You just don’t do that!o.o
random ramblings~ Can any of you relate?
Another cheesy ryan gosling geeky pick up line for the day :>
Thinking of Learning a PHP Framework
Before being an iOS dev, I used to do Web Development. I decided to focus on Mobile Development instead because it was new to me and it got me curious.
The Mobile platform in itself, is very interesting to me because they deliver almost all services that are done in a computer. Not only does it deliver these services, it has also provided an extension of the user experience with new interactions like interacting with touches. And with it's pocket-size convenience, it also provides a plethora of applications that helps users with everyday life where portability is an advantage. An example of which would be real time map applications where the user's current geographic location is needed.
Anyway, aside from these applications, social networks are still very important in mobile applications.There are many apps out there that have implemented social network features such as Facebook and Twitter into their apps. There are even mobile applications that started their own social network even without a website (think Instagram)! Given that social networks are still quite important in mobile platforms, I take it upon myself to learn a PHP framework. Well at the very least, learn how to write Server-side scripts myself. That way, I'll possess skills for developing both the Client and Server side.The reason why I thought of learning PHP was because I just recently thought of a Social App :)
I don't know when I'm going to start working on the app but for now, I think I'll just start learning the framework. Even if I don't get to make the app, at least I've gained a new skill and expanded my horizons :) Oh, and if you're wondering what framework I'm planning to learn, it's CakePHP.
photo credit from CakePHP's github page.