Posts

Showing posts with the label programming

[15th December 2024] Interesting Things I Learnt This Week

Image
1. Why you should never use !! in Kotlin - Using double-bang operator(!!) is a bad practice; multiple alternatives cover every other possible case. Using it is a hack and a shortcut that will backfire while not saving you much time at the time of writing using it. You shouldn’t use it unless you're writing a short personal script. My Take : The double-bang operator (!!)  which throws null pointer exception in Kotlin might very well be considered " Billion Dollar Mistake ." While it offers a concise way to assert that a variable is not null, I believe it's preferable to have slightly more verbose code that explicitly handles nullability and avoids potential runtime exceptions. Null pointer exceptions have plagued programmers for decades, and introducing a feature that can easily lead to them seems counterproductive. I'm uncertain whether all Kotlin linters currently check for excessive or inappropriate use of the !! operator, but if yours don't, I strongly re...

[1st December 2024] Interesting Things I Learnt This Week

Image
1. C++ Pitfalls - this article, explains some of the pitfalls you can fall into when programming in C++ and shares their experience with them. This includes Operator precedence, Arithmetic conversion rules, Right bit-shift, Implicit conversions and Order of evaluation.  My Take : We've all read about JavaScript's quirks, leading to unexpected outputs. But let's remember that such behaviors aren't unique to JavaScript. Even languages like C and C++ have their share of ambiguities and compiler-specific behaviors. While it's tempting to dive deep into these intricacies, I've found that focusing on clear, consistent, and unambiguous code is often more practical. However, understanding these nuances is essential for any experienced programmer. It helps us avoid pitfalls and write robust, reliable code. Remember, mastering a language isn't just about writing "Hello World." It involves delving into its intricacies, including its counterintuitive and ambi...

[17th November 2024] Interesting Things I Learnt This Week

Image
 1. Booleans are a trap : Booleans, while seemingly simple, can introduce complexity and limitations into domain modeling. When used to represent complex states, booleans can lead to unclear code and potential errors. To avoid these pitfalls, consider using enums or enum sets. These approaches provide a more expressive and maintainable way to model complex states in your applications. My Take : I wish I had learned this earlier in life. When working with Google Docs, I realized the limitations of booleans. Expanding boolean-based behaviors often led to adding more fields, making the system complex. Enums would have provided a simpler solution. The problem wasn't just the booleans themselves, but also the need to pass them through multiple layers of the stack, often requiring additional parameters. Another important aspect of enums is the inclusion of an " enum not specified " state. This state explicitly indicates that an enum value hasn't been set, which can be usef...

A chapter of my work life comes to a close

I dont know how but I somehow missed publishing this post in time, but better late than never I guess ;P I recently resigned from Near.co as Technical Architect after nearly 3 years of being with the team. I must give it my leadership there who proactively made sure I was relieved of my duties in a week once they realized I wont budge. Instead of me wasting endless 3 months, doing nothing but killing time, which many companies have, I was quickly transitioned out. I am sure not many folks have had this kind of experience yet in India. As a philosophy in my work life, I had decided a long time back that I wont resign in haste. But once I resign I wont take it back. This has been how I have been working for past 11 years. In fact I thought about moving out Near nearly 5 months back, but was not really sure about that. But the following months made my resolve stronger. Well I wont go into details why I really quit, because that gets boring :D . But what I would really want to recol...

Bangalore Auto Complaint

Image
I am sure that there are a lot of people in Bangalore who are truly frustrated by Autos in Bangalore. They violate all rules of the RTO by charging extra or refusing to ply to certain destinations or tampered/faulty meter. RTO Bangalore has come up with two email addresses to report these violations. But I found it really difficult to complain. I think the only way we would complain is in the heat of moment. With smartphones you can send a complain anywhere. But then again there are these lazy people like me who find typing the details very difficult. This is besides keeping the emailIDs handy. So I decided to create this Android app which makes creating and sending the email a breeze. You just need to enter the errant Auto's Number and details like to and from location. Next select the checkbox which is applicable in your case for the offense of the auto driver. You can optionally take a picture of the auto. Since you have a good camera on you Android handsets, you can take...

Damn Small Media Player – My tiny Mp3 player for all platforms

Image
Well building on my knowledge of WxWidgets and frustration with ever growing size of music players like Winamp or Windows Media Player, I decided that did not need those many features most of the time. So what was that I was looking for 1. Play Mp3s 2. Have a playlists, retain it and ability to add all files to the player at once. 3. Mp3 tags are mostly useless, filenames make more sense 4. Shortcuts should be simple and also alternative global keys 5. Small size, preferably below 2MB. 6. Multi-platform code. 7. Playlist Queue This was my priority, in no particular order, while I was designing this Mp3 player. But then I got some feedback from friends who wanted search feature as well. So there it was. All done and over. But then again most my friends and me felt that the UI sucked. Well it continues to. I am not good as styling so still looking for help from friends to make a better looking UI So now its a 716Kb file which you need to download and the...

Things I would like in my next Browser upgrade

Well there has been a lot hoola hoo over the recent releases of Firefox and Opera. But here are certain things that still suck and would like them to be removed. 1. Better plugins and make them such that they dont hang that tab or window. 2. Download accelerator be integrated in the download manager of the browser itself. Hardly makes sense keeping them dumb. 3. Super fast start is not possible for various technical reasons but a preloader program would definitely be kind of must have. 4. Get more screen real estate to the page and make rest of the things like toolbar, menubar and optionally even status bar visible on a need basis like the playbar in video players in full screen mode. 5. Subscribing to an RSS feed to Google Reader or iGoogle is  a dumb two step process now. Google Reader or iGoogle be made two different options. 6. Tabs must have a 3D effect or something really cool. Switching like pages is so yesterday. 7. Make download dialog unobtrusive. Make it so...

Automated Gmail Account creator

Image
Well I read this story sometime back I thought it was some sort of rumor. But it seems that the software is now available to the general public via the rapidshare.com . Heres the page which has the complete application which can create gmail accounts for you in a jiffy. Though I am not sure of reliability of this app because I dare not install apps from such location for the fear of malwares and rootkits. After this report I dont trust my anti-virus to be of any help in identifying these. I would not recommend you to use it either. Here is what the application claims to do. Create Unlimited Gmail Accounts in Seconds Flat. Setup Auto-Responder automatically! Setup Forwarding automatically! Use random or custom names! Enable POP3 automatically! Proxy support: HTTP/SOCKS4/SOCKS5 Multiple exporting options! Automatic self-updating software! From the image its clear that you can either create a single gmail account or a number of them with letters or n...

BuddysHere --- A Mobile Application idea

Image
Well this is an idea that I would like to share with all so that my dream can be realized. So here is the idea. Now that we have mobiles with GPS we should make use of it. So now you have this messenger which would update your position in your IM every time you move over 100m or something. I am assuming that either the GPS now or sooner will be accurate to something like few meters. So when you have some of your friends around, you know that they are. Cool dont u think? Here are options to make it happen. 1. Send update about the location to all/selected your buddies. Pro: Simple and effective Cons: No Privacy and your exact location is known to all. 2. Server gets updates and it pings you about friends close to you Pro: Agains simple and effective Cons: Requires server services. You location data is on a central server and this is a possible privacy risk. 3. Each person broadcasts a location to all his friends which is nearly correct. Now this nearly is something deb...