Saturday 8 September 2012

Coding High and Insomnia---Reflection on Assignment 1

Assignment 1 has ended. And I was totally overwhelmed by the coding high which spanned for the whole last week. Had just 3-4 hours' sleep each day. And the result is I got insomnia.

My friday night was spent on coding again, till 7am today. Then I took a nap and a shower, headed for my concert practice afterwards. The assignment was handed in, hence there isn't much point in modifying it here and there. But I just couldn't stop doing that. I modified the CSS a little bit, arranged the layout a bit to maintain a really good view and chased my friends to come and play with our App.

Nonetheless, it's time to end this coding high and starting brainstorming for the next assignment. But before that, it's very important and necessary to reflect on the first assignment, to generalize the lessons learnt and some coding tricks used.

Lessons to be learnt

1. UML diagrams

We didn't draw h UML diagrams properly, except for a database scheme to remind of us the classes and functions and we have. Instead we just started coding after brainstorm and layout design. Class diagram to show the relations between the real objects, use case diagram to show how to use the App and state diagram to deal with state-dependent behavior...all these steps were skipped probably due to the tight schedule. However it turned out later on that we messed up  a bit. Sometimes certain functions we introduced were even not logical and sometimes we ourselves didn't know how to proceed with the next step. We reverted to a previous version a few times to comb our thoughts and clear contradictory parts.
I found the UML diagrams quite useless when I first learnt them. However, Assginment 1 really warned me how important they are, especially when working within a group and communiction comes in the first place.

2. Scheduling

We had only two coding people within our team and one of them is me. Hence we thought it's going to be easy since communication between two people is very effective and things can be done easily and we don't need to worry about the documentation. However, we still struggled a lot during the last days because I am new to PHP, JavaScript and HTML, and the abovementioned reasons. It's important to set milestones and schedule the iterations well, if we want to build up a project well programmed and tested.

Learning outcome

1. Coding languages for web development

Not to be arrogant, I couldn't believe myself that I started learning PHP, JavaScript and HTML and then completed a web application project within 3 weeks. Yet it's true, though the understanding of the languages is quite shallow and scrap as the learning is largely done via Google.

1) PHP and HTML

HTML provides elements (div, span, h, p, etc.) to work as a display board on a webpage and PHP , a server side scripting language, manipulates variables and objects to fill up those elements. Those variables and objects are used to represent the stuff (story, post, user profile picture, etc.)  we want to put on the webpage. It's quite fun to learn both of them. The coding procedures are quite standard, not many ricks to be presented.

  • Pass value: PHP doesn't work like C/C++ or java, where a value can be passed around. To facilitate this, we used a session call in PHP. The code is like session_start();$_SESSION['universal_user_id"]=$user_id; Then this 'universal_user_id' can be accessed by all php files with a similar session call, enless the session was ended.

2) JavaScript

We landed on JQuery library eventually for its very useful funtions. The most interesting thing about it is the AJAS function call, which can also be implemented by JavaScript solely. We used it a lot to minimize page reloading, so as to generate a kind of "real application" feel. Eventually we managed to get rid of page reloadin entirely from our App, as long as the user logged in and reached the main page.
  • Pass value from JavaScript to PHP for data sending, processing and receiving without page reloading---use AJAX function to achieve this asynchronously.
  • JQuery has a lot of functions to manipulate and animate HTML elements, like show(), hide() fadeIn() etc.  
2. Project management and team building

We had a wonderful team, with Kian Zhong being the chief coder, Peggy and uncle Jim working on documentation and other general matters. KZ and I concentrated on coding for the last few days and received McDonald's and PizzaHut delivery during deep night from Peggy and Jim. I enjoyed working within this team, where all passion and hardwork can be facilitated.

Yet we encountered a few problems with project management, like uneven scheduling and waste of time on not-so-important stuff.

New plans

Learn MySQL and CSS.

No comments:

Post a Comment