Sunday, January 12, 2014

Visual Object-Oriented Programming (OOP) Language Editor - Updated

I feel quite challenged when I see Java codes that are very long and have so many methods. I always think that Eclipse, or any IDE for that matter, could be made more convenient. Of course, there is the Package Explorer in Eclipse, but I think it could be made cooler and easier on the eyes. This idea might not be suitable to those who are used to looking at lengthy codes.

So, what am I looking for? I am not looking at GUI builder or UML kind of programming. I am also not looking at Visual Programming, but it is closer to what I am looking for. So, what I am looking for is an editor that makes each methods as blocks, as well as the classes. Each method would be opened in its own window, so now we could have 4 methods or more on screen, but not arranged horizontally in length. We could copy methods around by dragging the method 'block' to the class we would like to copy it to (of course it would be awesome if we have a library of method 'block's we would like to save).

I can't really make it since I don't think my knowledge would be sufficient to make such plug-in for Eclipse or to make such editor. I am also not familiar with prototyping but I draw something to make sense of it.



My drawing is ugly (and I was very careless with the code) but I hope I could get the message across. So each class and its methods will be listed on the left just like in Eclipse Package Explorer. Of course the package and all will be shown there as well. Now, each methods will be listed under the class and if you double click it, that method implementation will be opened in a small window. Possibly, different modifiers will be colored differently, e.g. white for public, gray for private, yellow for static and so on so forth. The Java Doc (for Java) for the method will be shown as well and could be minimized. If a method is called within another method, and both methods have opened window, there will be a line between them to indicate the call.

Despite all this, we could click a button to show the whole class in its usual implementation - long codes. So, this plug-in or editor will be a smart interpreter of the code that could switch back and forth between the codes and this kind of visual editor.

What do I want to achieve?
1. Fun time coding - that kind of editor would be so fun to play around with and looks futuristic even when it isn't - for example, Jarvis theme to make it blue and transparent and stuff
2. Easier navigation - after going through Software Engineering class, I realize to make a good piece of code, you need a lot of modularity and abstraction. This also means you will have a lot of methods which could make it hard to go around the code if you are still not used to organizing the methods nicely - e.g. high level should be on top of lower level methods or linked methods should be placed each other. With this, you could open high level and low level methods at the same time from non-connecting methods (e.g. one deals with addition while the other subtraction) and edit them without losing navigability
3. Versatility - Dragging methods around to other class would be so fun. Of course, the editor must be smart, too! For example, children classes should not re-implement inherited methods but list them and show the code to the user anyway and so on so forth.

I am not sure if this is not a good idea, but I think it would be fun if we have such thing.

*Update:
I was trying out on the idea with some prototype, but apparently someone made it already. It's called CodeBubble (You could see the demo here). I am going to close my GitHub repo on the work now since someone made it already :)

Friday, January 10, 2014

Improving Singapore Bus Timing App

I have some troubles using SBS Transit Iris on Android. Sometimes, the listed nearby bus stops do not include the bus stop I am in. Then, I need to find the bus service and look for the bus stop I am at. I came up with an idea of how to improve such app through NFC.

While NFC usage is not that popular, I think it could be utilised to improve bus stop searching in bus timing app. So, in every bus stop, an NFC tag is put to identify the bus stop we are at. Then, when we open the app, we could choose to scan the NFC right away instead of looking through a list of bus stops. This way, we could skip looking at the list of bus stops and quickly see the bus timing that we need.

Now, why NFC? Firstly, NFC tag is cheap. Secondly, the identifier of bus stop in Singapore is by 6-digit number which I believe could be contained in NFC tag. Thirdly, using it is as easy as using EZ-link - just tap. Of course probably we need to turn on some settings to enable scanning the NFC tag, but this could be put inside the bus timing app that will automatically turn on the scanner (and turn it off when we exit the app).

What about the app? Could it be made even more convenient? Of course! Instead of opening the app, it should have a widget! What does the widget do? The widget is simple: tap it to scan. That way, the use of the app will be very fast. Tap the widget, scan the NFC tag, and all the bus schedules will be listed.

What problem could arise from this? One problem I could foresee is crowding of people around the NFC tag. Indeed, it would be better if the whole bus stop is the scan area itself, which probably needs a different technology (and could spark debate on radiation and stuff). One workaround would be to make that whole board of bus information on the bus stops to be the NFC tag, then you have front and back with big area though probably with a higher cost. Of course, another workaround would be to put NFC tags on the safety barricades (am I using the correct term here?) which would have around 3 or 4 for every bus stop. There are many other solutions, but the idea is the same.

Hopefully such convenience comes soon :D And yeah, I hope I can find something like this, too, in Indonesia in the near future.

Thursday, January 9, 2014

Extending Google features: Unit Length Converter

Did you know that you could use Google to convert units? Try typing "1 inch to cm" (in my Chrome, typing "1 inch" will list "= 2.54 cm" in auto-complete) and search it. Cool? Of course!

Now, the thing is, I want to know approximately how long is that. Why not extend that Google function even more? Make a digital ruler based on screen density!

It seems that someone made that already. You could try http://iruler.net/. It will make that converter function in Google more awesome, right? Since now we don't need to wonder how long is that compared to our hands and such.

Indeed, it is easier to implement for length since we could see it in our monitors. How about other units? I can't think of many examples, but probably for weight, we could use a common scale, like 2 kg is the weight of your laptop, 500 grams is your phone and so on.