Thursday, December 24, 2015

Flask like routes in Falcon Python Framework

Disclaimer: This is not all my idea or code. The idea was implemented in a Tornado framework that I work on, and it came from one of the popular Tornado gists.

When I came into the Tornado app that had this implemented, I was pleasantly pleased to see how the routing worked. I have never worked with Flask, I only later found out that this was how Flask does it. Why was I pleased then?

As with Falcon, and many other frameworks, you have a file that starts your app up. In that file you manually include all of the handler classes, and then manually add each route. This is very verbose and with a big application, can make this file become overwhelming. That isn't the only problem though.

When I would want to work on a particular route in an application with verbose routes, I would have to open the app file, find the route, and see which handler it belonged to. Then I would have to open that handler file. Too many clicks for this lazy developer. With the route decorators, I just open the handler file I know I need to work on, and find the route I care about in there.

There are better reasons for this than just catering to the lazy developer though. With the autoload function I am able to import all the handlers automagically. With the route decorator I am able to the same with the routes. This makes for not only a nice clean readable app file, but when you add new routes and handlers, you don't have to go touching the app file at all. The least we can touch this file that can quickly turn into a monstrosity, the better. It is the file that starts the app. The last thing we want is to deploy new code and find that the app didn't restart because of an error in the app file.

So here is a gist of the route decorators and supporting functions to make this happen.
Add this file into your app root.
Then your app file will just need to look like this. 

You'll never have to touch your app file again unless you need to add more functionality upon start up of your app.

One caveat to this approach is that it won't work for custom routing. According to the docs you either use your custom router, or the default one. In the case that you want custom routing, you would just add the ability to accept more parameters into the route decorator, add them on  self._routes.append,  and finally in the add_routes function add them to your app.add_route call. I have not tested this, and hopefully you decide if you need custom routes before your app is built out.

Sunday, November 8, 2015

My First Job as a REAL Developer

I literally took the first job that came along. Once my resume was updated with my new shiny degree, the recruiter calls were rolling in. I had no idea how any of this worked or just how far I could go with my skills, experience, degree, and unicorn card. Had I knew then, what I knew now, I would have taken my time and researched companies, done a lot of interviews, and sought out a culture of diversity. I probably wouldn't have taken a PHP job either. The money was well more than I had ever made though, and with a 4 year old and new baby, I was game.

They were on the 16th floor of this building
Some very aggressive recruiters from TekSystems got me in with a smaller company in Dallas that stayed on the 16th floor of the right gold tower in the DoubleTree on 75. It was a cube based office. The lighting was ambient: small squares of cloth strung up with soft lights beaming up on them. There were nerf guns everywhere. It was pretty much everything I had heard a dev shop to be.

The business was CRM's for Convention Center bureaus. It was written using a homegrown PHP 4 framework that attempted to be OO. The database was in Postgres with a lot of xref tables. The code was overwhelming given the nature of it. Everything we pulled from the database was formed into XML using PHP. The XML would then be rendered via XSL. That's right folks. XSL. Very poor documentation. It caused a lot of pain. There was some Javascript, but it was vanilla. In 2008 that was not fun. My favorite thing that I got to do was data import. When we got a new client, we would have to take their current database and figure out how it fit into ours. I was able to do this a couple of times and it was my favorite thing to do.

Ex-Co-Workers desk, you can see the awesome lighting
So I'd found myself in a real software shop. Well... web software. I was very excited to finally had made it! TekSystems gave them 6 of us. They only kept 3 and I was one of them. I was one of the first to be hired only 2 months after starting. We had a team of 7 and were just beginning to adopt this Agile/SCRUM stuff. We used an actual board with post-it notes and had bi-weekly day long sprint planning meetings. We used sub-version, which was a concept I had never heard about. I was one of 6 women in the whole company. The other women were not developers and I never interacted with them.

My team was made up of a bunch of early 20's single guys who were all self-taught in some form or another. Some of them had degree's, others did not. I was in my late 20's with two children, one being a new baby. I certainly got some looks when I walked in and was introduced as a developer. There were a lot of your dev stereotypes. Some of them didn't know how to take me. Most of them wouldn't listen to me at first. While I was working hard to learn the system and all the gotcha's of PHP, my degree prepared me very well for business process of software engineering, so it was frustrating when guys with no degrees and knew someone who worked at the company wouldn't take any of my suggestions.

Me in meetings
It was a tough first few months getting to know the team. I really had to work hard to prove myself. A lot of lmgtfy links came my way. Interruptions in meetings and what not. I assumed it was the nature of young single men, I mean, they interrupted each other a lot as well.

Either way, I was treated like the punk little sister for a long time. It was hard to get a word in, but they slowly came around to me. Don't get me wrong, not all of them were this way. I had one guy who was an advocate for women, believed in my abilites and continued to mentor me after we no longer worked there. My manager was very good. An older man who was a very experienced dev manager. He was hands-off, but in meetings when he was present, he would always call people out, including me, to hear their thoughts on something.

My team lead, while not used to the idea of a female developer, did his very best. Towards the end, he leaned on me to help with SCRUM things and organizing releases, and asked my advice on many things.

There was this one guy though. He just never took me seriously. I had found a bug one day. I fixed it, but it was such an anomaly I had to show him. He saw it, and was just as wow'd as I was that it was even a thing. He then began to man-splain how it should be fixed, and I interrupted him showing him how I had already fixed it (which was a lot better than the path he was going down). He got really quiet, and said quickly "Well that is clever" and B-lined out of my cube. That was a pretty huge win for me and he then had more respect for me after that.

I did get pregnant when my son was 6 months old.  Unexpectedly so, and I don't handle pregnancy well. I mean, all of them were fine, I was healthy. I just don't like lugging around another person in my body. I was also FREAKING out on how I would afford daycare. This made things even more awkward for the early-20-somethings I worked with, because they were still having to get used to having a woman around, and now I was pregnant.

The very worst thing that was said to me was when I was expressing concerns of having another baby. I can't remember the exact words, but he said something along the lines of: Well you shouldn't have babies if you can't take care of them. I eventually got up and went to the bathroom and cried. I never let anyone know though.

So the dynamic with my team mates had it's up's and down's. Win's and losses. I instinctively knew to lean in and I constantly fought for myself. My manager and upper management, who were all older and had families, gave me really good reviews. There was also an older developer on our team who had a daughter in college for something STEM related. He too was an advocate for women, and he was nice to have around. He worked with me and mentored me as well. He was overshadowed during meeting time by all the early-20-somethings too smart for their own good as well.

Son number 2
Things at home between my ex-husband and I became worse and worse as the pregnancy carried on. So bad that when my second son was born, I was ready to get out and file for divorce. I had a C-Section and was working 20 hours from home 2 weeks later with a newborn, 15 month old, and 5 year old.

I went to my bosses boss and let him know that it was imperative that I get away from my husband, and to do so, I would no longer be able to afford to live in Dallas. I wanted to move back home and get my life in order. He allowed it. So I did just that. I moved to Texarkana when the baby was 8 weeks old and began to work from home. The teams lack of inclusion really came out then. They constantly complained about how hard it was to have me being remote. It came up A LOT and it was stressful, but at least I was home. A year later the company sold out to their competitor and laid me off. That took me to my next adventure which I'll write about in another post.

All in all while this post may sound bad, I learned a lot from this job, and appreciate all of my co-workers as I learned a lot form every one of them. The sexism and exclusion I dealt with was mostly on a subconscious level. I think a lot of it had to do with their age as well.

I did have the few gems around me who were real allies, some even not mentioned in this post. They really helped me make it through. I came in it expecting to have it hard because I was a woman, I accepted that it how it was, and dealt with it accordingly. I was prepared. There was a lot more good than bad. My performance was great and undeniable, so it made it hard for anyone to get too ugly. I left there with respect from them all. To me at that time, I knew this was a problem with young single men in general, not just developers in the tech industry.

Saturday, November 7, 2015

This is how I got here, a long biography

Hello world!
That's sofa king cheesy but seriously how I feel. I'm Kacie. Your average WIT. I wasn't coding on a Commodore 64 when I was eight years old. I was playing with barbie dolls. I got a Nintendo when I was 6. I never beat Super Mario Brothers, but I kicked ass on all the Sonics on my Sega when I got a couple of years older. It's also how I learned to cuss.

When I was 15 I had a bff that had his very own personal computer. I was amazed. He went into these... chat rooms on this thing called mIRC. He talked to people all over the world! Being highly curious what went on outside of my own little box in my own little home town, this was quite intriguing.  When I was 16 I opted for a computer instead of a car. I discovered things like midi files, chat rooms, and web sites! I loved the graphics on the web sites as lame as they were back then. I loved to draw so paint was pretty neat to me before I discovered Photoshop. 

I became an anti-social computer nerd. I had one friend of mine come to my house because I was so sucked into my computer that she UNPLUGGED IT! I went into every file in Windows, I pointed and clicked my way around quickly and learned the OS quickly. It was all so new to me. I ended up dropping out of school and just getting a GED at 16. Then I stopped being anti-social and got into the ED scene.

I continued to play with Photoshop and make all sorts of graphics. I made a rave flyer for an event once. I knew I wanted to make web sites for a living. Whatever that entailed. I mainly wanted to do the design though. I continued to party until it got boring, then I met my ex-husband. We had a daughter. I was a hostess at a restaurant, and he was a server. I knew I needed to go to school so that I could support my daughter. So I did just that.

I got a job working at a Beer Distributer in my home town. My dad worked there as a salesman. They needed someone to make signs for them. It was about 20 hours a week. I used a program called Flexisign. I would make posters for bars, point of sale, even table toppers for restaurants. I eventually brought Photoshop into the mix so I could have better effects. I loved the job. It got me through school.

Me at the beer distributor with my big HP printer and color chart

I started school at our Community College. I was getting an 'eCommerce Certificate'. The teachers that were pushing for it had me take: BASIC, Advanced Databases, HTML, Logic, Accounting and I took InDesign as an elective. Here were my reactions to each class:

  • Advanced Databases was Access with queries. Loved the query language. 
  • Logic was well...logic. We made flow charts and what not. Had a really good teacher. It was a piece of cake. I didn't understand how some of the kids were failing it. I found it to be fairly simple and fun. Like puzzles. 
  • HTML we made a website. No CSS though. Was really simple. My teacher thought I had previous experience based off my site. I was his star student. Well, honestly, this was true for every class
  • Accounting was easy. My teacher said I should go into it as a major. I told her lolno. Math annoys me. Check's and balances. Too much risk, and making web sites is WAY more interesting. 
  • BASIC was neat. I really had no idea what I was walking into. I had never written any code. Our teacher had us using GOTO's all over the place. When my first program worked and I just printed some stuff out I was in awe. Coding was AWESOME. As the semester rolled along his assignments were really annoying with all these GOTO's. I mean, of course I was making straight A's but it was so tedious. Then, in the second half of the semester he told us about the magical WHILE loop. I tried it out and was so mad that I had to deal with GOTO's the first half of the semester. Assignments were even more of a breeze, and a lot of fun. 
Needless to say, the semester ended with a 4.0. My HTML teacher recommended me to make a site for one of the administrators personal business. I did this. I hooked PayPal into it. It was all table layout. I made all the graphics. It was pretty horrible, but back then, not bad. He loved it, and I totally got paid. Then my boss needed a site for some political campaign that he was running. Made it. Got paid. He also needed a site for the Mountain Valley Water portion of his business. It was pimpin' for real. Table layout with rounded corners. Sweet background I made in photoshop. Got paid. 

I guess making that site was around the time I started my second semester in my 'eCommerce Certificate'. This time it was COBOL. I can't remember any of the other classes. My COBOL teacher was my logic teacher. He expected a lot. Not just from me but from the class. He gave written tests and programming tests. I would fail my written tests because I don't need to learn that. When I run my code, and it had an error, it told me what I was doing wrong. Because I always ran my code, 100% on the programming tests every time. I made a B. 

Then the certificate failed due to lack of interest. The community college was behind in the technologies it was teaching, and didn't offer a degree I wanted. Since I was stuck in my small town with no big college, I sought out an accredited online university. I found myself getting a Bach degree in Software Engineering. We didn't learn about big O, data structures, and algorithms. We learned about Agile development, requirements gathering, computer networking, Java, UML, and SQL. More of the process of the software lifecycle. With some coding classes. There was a few classes focused on OOP. At the end of all the specialized curriculum, I had written a chat app in Java.

I Photoshopped my son when he was born, badly
Six months pregnant with my son, and eight months from graduation, I put my resume out there looking for a web developer position. I interviewed with a small company in Dallas that did a lot of print work for the Galleria, along with doing brochure type websites. I got the job.

There I learned CSS, more Photoshop, and even Illustrator. I played with some PHP and Javascript as well. My boss was really into using Drupal, so I learned to make Drupal themes. It was really new at the time. I also wrote a click tracking program for him in ColdFusion. This saved him from having to pay for a service to do it. I was able to design and implement everything on my own. 

Once I graduated and updated my resume with my current job, new skills, and a shiny new Bachelors Degree in Software Engineering with Summa Cum Laude, my phone was ringing off the hook. I was hired for a company doing PHP and Postgres.

It worked out too because my boss really didn't need me anymore. He was impressed with my new job offer and I still keep in touch with him every now and again. I very lucky to obtain this job in the middle of a big metropolitan area where my boss was a true advocate for WIT. I learned so much in the short amount of time I was there. It was time to move on though. More money and a brand new career.

His sisters came out well though 

I'll go over my other jobs and experiences there in another post. This is plenty for now. This post was to give you an idea of how I came to be interested in Technology and my impressions of being exposed to it for the first time. If you've read this far, thank you for taking the time to go through my adventure in learning technology and how I made it a career.