28 May, 2018

Project , Design And I


Design of a project structure will start mattering when you are working on a huge project with multiple peoples. It’s very easy to get lost on where what is written. This is why Design Patterns came to be. One of the most popular and most flexible design pattern of a project is n-tier architecture. I’ll be talking about this design pattern on this post.

I’ll call the Whole project as solution. No, I’m not talking about C# projects only. Declaring this because otherwise this term project will confuse readers in multiple places.

N-Tier Architecture: 
It basically divides the whole solution into multiple tiers. Each tier will work with one type of concern. N stands for your tier numbers. For instance, your project can be 3-Tier,4-Tier etc. It can also be 1-Tier as well. For small solution it’s very common to follow a 1-tier Architecture since there are very little concerns to think about. Another thing to be clarified, one solution Should have only one executable. If it has multiple executables it should be divided into multiple layers instead of multiple tiers. We will talk about multi layered project another time but for now just know that each layer is one standalone executable.

How many tiers should one Solution have?
Well that’s a very good question but there is no definite answer. It’s all about personal preference. The more experience you have the more tiers you can define before starting the solution. From my experience each solution usually creates multiple tiers that I never needed before. But I could always suggest a few templates.

But First let’s talk a bit about layers, Always breakdown executables into layers. The current pattern that the world follows for designing any database related application is that it always has an API layer. A Database layers. And obviously multiple Front-End Layers. Bear with me if you got lost already. Well Front-End Layer is basically the UI Solution that Only Requests Data from the server and shows it to the clients. Almost Zero Logic related tasks are performed here. A Standard Solution should follow this rule. But you know… It’s hard to follow the rule everywhere. The API Layer, is where all the calculations happen. Well you could burden the database with complex queries to do most of the calculation for you. But As far as I know it’s best to bring data from the database layer and do the calculations on this layer. And ofc Database Layer, which most of us usually ignore. But Did you know you can Code on Database as well. Which is called PLSQL. A well-designed project should implement PL-SQL on database and define triggers and some more things on the Database Side. Now each layer is divided into multiple tiers.


API Layer Breakdown:

Let’s start with API layer breakdown. Well there’s no definite number that must be followed. Your solution might need less tiers or more. But most commonly there are 3 tiers.

Application:

This tier is the entry point of the layer. All the API configurations such as routing, white-listing are done here.

Business Logic:

This tier is basically the Core of the project. The application layer only accepts request and returns some message(Data). The business logic tier is the part where you define what should be returned and in what format etc.

Repository:

This tier is where you communicate with database. Business logic layer communicates with Repository to get data from database. Here’s the part where you write down Queries of Database. NO, I mean no Queries should be written outside of this part.
Now There are some Tiers that I Strongly recommend making. But first I forgot to mention about Model/Converter Projects. These are easily Mistaken as Tiers but I don’t want to call them as Tiers. Because their sole task is to make other tiers communicate with each other.

Special Type of projects:


Data Model:

This model represents the database. This model will be used to communicate with database.

View Model:

This is usually made optional. But I strongly recommend making one View model project. In most cases the view model and data model are same. But that’s not always true. You might want to show data from multiple tables on a single view. What’s a View you ask? View is basically what the clients See. It can be an HTML Page.

Converter:

If you make a view model project you will need another project that converts view models into data models and vice versa. Initially you will feel like this is just a hassle but trust me this will make the Solution much more readable.

Why Do I recommend the view model and converter along with Data model On API Layer?
Because Usually front-end developers are a different team. They need not to be burdened with database’s design. It’s easier for them to communicate with the API layer with a View model. It’s not just easier it’s also faster. Because then front-end developers won’t have to create a Conversion project with a different View model. Because that’s what they would end up doing. So, it’s best practice to design the logical parts on the API layer not on Front-End Application layer. One way or another these 2 Projects are added to the solution. Better do it on the API layer.

More Breakdown: You can breakdown the layer into more tiers. For example, you could even make Business logic into 2 different project that suits your need.

Database Layer: I’m no database architect so I can hardly tell anyone what to do. But as much as my knowledge serves It has a few configuration stuffs. PL SQL part and Triggers. These should be taken care of.

Front-End Layer: Front end layer could get complex depending on Technology. And platform. But there are some basics that can be commonly described.

Controller:

 Controller is what handles the request. This is the head of Front End. This will communicate with API/Backend layer and bring RAW data. Then format it with Model.

Model:

This model is the View Model. It’s best not to design additional set of Data models because API/Backend layer wasn’t optimized for View Model. But in most cases, you won’t get a perfect view model. So, you will probably need another data model project with converter.


View:

This project will only contain views that the client sees. No logic should be written here other than those that construct the view with Models
Now know that this is not some absolute rule. Rather a starting point. Each project is unique. Most of the time you will need to configure these layers and tiers as your project suits. Instead of memorizing the pattern feel the pattern and understand it.



17 May, 2018

Better, Worse and Us

I've never been a good student , that's why I always felt when I was at school and college. My parents, relatives made me feel that way. When I got into University it's not like I got smarter. That's not how any of this works. You see since the day we are born we start comparing our lives with others. We measure our achievement with respect to what others achieve. Our parent's want us to be doctors or engineer because that saw those title makes them feel more achieved . If our Poets/Artists was earning as much as Doctors or Engineers they'd be trying to make us Poets or Artist instead of Engineers/Doctors.

So why is it that I/My Parents/ Others thought I wasn't a good student ? Well you know there's always someone better than you. Unluckily I was matched with people that were far better than me in the school. Yes they were great. And they got admitted into Public Universities with other great students around the country. Now when I look at them, I can see the same old me in them. They had met people better than them. Now they feel like oh, I'm so stupid but that guy/girl is very intelligent. But from my perspective they were the one of the most intelligent ones. Now here's the thing when I got into university I saw people treating me like I used to treat my intelligent friends . Then I realized everything is relative . There's always someone better than you and also someone worse than you. And none of it actually matters for the very same reason. Because there's no such thing as good/bad student.

We just have this delusion of being better no, Best. you can never be the best. The more you thrive for it the more you will realize it's pointless. Instead find peace with what you have and hone your skills. Be confident about it. There is only one thing that you can be best. And that is being you. Only you can be the best you. Since the day one we were told we can't be Einstein, Newton . We don't really have to be them. I wish my parents wanted me to be the first me.


13 May, 2018

CV, shortlist and others




I'd like to share how do we shortlist CV. But first Know that this is how I or the people I know does shortlisting. So I could miss a lot of points. But I'll try to point out most of the things I know.


We never check your CGPA , instead what we check is if you are a graduate or still a student. Now graduates get more priority. But first let's talk about students. There are two types of student that apply. 

One that is confused about life. Just want to get a job desperately another one is passionate one. If you are a confused student we can figure it out pretty easily. For example confused students will apply for digital marketing and feature programming skills on CV. If you are a programmer why are you applying for digital marketing? If you are interested in digital marketing why are you showcasing programming?

But the same thing could be reversed in another case. If an EEE student applies for development with a few good maybe just one good project we expect him/her to be passionate one. He's probably going to be shortlisted.

The CV should contain relevant data to make reviewers interested in to you. Experience section is thoroughly checked. But beware. If you have 3-4 Job experience in a year... Then you are less likely to be shortlisted. Because we think that you have a tendency to switch job as Soon as the opportunity arrives. Company expects stability. But of course if you have 3-4 years experience from one place you will have a higher demand. Experienced people are more likely to be shortlisted.

There's another factor that's called luck. It's unprofessional but it does matter. Sometimes how you represent yourself could offend the reviewer or amuse him . Better not do something unprofessional in the CV. Well I did do something like that. In my CV Wrote that I need a valid job to get married . Well my boss was cool enough to let that slide. But your reviewer might not be. To be honest I did that to ensure that he's actually cool with my attitude. Because you can't just go shift jobs just because your boss didn't like something you said or vice versa. Don't take a job without knowing if your compatible with each other just because of the pay scale else you will regret it.



05 May, 2018

Programming, Language and I

One question that I always face, "Java or C#? " . Sometimes the language name changes but the choice remains. Since we were young, we were taught to always compare two or more things. As a result we can't stop comparing 2 things. Firstly I'd say the question itself is stupid. So the answer is also a stupid one. In the end the answer of this particular question is but an opinion. Why are you trying to decide which language you should learn based on someone else's opinion? If you are smart you will try to avoid answering to stupid question like those. Let's modify the question a bit. Why Java? And Why C# ? Now that's a question that is worth answering. Java has some feature that C# doesn't have and C# has feature that Java don't have. 


C# 

Pros:

If you are a windows fan boy. C# is what you should choose. Don't even look at Java. C# actually has quite a few wonderful features that Java won't provide. Properties. Java don't have properties. You will love properties once you get fed up with Java's redundant getter and setters. To be honest this is the only feature that is good enough for me to switch from Java to C#. Another good reason is Solution. I totally love how they manage projects with solution. In Java you have to do this with package. But C# made it beautiful by adding a visual root project that is called Solution. I don't recall java having a package manager where as like most other popular languages C# has a built in package manager called nuget which you will come to love as a developer.

Cons:

The biggest drawback of C# is , It's actually built for windows application focused. So if you are planning to make a cross platform application you will be at potential risk. C# is a programming language true. But it's dependent on .net technology for development. And that's dependent on windows. There's a Cross platform version of .net that is known as Mono but that's left for another day. If you plan to deploy a cross platform application with C# you will find it a little bit difficult to do so directly. Even if you see that you can develop Android and iOS applications on Native C# you should not do that. Trust me.


Java

Pros:

Old tech. Rich libraries. Cross Platform. Same code will work on Linux , Windows and Mac. If you are planning to distribute your application on multiple platforms with lest amount of pain. This is a very suitable choice. I don't recall any extra feature that Java offers but C# doesn't other than this.

Cons:

It's Slow. SLOOOOOW. Everything good has it's draw back. Also you won't find it's binary built in on windows or most other OS distributions. You will have to Ship the JRE with your application most of the time which kind of makes the product heavier and looks stupid.

A personal test info: I made a windows form it took 5 MB ram to run it. I made the same thing on Java. Which looked far more aesthetic and easier because there were libraries for new design. But it took 80MB ram to run the application. So if you are aiming for a memory efficient application .. Java won't be a very good choice. But if you wish to have a good looking app that runs on Windows,MacOS and Linux ... Then Java is a suitable choice given that memory is not an issue.


Python

Pros:

FAR Richer libraries than C# and Java. Cross Platform . FAST! It's faster than both C# and Java and I mean like 3-4x Faster. No need to worry about that semicolon. No need to think about braces. Best for most cases. No need to declare data types. It's Magical. Probably the best development option right now.

Cons:

If you don't maintain indent , this is not for you.If you love data types this is not for you. If you need braces like i do , This is not for you. Python isn't your traditional programming language. It's python.
If you wish to develop large scale web app this won't be reliable. If you wish to develop desktop application you can use PyQt which has some licencing issues. If you want to publicly distribute your application you rather not use this.


C++

Pros:

Father of C# and Python. Faster than Python. Cross platform.

Cons:

You will have to manage the memory.Developing applications are not as easy as other three above.This is for very hard core developers that want to have access to the memory. For example game developers loves C++ as they can talk directly with the machine with this. If you wish to develop desktop applications. You have a good looking library Qt. You can get a free version of it.  But the Development process is tedious.


C

Pros:

Father of every other language. Fastest High level language.

Cons:

It's stupid to develop applications with raw C. It's also not Object Oriented.

Now it's here's the thing.  All of these are used for developing applications of different tiers of developers. its for you to choose which language suites your need best. Don't let someone else's opinion influence your l

02 May, 2018

University, Cgpa and I

One question that I always see, freshers ask,"Can I get a good job with my *.** Cg pa?". There's a short answer and a long answer. If you want the longer and detailed version do ignore the short one.


Short-version:

I'll give myself and my experience as an example. I was a student of American International University Bangladesh. I completed my bachelor's degree with 3.98 Cg pa. I was awarded the maximum honor. Sum ma cum laud. Since I'm from CS background I will only talk about the job market of CS.
So does CG PA matter for getting a job?
98% times the answer is no. So you can stop reading any further.
So what's in the 2%?
Teacher and Researcher. If these two don't pique your interest then you can forget about cg pa. Going abroad is included in research field.

Long Version:

This part will be a bit detailed for what I made such a blunt statement above.
I've given and taken enough interviews to let you know which part is actually checked in the CV for shortlisting. Actually let me tell you the parts that are ignored first hand. Your educational backgroundyour grades. Shocking isn't it? No. Nobody cares where are you from as long as you know things that will benefit the company. One of the core feature could be your skills. Another can be your ideas. How does a company get a glimpse of your skills? Or ideas that you have. Well for ideas it's simple. You need to start blogging to let others know that you know stuff. For skills you need to provide at least one good fully working project. And it should be hosted on some public git community, such as Git Hub.
First thing we do is check the Git Hub profile. If you have weekly contributions all over the years, it is a good profile. I saw people only publishing the project once done and never updating it. Most of the case I would think that this code could be stolen or something. Then we open up a random code file and check out if code has been done following some convention. Did the project follow a design pattern. Well design patterns are bonus marks where as convention is critical. If you didn't name your variables properly or line indent is not cared for. There's 100% chance that your CV is not looked at any further. Just in case everything goes well. We check your educational background. If the cg pa is high, you will probably not get a call. Because company needs stability. It's quite common with high cg pa students to go abroad. This is probably a  worst case scenario. There's a chance that's why I mentioned it. So those with very high cg pa... You have something to worry about.
Now have you once noticed that I checked the cg pa to decide if I should shortlist him/her? No? Exactly my point.
CS related task doesn't require you to have a degree. It only cares for what you can do for the company.  So focus on building skills.

Things that matter in a CV? Maybe another time.Stay tuned.....