What stole most of my time were node.js’ asynchronicity features. I did not realize that there are two types of read/write operations. I saw them in the API documentation but I didn’t pay much attention until I was getting undefined when I wanted to log into database. Second time when I met asynchronicity was when working with the database. It was at the time I was sending content before it was ready. I wanted to save couple of lines of code but it didn’t work.
At first I was planning to use mongodb library for node.js but I couldn’t make it work. Therefore I later during the day opted for different library, mongoose. At the moment I am at point when I can read from database. From what I can tell from documentation saving to database isn’t much different.
The third thing which made scratch my head were nice URLs. I thought that those designed yesterday were good ones but after a second look they were really bad. And I didn’t realize that until I had to rewrite them. The structure I devised is:
Lesson learned today:
- Good tools are hard to find. I have spend a lot of time today to find a good database manager for MongoDB. I settled for MongoHub. The second thing I hate are text editors I use. I haven’t found one I like. Most of them are good enough not to opt for command line editors like nano but none of them are great.
- Seriously, when estimating time follow Scotty’s advice.
- Simple SQL commands were easy but mongoose’s way looks like more fun