Mahdi Yusuf

Mahdi Yusuf


Stop Calling People Morons.

Sunday, May 13, 2012

As I grow older, I am starting to realize the people who were idiots when you were younger are likely idiots later in life, just more set in their ways. These people are out there, learn how to deal with them.

That being said, I don’t go screaming you are a moron and what you are doing is insanely stupid. That is purely a reflection on me and how I choose to handle those situations. 

Recently I have been seeing leaders in software communities regardless of being correct or not, basically blowing up on other software developers on the internet because of something *stupid* they have done or said. 

REALLY?! Just because you were fortunate to work on something that is widely used and appreciated does that give you the right to openly belittle people’s efforts and work. Are they unaware of the effect their words have on others and the community as a whole?

That being said, you can simply say that you don’t care and continue doing whatever you want, but what about the rest of the community? Is that the example you want to send out as acceptable behaviour.

This is particularly hilarious, because people most famously know for this (Hi, Linus) are open source developers, where community and communication are key. 

Here is another example with Douglas Crockford, as irritating that can be( put in your semicolons), is this what you want to put out there?

Also here is a word to the community stop sensationalizing things like this, Linus’s comment was on the front page of HackerNews for an entire day; talk about ridiculous. Scoffing at someone getting embarrassed by a leader in our field is hardly something to relish. 

  1. Do good work.
  2. Treat people with respect. 
  3. ???
  4. Win?

This post is filed under #humility #code #open source #linus #crockford

Discussion


Python is Beautiful

Sunday, April 29, 2012

So I recently read an article that got quite a bit of attention in the Python community. Why are python applications being SO ugly?

Although he may be right in some cases, but for him to ask the question ‘Dear Python, Why are you so ugly?’ is quite ridiculous. 

The very premise of this statement is quite foolish. The person who wrote this article seems to be severely unimpressed with the level of design put into blogs and web application built on top of python.

With that being said, just to debunk his claim I have put together a list of applications that use python and are extremely well designed. 

So don’t judge me based on the layout of my HTML, but on the content of my servers. 

-Mahdi Yusuf

Instagram

This little company recently sold for a billion dollars. One of its factors for being so popular was being so beautiful, it makes heavy use of python. 

Pinterest

What another pretty app? It surely can’t be written in python? Yes. Yes it is.

Washington Post

News websites aren’t the most innovative of designs, but this is not ugly by any definition of the word. 

EveryBlock

EveryBlock started by one of the co-creators of Django, Adrian Holovaty. Ugly? I don’t think so. 

Mozilla

One of the biggest websites using Python these days. Mozilla is pushing the boundaries in both design and innovation.

Courtside

This application is one I wrote for Django Dash with the rest of my team. Although, I can’t take any credit for the design we did take the time to plan it out.

Youtube

Need I continue?

Also I think Path makes heavy use of python in its web application, which is acclaimed for design and innovation as a product. 

So making the statement saying that websites written in a particular language are ugly, doesn’t make a whole lot of sense. The python community is vibrant with a great many aspirations and interests, beyond just making pretty things. 

That being said the designers are what make these websites look beautiful and a breeze to work with not the language the backend developers code in. 

If you are developer looking to learn design you might want to check out Design for Hackers: Reverse Engineering Beauty


This post is filed under #python #design #beautiful #code #programming

Discussion


I’ll Sleep When I am Dead

Monday, March 26, 2012

There has been a lot of hype around polyphasic sleeping, being a person who usually lives with less than 5 hours of sleep a night, I thought this might be a cake walk. Being no stranger to lack of sleep, 24 hour gaming competitions, and coding sprints, I thought it would be cool to try out. 

So like any true seeker of truth I decided over the Christmas break to try out the Everyman sleeping cycle myself. The entire concept behind polyphasic sleeping is to trick your body and mind to quickly get into REM sleep (Rapid Eye Movement) which is the phase of sleep that is most beneficial to brain.

Polyphasic sleeping tricks the brain to quickly jump into this state due to the lack of sleep, as opposed to an hour or two into sleep like rest of you mere mortals. 

Everyman, basically consists of core sleep of about 1.5-2 hours with three supplemental sleeps of about 20-30 minutes. There are more extreme sleeping cycles like the Uberman which solely consist of 20-30 minutes sleep intervals every 4 hours. 

So I basically had two weeks to get into this sleeping mode, which I thought would be super easy cutting down from 5 hours to 3 hours. I removed major sources of caffeine from my diet so it wouldn’t alter my sleeping. 

Week 1

So the first problem I had to combat is waking up. I had several alarm clocks setup all over my room, So whenever I would get to sleep I would set the alarm for the interval I would be sleeping at and quickly rush to bed.

At first I found it extremely hard to fall asleep in the allotted time, let alone get into the much needed REM sleep (the good stuff), this was the horrible part the transition everyone has been talking about. I failed at the sleeping cycle a few times during this transition. That being said, I found the supplemental sleeps to extremely annoying and non beneficial at this point, and looking forward to my big sleep more and more. 

During this week, I found a lot of things changing, my apetite was diminished greatly, extremely vivid dreams as well as an overwhelming amount of time on my hands. If you ever want to do this, I would strongly suggest having some sort of project or a stack of books you want to read and keep your mind engaged, or if your lucky enough fool a friend into doing it with you. Most people will fail here and fall back into regular sleep cycle simply due to boredom. 

Week 2

Now on to the good stuff. During the second week I was able to successfully sleep for 30 minutes and beat my alarm clock most of the time. I was still extremely drowsy when I would wake up and would need non-negligible amount of time to get productive again. I had started a coding project during this time, I found myself extremely unfocused during the entire process and found it difficult to execute on what I had in mind, and getting caught up on the details often. Very similar to the end of coding sprints I have participated in the past. 

That being said I found myself quickly disinterested in what I was working on after a mere 1 hour or so. I found myself constantly  switching between reading, coding or the next shiny thing finding it hard to focus on any given one. 

I also have a theory about just being conscience that long, you start to lose a sense of time there is no finality just this never ending loop of waking up and sleeping, I know this is hard to understand, but if you think about it; when you sleep at night; you have this ease about putting the day behind you and moving on to a new day. With this you never have that finality its just infinite cycle of sleeping and waking up. I would be interested to know if other experienced this. 

Conclusion

This is impossible to keep up with any type of social life, unless your friends with a bunch of vampires. You can never be away from a bed or a place to sleep for anything more than 4 hours. You have to be extremely vigilant with your sleeping, the slightest change in sleeping can leave you very tired and slipping back to monophasic sleeping. To be honest it a lot of hassle to just squeeze an hour or two more waking hour which is basically spent waking up. 

As for writing code like this, you will be better served sleeping once, and just stocking up and tea and coffee until you finish what you need to get done. Sleep is better for creative mind and learning.

Sleep you need it. 


This post is filed under #programming #code #sleep #productivity

Discussion


Introducing Pycoder’s Weekly

Monday, February 6, 2012

The last couple of weeks Mike Grouchy and I have been talking about the python newsletter that we would want to recieve weekly. A curated collection of the best python news, articles and projects from around the internet delivered to your inbox in a beautiful package weekly.

             

The result of this talk has been Pycoders Weekly. The first issue is set to drop on Friday, February 17th, we hope you like it.

If you have created some content or run some project that you think should be in Pycoders Weekly contact Mike or me and let us know.


This post is filed under #python #code #weekly #newsletter #developer

Discussion


Everyone is thinking why in the world would anyone pick static, when you can be dynamic, so much more agile bro. Usually the thought process is what language am I most proficient in, that can do the job. Totally not a bad way to go about it. Now does this choice affect anything else? Testing? Speed of development? Robustness?

Dynamic vs. Static

Dynamic languages are languages that don’t necessarily need variables to be declared before they are used. Examples of dynamic languages are Python, Ruby, and PHP. So in dynamic languages the following is possible:

We have successfully assigned a value to variable without declaring it before hand. Simple enough, try doing this in Java (you can’t). This can *increase* development speed, without having to write boilerplate code. This can somewhat be a double edge sword, since dynamic languages types are checked during runtime, there is no way to tell if there is a bug in code until it is run. I know you can test, but you can’t test for everything. You can’t test for everything. Here is an example albeit trivial.

Now if you are raging to some serious dubstep, its easy enough to miss that small typo, you go screw it and do it live, and deploy to production. Python will simply create the new variable and not a single thing will be said.

Only you can stop bugs in production!

Static languages are languages that variables need to be declared before use and type checking is done at compile time. Examples of static languages include Java, C, and C++. So in static languages the following is enforced

Many argue this increases robustness as well as decrease chances of Runtime Errors. Since the compiler will catch those horrible horrible mistakes you made throughout your code. Your methods contracts are tighter, downside to this is crap ton of boilerplate code.

Weak and Strong Typing can be often be confused with dynamic and static languages. Weak typed languages can lead to philosophical questions like what does the number 2 added to the word ‘two’ give you? Things like this are possible with a weak typed language.

Traditionally languages may place restriction on what transaction may occur for example in a strong typed language adding a string and integer will result in a type error as shown below.

Conclusion

Regardless of where you land on this discussion, claiming one is better than the other would lead to flame war, but there are places where each is strong.

Dynamic languages are good for fast quick development cycles and prototyping, while static languages are better suited to longer development cycles where trivial bugs could be extremely costly (telecommunication systems, air traffic control).

For example if some giant company called Moo Corp. spent millions of dollars on QA and Testing and a bug somehow gets into the field, to fix it would mean another round of testing. When sitting in that chair the choice is clear static languages FTW, its a hard job but someone has to milk the cows.

Test, test, and test.

Just a little food for thought, for when you are starting your next project. You never know what limitations you maybe placing on yourself and your team.

What do you do consider when selecting a programming language for a project?


Discussion




Copyright 2012 Mahdi Yusuf
Errrrday I be programmin' (oh and hustlin' too)