Posts Tagged Programming

To Comment or Not to Comment

Anyone who has had programming classes knows that one of the primary things they push on you is that all good programmers comment their code. They don’t always tell you how much commenting you should do, although some do give good advice. How does one decide how much is enough.

Comments are great because they are basically communications between programmers to help with the logic that is going on in the code. Sometimes the two programmers are the same person. I think a good rule of thumb is to comment just below your own skill level. This means to comment just enough to help someone of almost the same skill as yourself along. You don’t want to comment your code to the point that it clutters up the rest of the source, but you want to be able to read through your own code and quickly find the cause of any potential bugs. You never know when you’ll have to go back through your own code. Chances are you won’t remember what exactly is going on at any particular point, especially if you work on a lot of projects.

Of course, there are always conventions that are mapped out beforehand for most developing teams, but if you are working solo, you should comment as if you are in a team environment.

I personally find comments distracting and ugly when viewing code. I don’t particularly care for method and class header comments. They rarely give any useful information. Inline comments are very valuable, however. So if if the coding standards of your team require class and method headers, put them in, but if you are solo or there’s no coding standards in place that require these types of comments, don’t use them. You should be able to look at any method and tell what kind of parameters it takes, and you should be able to quickly find the return type. These aren’t necessary and break down code readability in the end.

Comment changes. If you have to remove some code, comment it out instead of deleting it. This will help you revert changes or come up with better solutions if it is later found that the new code is buggy itself. If you have some bit of logic that is complicated even to your own eyes, comment it and explain how it works. Other than that, keep comments to a minimum.

, , ,

No Comments

Updating Whats-hot-weekly

My task for this morning is to add additional site codes to whats-hot-weekly.com. It’s not an easy task. At least, it isn’t as easy as I thought it would be. All of the categories are pulled from a database that I refresh every so often. The database only contains the categories for the US eBay site. This is where it gets hairy because I wasn’t aware before now that the other countries used didn’t categories. So, now my task is to add all the categories so I can implement the additional sites.

This is going to take a while. The US along takes around half an hour. There are many other sites. I’ve recreated the database adding a field to record the site_id. Next I’ll run my scripts to populate the database with API calls. After I populate the database for the US, I’ll switch the site codes manually and add the next site. I would automate this but I would rather monitor it anyway so I thought I may as well do it manually.

The big issue that will come up later is currencies. I’ll have to adjust for that. I’ll also have to recreate the same code on the static version of the site.

While I wait for the database to refresh, the old site is still running as normal. I have a development environment that is a working copy of the production environment. I’ll make the switch there, then simply move it over to production from there. There should be exactly no downtime to the site. I hope.

, ,

No Comments

If you want to finance your career you should learn about students loans because it’s one of the few loans you will be able to take out in the future. When you are a student you will have to work for years at a high salary before you are able to begin making payments. The average student loan debt for undergraduates is $25,000, and it is expected that there will be about $1.3 trillion in student loan debt by 2020.

We all hope that our kids won’t have to take out loans to start their lives off in life, but it is the reality of today. That said, there are students out there that find the loans and work out how to avoid it altogether. For that reason we have compiled a list of the 7 things you should be doing if you are thinking of a career in student loans.

#1. Get Started ASAP

Just because you can’t afford a student loan doesn’t mean you can’t start your education. The sooner you start working towards a career in student loans the better. The last thing you want to do is spend years working towards an internship before you have made a commitment to something, because then you will never get that opportunity to work. There are plenty of places you can start right away. Check out this list of student loan companies. You can get started with a one-year option or you can work your way up to a five-year plan. #2. Understand The Loan Terms When you are looking at a student loan company, you will want to understand the terms of the loan so you can make the best choices. Some of the terms are specific to the type of loan you are getting and others are common in all types of loans. A good rule of thumb is to take a good look at the terms of any loan you are considering because all of them will be a part of the agreement. You will want to have a basic understanding of the loan terms so you can make the best choices for yourself when it comes to paying back the loan. Let’s look at the following information about paying back a loan:

A Good Loan Terms

The term of the loan is usually a couple of years. Usually the lender will tell you the exact length of the term and the payment schedule. Some banks will give you an estimate of how much you are going to pay every month.

The loan interest rate is the interest rate you are going to be charged when you make your monthly payments. You can expect to pay about 3% to 4% on your loan. You may find a lower interest rate on a savings or checking account at a branch of the bank. You can also try using the calculator on the lender’s website or by calling the lender to ask.

The term of the loan is usually a couple of years. Usually the lender will tell you the exact length of the term and the payment schedule. Some banks will give you an estimate of how much you are going to pay every month. The loan interest rate is the interest rate that you will pay each month on the loan. The interest rate will increase as the length of the loan increases. Generally, if you can get a lower interest rate, you may be able to get a loan for a shorter amount. It is a good idea to ask the lender what the interest rate is on the loan you are considering.

Before you start your loan application process, check with your bank to see if they offer loans in the states where you live. Get more info here.

, , , ,

No Comments