On Mini Project

When we were told to develop a mini project, which was basically developing a website using either PHP or .NET, all my friends asked me to join their team. Because, I don’t know why, they consider me the ultimate programmer.

What I did was simple. I just said, “No!”. I talked it out with my class teacher and she told me that it was perfectly okay to develop alone, if that is what I wish for. So I went on to develop my site, hearing ditching statements from my friends all along.

But they don’t understand why I did so. To be honest, very few people in my class actually know how to program something. If I had agreed to join a team, what would have happened is, everybody else would leave the programing job to me and just sit back and enjoy. My not joining any team has lead them to actually learn programing by themselves and do the project. Programing is a thing that you learn when you do it. You cannot learn programing just by reading some book or watch a tutorial. Unless you don’t perform it, you don’t get the hang of it.

Now everybody is able to create a website. And I’m happy with what I’ve developed.

Quote

Real Programmers

Real programmers don’t comment their code. If it was hard to write, it must be hard to read too.— Tom Van Vleck

I follow that quite a lot because commenting is quite troublesome, isn’t it? 😅

And when after a lot of days (or months) I read my code I’m like, “What the hell is this? Who has written this code? I can’t understand a bit of it.” After which I remember that it was I who wrote that stuff. 😑

That Semicolon

8:30 in the morning. The starting time of my college. The first thing on my timetable happens to be a SPA practical. SPA is short for Structured Programming Approach. This subject is meant to teach students the basics of programming in the C language.

I was there right on time with all my other friends. We took our seats and waited for the teacher to come. She entered (late as always) and told us all to perform a simple program on do-while loop in C.

In about 5 minutes I completed our program. I was just about to execute my program when one my friend who was sitting beside me (call him friend 1) exclaimed, “Stop! Your program is wrong.”

Continue reading

Algorithm

An interesting take on the definition of algorithm that defines it in a more practical way.

(n). [al-guh-rith-uh m] Word used by programmers when they do not want to explain what they did.

Isn’t it?

If I Wasn’t a Blogger

If I wasn’t a blogger, I would have been a social media user. Before I discovered WordPress I used Facebook and Twitter. But those weren’t very interesting because you only get to communicate within your circles. And they sell your personal profiles to advertising companies to make revenue for themselves (and the advertising companies). From what I have read, at least Facebook does.

If I wasn’t a blogger, I would have been a full-time programmer. I read various programming eBooks when I feel like studying something new. I read different books related to web design and development like jQuery and AngularJS. Now since I blog, much of the time I’m on WordPress, either reading others’ posts or writing something.

If I wasn’t a blogger, I would have never understood how a large Content Management System (CMS) like WordPress worked. From the programmer point of view, it was necessary.

If I wasn’t a blogger, I would never have met friends like you.

Quote

The Skill of Programming

Programming is such a skill, which when you possess, you feel unlike all others. You feel like you are a wizard.

P.S. Just a random thought.

Page Refresh in JavaScript

Refreshing a page from JavaScript is not used much but still it comes handy sometimes (like when you want to override all changes that your user has done in the page). I used to use it a few years ago when I didn’t knew anything about AJAX but now AJAX does everything. Still I thought about writing this down. Maybe it might help you (or even me in the decades to come, if ever I forget).

It is just a single line that does the job. Just type:
location.href=location.href;

You assign the window’s location to itself which forces the browser to reload the page since it observes any changes made to the URL. In a function you might implement it like:

function doSomething() {
  // do something here which would eventually
  // require a full-page refresh
  location.href=location.href;
}

Done. But note one thing, everything you write after that refreshing line won’t be executed since the control will pass to the browser to reload the page. In other words, it is like a return statement of a function.

Word Count in .NET

Ever needed a handy ability to count words in a string using .NET? You are in the right place. There are many ways to count words but I’ll be giving you the most efficient method to do it.

Continue reading

Reading and writing files in VB.NET

Some years ago, I developed a word processor application in VB.NET that I myself used for some time as a replacement to the popular notepad. The most important part of the application was developing an ability to read and write files from the hard disk. After a lot of researching, I found out two classes buried in the System.IO namespace that do just that thing. And they are called StreamReader and StreamWriter. So in this post I’m going to give a short tutorial on how to read and write files to the hard disk.

Continue reading

Power of Deduction

Daily Prompt – Let’s assume we do, in fact, use only 10% of our brain. If you could unlock the remaining 90%, what would you do with it?


I use only 10% of my brain power. Really? That must mean I am mad. No, that can’t be. Mad people don’t even use 10%. Haha. I was absent for almost a week due to tight schedule. I rarely get time to write anything. But today I got the power to use the rest of my brain power and I got to writing. After writing is done, I will use that 90% plus the remaining 10% to become (or at least try to) Sherlock Holmes. The key is to use our eyes and brain properly. Maybe with this extra 90% I can solve cases. Buy tough cases in India are very rare. Even if they occur they are just postponed everytime it appears in the court.

Extra brain power can help me top my exams. In engineering, we just pass exams at the borderline. That means just enough marks to pass out. And if we get a “all clear”, our happiness and confidence knows no bounds. Whether you top the exams or just pass, your friends will still call you a scholar. The word scholar here is a cliché. Everybody will be called a scholar irrespective of whether they are one or not. Sigh.

Extra brain power can be used in programming too. Programming requires a lot of logic building. In my junior college, everybody knew me as the logic king. I used to (and still can) deduce the logic behind any program in a flash.

If God has given us a brain we must use 100% of it. Why waste it? But will it burn out too, like computer processors? That is not at all desirable, right? The working of our brain is a mystery. I mean, how can it work with only 10 watts of power? It’s amazing.