What Is Metaprogramming? – Part 2/2

1 mainThis is a continuation of my previous blog post on metaprogramming. In the previous post, we saw why we need metaprogramming. In this post, we will see what exactly this whole metaprogramming is all about. In the world of programming, the basic problem is that any general-purpose programming language is that it has its own limitations. If the language doesn’t have a metaprogramming model that is as pleasant and expressive as the language itself, then it will eventually frustrate the user. Nobody can design the perfect language, we get that! The people who manage these languages don’t allow the users to extend the language in generic ways. Not a bad thing altogether! This is done because a lot of people end up extending it in too many different ways and it becomes one big potpourri of nastiness. Coming back to the topic at hand, how exactly do we understand metaprogramming?   Continue reading

What Is Metaprogramming? – Part 1/2

1 mainYou know how people talk about creating machines that can create more machines by themselves? Well, we already have machines that can create other machines. The concept of metaprogramming is just the technical side of it. Metaprogramming is the process of writing programs that can create other programs. It is one of the most underused programming techniques. The good thing is that it allows programmers to minimize the number of lines of code to express a solution, or it gives programs greater flexibility to efficiently handle new situations without recompilation. If it’s so good, then why isn’t it used everywhere? Why do we need it? Before we jump into the details of metaprogramming, let’s understand why we would consider it in the first place.   Continue reading

Forward Proxy vs Reverse Proxy

1 mainIn the previous two blog posts, we discussed about forward and reverse proxies. In this post, we will look at a real example and see how we differentiate between the two. The word proxy describes someone acting on behalf of anyone else. In the world of computers, we are talking about one machine acting on the behalf of another machine. Students do this in real life because they don’t want to attend all the classes, but they want the attendance. Well, machines don’t want to attend all the classes either! So let’s go ahead and see what those differences are and how we can understand them.   Continue reading

What Is A Reverse Proxy?

mainIn the previous blog post, we discussed about proxy servers. Proxy servers basically act like buffers that monitor everything that comes into the user’s machine. We talked about why we need them and how they are used in real life scenarios. We used the analogy of what a person aims to achieve when he proxies for another person. He basically acts on behalf of that other person. Now how would we extend that analogy to explain reverse proxy? Just like how students proxy for fellow students, reverse proxy can mean professors proxying for each other. Does that sound right? What exactly is a reverse proxy and why do we need it?   Continue reading

What Is A Proxy Server?

1 mainIf you are a techie, regardless of the field you are in, you must have heard the term “proxy server”. If you are a web developer, you would hear that term a lot! Off the top of your head, what do you think a proxy server is? It’s basically very similar to what a person aims to achieve when he proxies for another person. That is, to act on behalf of that other person. Remember the good old college days when this used to happen a lot? It was frowned upon by the professors back then. But now, it makes up for a good analogy to discuss an important concept. Now why would we need a proxy server? Why can’t we just talk directly to the actual server and leave this whole proxy thing aside?   Continue reading

Using Multiple CPU Cores With Command Line Tools

command lineAll of you must have heard about how the processors in our laptops have multiple cores. It’s good that the technology is advancing in that direction. When people write programs, they can utilize these cores to increase the speed of computation. But most of the inbuilt commands don’t use these cores unless specified explicitly. If you ever want to add up a very large list, say hundreds of megabytes, or just look through it to find some particular value, you would write a simple program to do it. But going through so much data takes a lot of time if you just use a single thread. The same is true for tools like grep, bzip2, wc, awk, sed, etc. If the last sentence looked like jibber-jabber, then you should probably google those things before you proceed. They are singly-threaded and will just use one CPU core. So how do we use multiple cores in these situations?   Continue reading

URL vs URI vs URN

mainOut of the three acronyms in the title, I guess you are most familiar with URL. Some of you may have heard the other two being thrown around here and there. These acronyms are basically related to the internet. To be specific, they are related to accessing stuff on the internet. Why is the purpose of having those three acronyms in the first place? What is the difference between them? Why does it matter? This may be confusing to some, so I thought I should share my understanding of the these concepts.   Continue reading