Skip to main content

Posts

My Experience in RBK

Before coming to RBK I thought that it would be a scary place for a person like me, totally different environment unlike anything I have ever experienced. I was correct about the second part, but for the first part; definitely no. I didn't think that I will be able to pass the admission process or even meet the expectations of the admission staff for my progress and assigned tasks. However surprisingly, I made it! I was one among other 40 or so students to be part of cohort 5. I was the happiest person on earth once I received that phone call from Zainab; she was the one that brought me the good news. I'm gonna keep this memory for a lifetime. One of the expectations I had before attending the prep was that we cohort 5 will be hacking/studying at King Hussein Business Park , which was a disappointment for me; because I have seen the pictures on RBK's social media for previous cohorts. I have learned a lot in these past four months, more than I could learn on my own f...

Compiler vs Interpreter

Programmers/developers alike write programs using computer languages that usually are close to human languages. These languages are called High Level Languages like Java, C++ and C#. But they differ in the way they execute their code; some of them are compiled and the rest are interpreted. Compiled languages take the entirety of the file and compile it as a unit. It takes takes time and generates errors after scanning everything. But that's not the case with interpreted languages, where they translate code statement at a time and memory efficient since there's no need to generate  an intermediate object code.

Git rebase vs Git merge

While working with git and github one will always face the need to combine their changes with the master branch of the team repository. to do this we have two solutions; we either use git merge or git rebase. To explain the differences between these two options we are going to consider the following example, you start working on feature branch for the sidebar of your website and other team members are updating the master branch with new commits. This will result in forked history as shown in the picture below. Merge: We can do the easiest option which is merging the master branch into the sidebar branch with this git command: git merge sidebar master This will create a new commit for the merge that connects both of these two branches, giving what looks in the picture below. So as you have seen merging is easy and really simple to work with. It's also a non-destructive operation; by this I mean that the already existing branches are not changes in any way.  ...

ES6 vs. ES5

ES stands Ecmascript which the standard that JavaScript was build on top of. ES5 was released in 2009 (ES2009) and ES6 was released in 2015(ES2015), so this means that it took the committee in charge 6 years to release an update to the language. That update was massive; mainly because version 4 was skipped. ES6 brings a lot of great features to Javascript that developers have been long waiting for.

Callback Hell

Before jumping into the topic of this blog I'm going to first talk about how it came to existence in the first place. While developing applications (web in general) and especially on the backend, we always face that need to make asynchronous calls to do stuff once others finish. And to solve this issue developers usually used nested functions also known by callbacks. While it solved the problem it still caused what is known by callback hell. Callbacks don't scale and are not good practice as far as I know. We can fix this issue and write better and readable code that works asynchronously but looks synchronous with the use of promises.

Big O Notation

Big O Notation is a mathematical expression that describes how much time an algorithm takes to run according to the size of it's inputs; mostly concerned about the worst case scenario. Types: 1- Constant Time O(1): On this order, regardless of the number of items, the iterations(time) are constant. Example: const getFirstItem = items =>    items[0]; getFirstITem([1, 2, 3, 4]);  // 1 (one iteration) getFirstItem(['b', 'd', 'g']);   // 'b' (one iteration) 2- Linear Time O(n): On this order, the worst case grows with the number of items. Example: Javascript's built in function indexOf, it loops over an array to find the  correct index of the passed element. The worst case is looping over the whole array. [1, 2, 4, 9, 23, 12].indexOf(12); 3- Quadratic Time O(n ^ 2): For this order, the worst case time is the square of the number of inputs. It grows exponentially according to the number of inputs. Example: Using nested loo...

NodeJs Working Mechanism

Nodejs is an environment built with Google's V8 engine to run javascript code outside of the browser (i.e in the server side). It is single threaded unlike other server side technologies like Java and PHP. They open new threads for each request; but with Nodejs all of this happens on a single thread with even shared resources.  All of the operations that a developer does on a server built with Nodejs happen asynchronously and that means it does not take a specific amount of time. So, to work this method we use something called callbacks; which are anonymous functions that we pass to a function so that it will be executed once the first function finishes executing. ┌───────────────────────┐ ┌─>│ timers │ │ └──────────┬────────────┘ │ ┌──────────┴────────────┐ │ │ I/O callbacks │ │ └──────────┬────────────┘ │ ┌──────────┴────────────┐ │ │ idle, prepare │ │ └──────────┬────────────┘ ┌───────────────┐ │ ┌──────────┴────────────┐ │ ...

CRUD in Databases

CRUD is short for the basic operations that can be done on relational databases in general: Create, Read, Update and Delete. We have dealt with CRUD applications a lot during this time period at RBK. Mostly while working with html forms and mapping their requests to a server that is connected to a database that does these operations.

Databases and ORMs

ORM or Object-relational mapping is a method to access and manipulate objects without having to consider how such objects relate to their data sources. With ORMs the code needed to manipulate our data is encapsulated and hidden in a way that we don't need to work with SQL directly; we just interact with the object in the same language we're using. ORMs provide the user with many advantages such as: It saves a lot of time thanks to writing DRY code and MVC code and you're not supposed to write poor SQL statements. And it's more flexible. As for the weak points, they're not lightweight tools and we need to learn them. Also SQL does better in big projects than them. Examples: 1- Javascript: Sequilize, Bookshelf.js and Mongoose 2- Java: Hibernate. 3- C#: Entity Framework And to conclude this blog I'm going to say that we shouldn't always go for ORMs but instead try working with SQL implementations like MySQL and others. It all depends on the specific ...

Middlewares

Middlewares in Javascript are functions that come in the middle of the request-response cycle. They have access to both the request and the response object as well as the next middleware function to be executed; usually called next(). Popular examples on middleware include: body-parser, cors, session, cookie-seesion and cookie-parser.

Relational Databases

Relational databases are, well... a collection of data items that have relations between them. These relations are made by associating a one table's primary key with another table's foreign key. It is a great advancement from the old long table that was used to store data which was inefficient in terms of search, memory and space.  And as for normalization; it means a process in which tables are structured to eliminate redundancy and repetition among data and the CRUD operations side-effects. And as a direct result we improve the performance of our queries. An example of a relational database would be two tables; one for student and the other for school. Both of these tables have a column for the school id, and so we make a connection between by assigning the first one as a primary key and the other as foreign key.

Docker

I knew Docker couple years ago but I never had the chance to work with it. All that I knew was that it's a software used in production/deployment of applications to help in making a single file for all of the application's dependencies and required packages. Imagine once you finish building your full stack application with the MEAN stack and you're ready for deployment, then you're gonna need something to aid you in the process and make it automated; like Docker.

Greenfield Project

This is a project where me and other three people joined forces to build it together. It started with meeting each other on the first day to decide on the project idea. After a couple hours of brainstorming we finally decided on a particular thing to do; and it was a web app to help manage a school system. This app was aimed at teachers, parents and students, in addition to admins moderating the system. We started big and worked our way through the waffle tasks but got overwhelmed along the way since it was a very big project for both our limited time and our team members' technical abilities. We faced many difficulties while working on this project; especially setting up mysql and getting it to work on all of our team members' machines. We switched to setting it up locally because the website we used to host our database kept showing an error of too many users so we kept testing locally until we hosted it online on a different website before the end of the time period. We work...

Commitment In My Point Of View

Being committed for me is all about following the rules and not trying to break any during the period I'm at that place or doing that thing. Showing up early, preserving energy for that commitment, doing everything I can to prove that I'm fully committed and what I do is important are all aspects of what makes me committed/serious in the eyes of other people. I try my best to always act professionally and I think I'm doing that most of the times, but I hope I can be better than that.

My Experience Working In A Group Project

It wasn't the best experience I had but everything comes with ups and downs. I learned more about how to work within a team and how sometimes tasks won't be completed while the deadline keeps approaching steadily. We should learn from all our experiences; both good and bad. My initial reaction was that I didn't think that things would work in this group but we managed anyway and we were able to deliver a basic project. I hope that the thesis project experience will be a lot better than this one. I actually learned multiple stuff and I'm grateful for that.

My First Solo Project Experience

I really enjoyed the two days I spent alone working on this MVP project. I got the chance to practice many topics covered in the curriculum at my own pace. Also I was able to experiment with new stuff that I didn't do before; like using bootstrap 4 with react and searching for APIs that supplied me with the data I needed for my app. It was a very awesome experience that I'd love to repeat again and again. I'm fairly satisfied with the outcome I made after these two days since it was a solo effort entirely. I didn't struggle thankfully, just the usual bug search and debugging here or there.

Deployment In Simple Words

Deployment is the hardest part in the lives of computer coders, it's harder than making apps and games. Any game that you have ever used for example on your computer had to go through many operations to be in the final form it is when you first bought it. The last operation is deployment as you might have guessed. It's about getting your video game ready to use and play on any computer out there. Many issues could happen while deploying the game since we have many environments to deal with these days.

Full Stacks From My Point of View

For the past couple of years I have been learning how to work with front-end languages and technologies like HTML, CSS and a little bit of  Javascript. However,  I have never really touched upon the backend until this month. It was challenging at first and we spent most of our time getting ourselves familiar with the new syntax and the many many many frameworks and libraries that are usually used together in combo when working on this side. Fullstack web development means creating an application and taking care of everything concerning it's functionality and UI.  We've been learning the basics of Javascript for the past couple of months and a little bit of CSS, HTML and jQuery.Now in the immersive we learned more front-end frameworks like backbone/react and angular. And for the backend we learned the basics of nodejs and express. For persistence of data we learned how to use sqlite3, mysql, knex, bookshelfjs and mongodb which I really liked. Putting a...

SQL vs NoSQL

SQL databases are called relational database management systems RDBMS, have predefined schema and are table based. While NoSQL databases are document based and have dynamic schema. Famous example on SQL would be MySQL and for NoSQL would be MongoDB.