Author Topic: making boss websites with php  (Read 1703 times)

0 Members and 1 Guest are viewing this topic.

Offline Lanny

  • Zealot
  • ****
  • Posts: 1,123
    • View Profile
Re: making boss websites with php
« Reply #15 on: November 08, 2014, 05:05:12 pm »
One thing I've missed so far is TDD - I haven't had the time to write tests for my project, but I don't feel bad about since it's only a bunch of basic operations, but is testing something that is easy with Django? On one hand, testing is easy with Rails, but it's also easy to create a horrible test suite (slow, looking at code coverage instead of testing code that should really be tested) but I think that's an issue more with the community than with the framework itself.

It kinda depends on what you're looking for in a test suite. There is no (or at least no one ever uses a) rspec equivalent, the common testing library is django doing some light transaction wrapping over python's unittest library which is modeled on jUnit. It's pretty straight forward, real easy to pick up but has all the same pitfalls of most testing arrangements. If you want it to run fast you have to mock and inject all over the place. One nice thing about python is that often you can get away with monkey patching rather than explicit dependency injection. Some people would consider that the exact opposite of nice, and I understand why, but I really think that there are places where the internals of a process are stable enough that you can save complexity in the primary code base by patching in the tests.

There's also support for doctests which are cool. I don't use them a lot because they've more conducive to a less stateful environment in my experience, but other might not feel the same.

Offline RustyShackleford

  • Devotee
  • **
  • Posts: 213
    • View Profile
Re: making boss websites with php
« Reply #16 on: November 08, 2014, 07:13:44 pm »
These 'apps' that you guys are talking about are they purely web based eg. navigate to the website and use the app, or something that you download but interacts with a db, or some hybrid. I never fully grasped how people are making local applications with things like rails, but it does make a lot of sense as far as portability (to different devices).

And LiquidIce that's interesting you never did php,what was your experience prior to django? I really really want to get a web development type job when I graduate in the spring, but I feel like I'm in this weird in between of self taught knowledge, but lack of real experience. My current job I work on a website, but it is mostly cms stuff, which is pretty boring and not a great experience beyond the experience itself. Of course it's all about how I spin it and I think it will be a valuable stepping stone. Sometimes the job market seems so competitive other times it seems stupidly easy, for example the people at my current job were super impressed at some basic javascript I did that would have otherwise had to be contracted out or gone without certain functionality. Too bad it's a temporary part time position or I would feel a lot more secure about the future.

Offline Lanny

  • Zealot
  • ****
  • Posts: 1,123
    • View Profile
Re: making boss websites with php
« Reply #17 on: November 08, 2014, 07:43:05 pm »
For the project I was talking about earlier, yeah, the only user facing part of the application is a website. You can't make native applications with rails. You can with ruby, which might be what you're thinking of. Another way you might use rails in tandem with a native app is if you have some central DB you could write a native app that uses HTTP requests to communicate with a rails app which in turn communicates with the DB (you generally don't want public native apps interacting with your DB directly). That's what most phone apps are these days, so like snapchat has a native component that operates your camera, displays pictures, w/e and it talks to a web server to get snaps that are sent to you (presumably) over HTTP.

There are also projects for "nativization" client side web stacks. Cordova and node-webkit both take javascript/html/css and package them in a way that makes them look like a native app to their respective target platforms.

Offline LiquidIce

  • Adherent
  • *
  • Posts: 52
    • View Profile
Re: making boss websites with php
« Reply #18 on: November 09, 2014, 11:23:06 am »
These 'apps' that you guys are talking about are they purely web based eg. navigate to the website and use the app, or something that you download but interacts with a db, or some hybrid. I never fully grasped how people are making local applications with things like rails, but it does make a lot of sense as far as portability (to different devices).

And LiquidIce that's interesting you never did php,what was your experience prior to django? I really really want to get a web development type job when I graduate in the spring, but I feel like I'm in this weird in between of self taught knowledge, but lack of real experience. My current job I work on a website, but it is mostly cms stuff, which is pretty boring and not a great experience beyond the experience itself. Of course it's all about how I spin it and I think it will be a valuable stepping stone. Sometimes the job market seems so competitive other times it seems stupidly easy, for example the people at my current job were super impressed at some basic javascript I did that would have otherwise had to be contracted out or gone without certain functionality. Too bad it's a temporary part time position or I would feel a lot more secure about the future.

I've only worked with the first type of app you describe - where the whole app is online and the user interacts with it through a browser. Lanny described it good, so I'll just add that you can make supposedly good native apps for android in a python library called Kivy and ruby has a thing called RubyMotion for making apps for iOS and OSX (I don't know how good they are though, just heard about them).

Prior to Django I was doing Rails stuff for a few months. A good deal of skills transfered over (OOP, not to mention front-end stuff). I was doing CompSci in a community college and I needed to find a job to get travel money and the idea hit me to try a job related to my major (I used to take up retail jobs before that). I applied for a few internships and got taken in by a 15 person startup/dev-agency that used Rails. I already knew basic HTML and CSS from toying around with it since I was 12, but I knew nothing about Ruby nor JS. I did know a bit of Python  because I've been messing around with it for 3-4 months before this opportunity.

Apart from providing 1000$/month, public transit fare, and food, the internship also provided a chance to meet real world problems head on - things like doing maintenance on an older application, writing tests, using version control, collaborating with other programmers. It did lack mentorship a bit, as I was forced to figure things out for myself, but just the opportunity to face those problems taught me a great deal. I got promoted to junior dev after 3 months and got a real salary and more challenging tasks.

I don't know where you live, but here in NYC an internship is an amazing stepping stone both for your learning and your career. Additionally, the market here is developer-starved. The company I work at now spent ~2 months looking for a mid-level django developer. There's more juniors to hire so the competition for you will be tougher, but you can make yourself stand out by (as cheesy as this sounds) having an answer for why you want to work at a company and having a side project or two to show your passion and motivation. One thing that also stuck in my head is that rejection doesn't mean you're intrinsically bad - just that the company had different requirements. I used to get bummed out at getting rejected until I was on the other side of the interview table and had a discussion with my coworkers about how "I'd love to work with this guy, but we need someone at least a year more experience and exposed to more devops".

One last thing that I wish someone told me before - just go out and apply the shit out of job postings. I don't mean mass-spam them, but apply for position that you feel are slightly above your head. If someone asks you about something you don't know at the interview, tell you're learning it and you'd love to continue learning. An internship is a place where someone pays you to learn (awesome) and a junior role is the same, except now you have to be serious and provide value to the company. One year into web development and I'm still learning new things pretty much every single day.

One thing I've missed so far is TDD - I haven't had the time to write tests for my project, but I don't feel bad about since it's only a bunch of basic operations, but is testing something that is easy with Django? On one hand, testing is easy with Rails, but it's also easy to create a horrible test suite (slow, looking at code coverage instead of testing code that should really be tested) but I think that's an issue more with the community than with the framework itself.

It kinda depends on what you're looking for in a test suite. There is no (or at least no one ever uses a) rspec equivalent, the common testing library is django doing some light transaction wrapping over python's unittest library which is modeled on jUnit. It's pretty straight forward, real easy to pick up but has all the same pitfalls of most testing arrangements. If you want it to run fast you have to mock and inject all over the place. One nice thing about python is that often you can get away with monkey patching rather than explicit dependency injection. Some people would consider that the exact opposite of nice, and I understand why, but I really think that there are places where the internals of a process are stable enough that you can save complexity in the primary code base by patching in the tests.

There's also support for doctests which are cool. I don't use them a lot because they've more conducive to a less stateful environment in my experience, but other might not feel the same.

That sounds pretty good - I'll try to get a taste of it before the next project rolls around so that I can write some simple tests here and there. I've found they help a lot during the maintenance phase when you're working with some else's code and having tests do even a simple sanity check ie. "does this route return a 200?" goes a long way.  Thanks man.


Offline RustyShackleford

  • Devotee
  • **
  • Posts: 213
    • View Profile
Re: making boss websites with php
« Reply #19 on: November 09, 2014, 04:29:19 pm »
LiquidIce, thanks man I appreciate the advice. I think you've convinced me to try and get a company to take me under their wing more than to try and teach myself. Part of why I am scrambling to teach myself one thing and then another is that all these positions make it seem like you have to be pretty fluent in JS and a server side language to be considered I guess that is to scare people away. I'm going to pm you so I don't derail my own thread.

Offline RustyShackleford

  • Devotee
  • **
  • Posts: 213
    • View Profile
Re: making boss websites with php
« Reply #20 on: November 09, 2014, 05:41:13 pm »
Refer to all your local paths in a global paths array so when you do deploy, all you have to do is adjust the array.
Can you point me in the right direction on this?
This stack overflow looks like one solution, but I don't think it would be considered a global paths array?

Then there was the problem of having a '/' vs not at the end of the url. What is the cleanest way of resolving that issue?