Posts

Composition VS Inheritance in stack's implementation

Image
To prefer composition over inheritance was the choice of many people I happen to learn a lot from, In many cases, it sounded natural and made sense. With composition, you ensure single responsibility and loosely coupled components of your software. However, if we think that inheritance means "Is A" and composition means "Has A", It's very hard in many cases to say that a Doctor has a Person instead of saying a Doctor is a person, I tried but I couldn't do it. Anyway, I'm here for a different reason, I'm here to talk about an example when I had to choose between composition and inheritance and why did I favor one over the other. When I started using dart it originally had no stack implementation, I decided to create it ( Give it a look here ) and I would need to re-use the functionality of the list class in Dart. Inheritance way Let's see, can I say that a stack is a list? maybe, I wouldn't say that in an exam as well as on any other occasion ...

Containerize your development environment.

Image
High chance you guessed it right, we will be using Docker. Docker is a great, famous, and very tool. But remember if you use it wrong you end up breaking the traffic of your CI/CD, so don't forget to practice and to use proper versioning organization. Before you continue, this article is covering only the use of VSCode, If you want to know how you can use other Editors to achieve your goal, you have to do some more digging (if you found something interesting, I'd love if you share it with me 😉 ) Why I would do this? I know you're here because you already had reasons to think it's a good idea to sync the development environment between the team members. Maybe you want to add my situation to your reasons, I work with flutter, recently they released Flutter 2 which has breaking changes if you want to upgrade. If you have a small project that depends on one or two packages or maybe no packages at all like my pet project Dart Stack  you might need to upgrade your project (s...

Install flutter - the easy to follow steps

Image
What is this document for? This document will provide you simple step by step guide to run any flutter project locally and see your changes take effect immediately while you're editing. Installation. Download  and install android studio, We will not use android studio but it will install all needed SDK and environment variables we may need. Install XCode , This step is optional, you will need it only if you intend to run on the iPhone. Install flutter  by following the guidelines of your OS, As a brief, you can follow the Install flutter section below. Install VSCode . Install Flutter. Linux Download  the SDK. Execute the following commands. mkdir ~ /development cd ~ /development tar xf ~ /Downloads/flutter_linux_v1.2.1-stable.tar.xz # execute the next command or append it to your .bashrc to avoid the need of executing it again export PATH= " $PATH :~/development/flutter/bin " flutter doctor # provide us the output of this command when so...

Chatbots and self injury messages

Image
Some of the people who face some frustration or depression usually use their smartphones to try to get rid of negative energy. They start surfing facebook pointless, maybe they open youtube and seek for anything interesting. Some people actually talk to chatbots, we have Siri and okay google as famous and popular examples. The question is: Are those chatbots prepared to deal with them if they are willing to hurt themselves? I tried them with some messages and here is the response. I'm depressed Ok-Google acted so horrible and said (I'm sorry to hear that), No advice or further questions to see if it's a real or deep depression that may be worse if the person didn't act on it. To be honest, I had a hint that I can ask Ok-Google to cheer me up and the conversation can continue and I may find some joy. But, I hope if it was more caring and aware of how dangerous this may be. Siri: I'm sorry to hear that. I'm here if you want to talk. Well, is ...

Teaching programming to children can be evil

Image
Teaching programming to children can be evil sometimes, why? Before I start telling, this article is written to warn parents from being fooled by scammers. Not always an intentional scamming, to be honest. Also, this article is for developers who are interested in creating an open-source material for teaching basic computer concepts for children. Okay, not only developers. teachers, artists and movie makers all can collaborate. Anyone else isn't meant to continue reading unless they are just interested. Some Stories I'll start by telling some stories. I was a mentor in an event called Nasa space apps challenge - Ismailia , Some teams were children competing against the teams made of youth and senior college students. One of the judges was my mentor one day(His name is Kareem),  we were heading to Cairo in his car after the event and all of us were just describing how amazing those children are. Kareem: When the children went up to the stag...

Why GitHub?

Image
In my Article: Why you should learn version control , I described why I think every developer should learn git and use a website similar to GitHub. I also provided some getting started material. In A Walk through GitHub Article , I described how people should Interact in GitHub. But why GitHub? What can I get from this community? Work with experts Your PRs are going to be reviewed by other experts who read books, took courses and got certified. They will leave comments for you, I work as a part-time mentor and I know how much students pay just to afford experienced mentors who will leave comments for them. Get some reputation In meetups, when people talk about how revolutionary is the Bitcoin, some people will happily announce that they are Bitcoin holders or miners. How many will announce with confidence that they are contributors? Can you imagine yourself in this situation?  The most revolutionary and famous open-source software products are...

How people get scammed?

Image
In the past few months, I was tracking some rogue thieves and their online activities. I found that most of them depend on greed, naiveness and impatience of people. In this article, I want to tell you some things that you have to suspect once you notice one of them. Please note that this is not a complete list, stay aware and watch out because many people out there need your money no matter how they will get it. Too good to be true when an offer is too good, ask yourself why not everyone else making use of it? why not everyone is happy? why life sucks? One-side win When someone gives you an offer, he is probably advertising his product, getting rid of old unmatched trades so that he can get money for more successful trades or even he is drunk and he got a baby so that he can’t see what is he doing. All of these can be chances for you, also you can easily detect such cases. But when someone gives you an offer and you can’t see what he ...