Things I can’t seem to do without

1.  FTP access

2. Linux/Unix/BSD command line access

3. SSH/Telnet/Remote access

4. Samba file access

5. Apache

6. PHP

7. At least 2 monitors

8. MySQL Query Browser (that can access database)

9. Database

Listed above is a list of what I believe to be essentials for any decent programming environment.

After I reconfigured my home environment to pretty much contain everything listed above, coding has become a lot easier.

Ipod Touch

Shortly after I got my iPod Touch I started doing a little research on it. With a few easy steps and a couple of minutes invested, you can convert a 300 hundred dollar music player to a pretty awesome PDA. An iPod Touch empowered with tons of 3rd party applications developed through the slave labor from hordes of developers, easily makes the iPod Touch THE THING to have!

Thanks to the ipod touch, I check stocks, email, and weather, all with a touch of a button. I even use it to check and set my schedules. Thanks to the 3rd party developers, I can host a website right off my iPod touch! It does freeBSD, it does apache, it does PHP, it does FTP, SAMBA, and SSH! It’s like a miniture server!

Yep, jailbroken iPod Touches are pretty awesome.

iTouch

As a christmas present from work, I got an apple ipod touch! iTouch for short. It’s almost like an iphone, except it’s not a phone. I was super stoked for about 15-30 minutes, but afterwards, I realized that I would most likely never use it solely as a music player. The fragility and relative cost of it makes me hesitant to take it anywhere.

Although the fact that it has wifi access and a mobi browser makes it nifty to have in case I really have to surf the web out of nowhere, but besides that, I don’t know when I’d use it.

It’s still cool to have though, I just wish I could think of more uses for it and justify carrying it around with me everywhere.

Factories

Today, while reading some of my PHP books, I’ve came across a simple and clear definition for what a “factory” is and I decided to share it.

A factory is a class or method with the responsibility for generating objects.

I’m obviously not writing this post for those who are already well-versed in the ways of the coders, but for those who are trying to become well-versed, and are seeking clarification wherever they can find it. I hope you guys find this helpful.

Timeouts

What are timeouts? Besides a form of punishment for misbehaving kids, time outs are a threshold for scripts. When you set a time out, you basically tell the script that if the execution time of the task exceeds a certain amount, do something; normally, error out. The utilization of time outs are important, especially if you’re connecting to another box for your script.

If the timeout is unlimited by default, when you connect to something that is currently down, or its location changed, that one component of your script might run on indefintely, and it is definitely something you don’t want. Therefore it is wise to put timeouts on any scripts that utilize connections whether it is ftp, mysql, or etc.

There are many ways to set time outs, just to name a few, for PHP, some of the time outs can be set via the php.ini file, the ini_set function, or the class/object’s built in timeout functions. Regardless of form, the utilization of timeouts can be a real headache saver.

Big Company vs Small Company

There are difference between big companies and small companies, I have noticed. I’ve noticed that a lot of new hires coming from big companies are more oriented towards getting something done, versus getting something done right, and when they make mistakes, they brush it off as if it’s not significant or deny responsibility. I don’t particularly like it, but I think there is reasonable explanation for this.

In a big corporation, there is a lot of resources, but few positions, and mistakes can mean that your chances of getting those positions just went down the drain, or possibly you being fired for your incompetence. Therefore, people who’ve worked for big corporations, being so used to that type of environment, instead of owning up to the mistake, they rather make up excuses or deny responsibility.

In a small corporation, talent is hired for cheap, and expectations aren’t too high, so even if you made mistake, it’s okay, since it’s within their range of expectations.

This can be a problem for a person coming in from a big company to a small company, especially if they are coming into a management position or thinking about moving into a management position. A good leader feels responsible for all the incompetence of his followers and when problems occur he doesn’t blame anyone but himself. A bad leader, on the other hand,  might simply pick one of his followers out and make him the scapegoat. A good leader will look to himself to solutions to problems, a bad one might blame his subordinate for them.

The reason why I would bring this up is due to the fact that a co-worker of mine brought it up, and I thought it was interesting, and scary. I never realized how important a good leader is to me, and how they can make or break a company. I know that if I feel useful and appreciated, I’m more prone to do my work well, and go above and beyond all expectations. The worker’s productivity and morale was high with a good leader, but when they had a bad leader that got angry at them over everything, the worker’s productivity simply went down the drain. They no longer felt appreciated, a sense of purpose, or ethusiastic about tasks before them.

A personal note I’m going to make for myself is to plan for the mistakes of my subordinates. When they make them, I won’t scold them, I’ll simply show them the correct way of doing it, and ask that they be more careful next time. I’ll probably going to take the extra step of letting them know that while it’s good to get things done fast and right, it’s much more important they you get it done right than fast. I’d rather have stable code that will last me years than unstable code that will require much more time investment.

PHP Image Library

I had to write some code to generate graphs today and I must say that the image library is awesome! It reminds me of the swing class of Java, but I think it’s awfully neat to have a way to programmatically generate images. Although, I think PHP graphics are great for more “static” like pages, but wouldn’t be sufficient enough for webpages that need to see more “dynamic”. Eventually, all graphs will probably have to be done in AJAX, but for now, I can skim by creating simple graphs using the PHP image library. Maybe I’ll have display my email in the form of a picture instead of text, the possibilities are endless.

Foundation

I think the foundation is possibly the most important part of any type of script. In the script world, the foundation would possibly mean the heart of the system, the driving principle behind the component. I’m currently engaged in a project where we designed certain components around a core principle, and suddenly the core principle is de-emphasized. In my opinion this causes the foundation of the script to poor. Our current project is sitting in a crossroad where we can either further develop the system, or revisit the foundation and make sure it strong before we proceed.

I have sufficient evidence to demonstrate that our current system isn’t as strong as it could be due to the fact that I’ve redesigned certain components and these components better represent the core principle in which our system is based. Yet, my group member acknowledges this fact and then says that no change is necessary due to the fact that in his opinion it’s not significantly different. But the current system is not as true to the core principle as it possibly could be, if it was a percentage, I’d say it was 60%, where as after implementing the modifications I recommended, the performance would probably be boasted to 80-90%.

So I’m hesitant about moving forward and further developing the code which heavily relies on its foundation knowing that the foundation is flawed. I know that many times, we should code things to the XP principle of doing the simplist thing that works, but in no way am I running against that principle. In my eyes, the project simply isn’t “working” the way it’s supposed to. An analogy of the situation would be me trying to get an A in every pre-requisite class before taking the class I want, and my partner saying that Cs are acceptable and moving onto further topics. I feel that since this project will be very important to the important to the company that we get everything right, right from the start. This is what I believe. Even if we can code all the code in a strongly “modular” way and revisit them in the future. If anything is worth doing, it’s worth doing right. To me, this is simply sloppy.

Communication Among Developers

Developer 1: “I think we need to sort this array by it’s value”
Developer 2: “You should write a hash, store the values in the hash, and then sort it”
Developer 1: “That’s what I just said…”

Developer 1: “Alright, I’m going to sort this array”
Developer 2: “Alright, but before you do that… I want you to create a hash. Put the values into the hash and then, using the sorting function, sort the array.”

Developer 1: “This idea your purposing contradicts statements you previously made about your algorithm. I mean, what you’re purposing causes the work done by previous scripts to be rendered useless or is in essense saying that previous scripts aren’t doing their job right.”
Developer 2: “No. We are making these changes to the results of the script, we are creating better results down the line.”
Developer 1: “But, according to you, if those scripts truly did what we designed them to do, then we shouldn’t need to manually edit the results”
Developer 2: “I don’t understand what you’re getting at. We are improving the results by editing them.”
Developer 1: “But if the scripts… did their job right… then… *sigh* Whatever”

Developer 2: “You know… I thought about it… And I think you’re right, there is something wrong with the algorithm”
Developer 1: “Okay”
Developer 2: “But we’re still going to edit the results to better suit what we think should be there…”

Developer 1: “How do you plan on going about tackling this problem?”
Developer 2: “Well… we can try this, this, and this, and then have the algorithm do this…”
Developer 1: “We’ve already tried that and it didn’t turn out too well, you might want to account for cases such as this in your solution.”
Developer 2: “I don’t see why this case would occur”
Developer 1: “Believe me, it often does.”
Developer 2: “Stop being so pessimistic, we can do anything.”
Developer 1: “No… I’m just saying you might want to account for this case when you come up with your solution, it’s what makes this problem challenging”
Developer 2: “You shouldn’t give up just because it’s hard. We can do this, we have a week. You and I should combine our forces, share our ideas, and hammer up a solution that works.”
Developer 1: “But… I’m already letting you know what I think on it”
Developer 2: “Trust me, it’ll be okay. We at the very least 75% of the time the script will do what it’s supposed to.”
Developer 1: “But, it already does that right now…”
Developer 2: “We’ll see, okay? We’ll see.”

Ah… I forget how working in teams can sometime feel like running head first into a brick wall.

Quotes

Here are some quotes that I really like:

“All that is complex is not useful. All that is useful is simple.” — MikhailKalashnikov
“It should be as simple as possible, but no simpler” — Albert Einstein
“Do the simplist thing that works” — Second XP Principle
“You aren’t going to need it” (YAGNI) Principle – unknown

I think the above quotes are very interesting and true. I think they will most definitely play an important role in any programmers life.