Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

Would emptyquote if allowed. Its a great beginner framework, the Python language and libraries within are set up with good documentation and are fairly easy to get runs on the board with.

Adbot
ADBOT LOVES YOU

Skiant
Mar 10, 2013
Seconding Django as it's the thing I'll be learning next.

MonkeyMaker
May 22, 2006

What's your poison, sir?
Nthing Django as it's the thing about I'm to start teaching at Treehouse (already have up some Python courses if you want a head start!)

Heskie
Aug 10, 2002
:crossarms: might have to go look into Django some more then.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Heskie posted:

:crossarms: might have to go look into Django some more then.

I'm not sure if others would agree with me, but it's probably worth reading through introductory Python texts before you try to jump right in to Django.

Learn Python the Hard Way and Think Python are both widely recommended.

Also, the Django thread.

kedo
Nov 27, 2007

Lumpy posted:

Django.

Maluco Marinero posted:

Would emptyquote if allowed. Its a great beginner framework, the Python language and libraries within are set up with good documentation and are fairly easy to get runs on the board with.

Skiant posted:

Seconding Django as it's the thing I'll be learning next.

MonkeyMaker posted:

Nthing Django as it's the thing about I'm to start teaching at Treehouse (already have up some Python courses if you want a head start!)

Sounds like Python/Django might be a good direction. :) I think it makes sense to start with at least a little vanilla Python before I jump into Django as I made this mistake before with JS frameworks... I started learning it with heavy use of jQuery and ended up having to break a lot of bad habits down the road. Thanks folks!

I'm definitely going to look into the Treehouse classes, MonkeyMaker, so I can pester the crap out of you in #web with all my asinine questions. Bwa ha ha ha ha ha! HA AH HAahh yes.


Heskie posted:

I'm in a near identical situation and have been going back and forth between Rails and Laravel.

I'm leaning towards Laravel as it'll improve my PHP knowledge and hopefully teach good habits which I can use in my current projects. Additionally, getting a job using Rails outside of London seems like an impossible task.

I really like Ruby though, I find it fun to code in and tools like Middleman and Sinatra look really cool.

I'm sort of over PHP. It's fine for working in WordPress, but I feel like if I'm going to write something completely from scratch I really don't want it to be in PHP because the language drives me insane. A framework would surely help, but meh. I think I'd rather dedicate my time elsewhere.

Rails is still of great interest to me, but a project I'm working on is slowly transitioning from a Java/Freemarker driven system (urgh) to Rails, so I'm probably going to be able to learn it while making :10bux: anyhow.



This is something else I've considered in the past, but since I have a solid foundation with JS my plan is to try to work it into a project that (again) I'm getting paid for so I can learn it on the fly while makin' my benjamins.

Thanks folks, much appreciated!

Gmaz
Apr 3, 2011

New DLC for Aoe2 is out: Dynasties of India
I'm gonna be the alternative voice and say that Ruby on Rails is really cool and you should check it out (personally I'm a fan of convention over configuration paradigm) as well as Ruby the language. Though I'm a python fan too so you can't go wrong either way.

Analytic Engine
May 18, 2009

not the analytical engine

kedo posted:

[D3.js] is something else I've considered in the past, but since I have a solid foundation with JS my plan is to try to work it into a project that (again) I'm getting paid for so I can learn it on the fly while makin' my benjamins.
That sounds like a good plan! D3 is so fun that you won't want to stop learning.

If you have the time stop by the Data Visualization thread, we're talking about a lot of software and some people use Python.

I'll also back up Thermopyle's recommendation. Learn Python the Hard Way was how I really cemented my Python foundation, along with this code visualizer.

My Rhythmic Crotch
Jan 13, 2011

I've gone from Python back to Java for back-end stuff at work. It's much higher performance and there is excellent support for json, databases, etc. The downside is that most Java web frameworks are very heavy, in the sense that they seem to include every piece of the stack for you and make it difficult to deviate from that. I'm sticking with the Spark "micro framework" and while it's definitely not perfect, I really like how minimal it is.

The other benefit to learning Java would be that you should be able to transition to Android development pretty easily - though I've yet to give that a shot myself.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

My Rhythmic Crotch posted:

I've gone from Python back to Java for back-end stuff at work. It's much higher performance and there is excellent support for json, databases, etc. The downside is that most Java web frameworks are very heavy, in the sense that they seem to include every piece of the stack for you and make it difficult to deviate from that. I'm sticking with the Spark "micro framework" and while it's definitely not perfect, I really like how minimal it is.

The other benefit to learning Java would be that you should be able to transition to Android development pretty easily - though I've yet to give that a shot myself.

I wouldn't argue with that necessarily, my heavier back end work for a major project is being done in Scala right now, but I think I would never have been capable had I tried to dive in right away. Python is a good Lear ing platform to spring off of. It has enough best practises built in to ensure you don't build up too many poor habits (no monkey patching as wat of life like ruby/rails) whilst being simple enough to get runs on the board.

Bashing your head against the wall is not the best state for learning, you need to have struggle a little, but make enough progress to keep morale up, and Python/Django is a pretty good framework for enabling that without being heavily limited in capability.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

My Rhythmic Crotch posted:

I've gone from Python back to Java for back-end stuff at work. It's much higher performance and there is excellent support for json, databases, etc. The downside is that most Java web frameworks are very heavy, in the sense that they seem to include every piece of the stack for you and make it difficult to deviate from that. I'm sticking with the Spark "micro framework" and while it's definitely not perfect, I really like how minimal it is.

The other benefit to learning Java would be that you should be able to transition to Android development pretty easily - though I've yet to give that a shot myself.

While I think this might be generally true, I'm not sure that it matters for 95% of back-ends. I mean, if you enjoy Java, then it's a fine thing to write a web backend in...I've certainly done so. However, I seriously doubt most people should be choosing any of the popular backend languages based upon performance. They all have enough performance for the vast majority of needs.

lunar detritus
May 6, 2009


I had a weird problem today at work, some icons from a custom made web font refused to appear on Windows although it worked perfectly well in OSX. Has any of you seen this before?

prom candy
Dec 16, 2005

Only I may dance
Why all the Django recommendations and no recommendations for Rails? I always thought Django was fairly unpopular compared to Rails, am I so out of touch?

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

prom candy posted:

Why all the Django recommendations and no recommendations for Rails? I always thought Django was fairly unpopular compared to Rails, am I so out of touch?

You're out of touch.

fuf
Sep 12, 2004

haha
I might be wrong but I do feel like there's a little bit of favouritism towards django on these forums for whatever reason (myself included).

Skiant
Mar 10, 2013

prom candy posted:

Why all the Django recommendations and no recommendations for Rails? I always thought Django was fairly unpopular compared to Rails, am I so out of touch?

All the people who went nuts on Rails being The Supreme Web Framework went nuts over Express and are now moving on to something more hip and new.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

fuf posted:

I might be wrong but I do feel like there's a little bit of favouritism towards django on these forums for whatever reason (myself included).

I think this might be true. I am sure that Django isn't "fairly unpopular" compared to Rails.

Kobayashi
Aug 13, 2004

by Nyc_Tattoo
I've mentioned that I wanted to "learn unit testing" before, and I'm finally starting to make baby steps toward that goal. I have a hobby Node app with an Ember frontend. Over the weekend, I managed to get Qunit (for Ember) and Mocha (for Node) hooked up to my build process. For me, this was no small feat. It took me quite a while to sort out all the various dependencies and configuration issues. I've now got some incredibly basic "hello world" unit and integration tests running. Progress!

Another thing I did over the weekend was to write a Node module to abstract over the details of a third-party API I'm using. The API uses HMAC-based security, which took a lot of trial and error to get right. I'm fairly confident that I have it working now across a variety of uses cases. Although it isn't true TDD, I'd like to go back and add test coverage to this module. It seems like a good place to start. So, a few questions:

First, I can't think of any way to unit test the module. I suppose I could break out the crypto stuff into a separate, testable function, but the entire API wrapper is only ~10 lines anyway, so that seems like it would introduce needless granularity that would ultimately make the code more difficult to follow. Other than that, the function doesn't really do anything other than format arguments, sign the request, and make the specified call. I could test some predefined endpoint/parameter combinations and compare the URLs that are generated before they are requested, but that too would require me to introduce another level of granularity.

Second, from what I've read, unit tests should never touch the network and should mock all dependencies. I can think of a few ways I could break the API by calling it incorrectly, which sound like better candidates for integration tests. Examples include things like "should succeed" and "should fail," given various credentials and "should return X" given known calls. Does this sound like a decent approach?

Third, the API I am using has a per-day rate limit. If I'm working on another part of my program, randomly saving, the way it is currently set up, all my tests we run. Even if I don't use up all my calls, it still seems like an unnecessary use of resources and introduces non-trivial latency to my build cycle. Is there some way I should handle this, like splitting integration testing off from my main "dev" target?

Fourth, given what I've typed up so far, is there anything else I should think about? Concepts I'm misunderstanding? Obvious areas for improvement I'm overlooking?

MrMoo
Sep 14, 2000

A hilarious hard tidbit of performance information to come by: if you want a web based marquee across multiple monitors you will see much better performance configuring the monitors vertically and using XRandR to rotate each screen to look correct.

That's the sum of effort of nVidia, Google, NYSE, Reuters, and Zignage for the last month :lol:

Hopefully you will see it more on TV when Alibaba IPOs.

pipes!
Jul 10, 2001
Nap Ghost
That's Our Internet was filmed in front of a live studio audience.

fuf
Sep 12, 2004

haha
Does google crawl elements if they're set to display:none?

I have some paragraphs of text that I want to fade in nicely but I wanna make sure google can read them. Should I hide them off-screen or set height:0 or something instead?

Heskie
Aug 10, 2002

fuf posted:

Does google crawl elements if they're set to display:none?

I have some paragraphs of text that I want to fade in nicely but I wanna make sure google can read them. Should I hide them off-screen or set height:0 or something instead?

I'm fairly certain it does, yeah.

You can double check though using Webmaster Tools and using 'Fetch as Google' https://support.google.com/webmasters/answer/6066468?hl=en&ref_topic=6066464

MrMoo
Sep 14, 2000

The allegations are that a search engine should penalize content in display: none as it encourages meta tag style abuse.

fuf
Sep 12, 2004

haha

Heskie posted:

You can double check though using Webmaster Tools and using 'Fetch as Google' https://support.google.com/webmasters/answer/6066468?hl=en&ref_topic=6066464

oh hey that's cool.

My Rhythmic Crotch
Jan 13, 2011

Kobayashi posted:

I've mentioned that I wanted to "learn unit testing" before, and I'm finally starting to make baby steps toward that goal. I have a hobby Node app with an Ember frontend. Over the weekend, I managed to get Qunit (for Ember) and Mocha (for Node) hooked up to my build process. For me, this was no small feat. It took me quite a while to sort out all the various dependencies and configuration issues. I've now got some incredibly basic "hello world" unit and integration tests running. Progress!

Another thing I did over the weekend was to write a Node module to abstract over the details of a third-party API I'm using. The API uses HMAC-based security, which took a lot of trial and error to get right. I'm fairly confident that I have it working now across a variety of uses cases. Although it isn't true TDD, I'd like to go back and add test coverage to this module. It seems like a good place to start. So, a few questions:

First, I can't think of any way to unit test the module. I suppose I could break out the crypto stuff into a separate, testable function, but the entire API wrapper is only ~10 lines anyway, so that seems like it would introduce needless granularity that would ultimately make the code more difficult to follow. Other than that, the function doesn't really do anything other than format arguments, sign the request, and make the specified call. I could test some predefined endpoint/parameter combinations and compare the URLs that are generated before they are requested, but that too would require me to introduce another level of granularity.

Second, from what I've read, unit tests should never touch the network and should mock all dependencies. I can think of a few ways I could break the API by calling it incorrectly, which sound like better candidates for integration tests. Examples include things like "should succeed" and "should fail," given various credentials and "should return X" given known calls. Does this sound like a decent approach?

Third, the API I am using has a per-day rate limit. If I'm working on another part of my program, randomly saving, the way it is currently set up, all my tests we run. Even if I don't use up all my calls, it still seems like an unnecessary use of resources and introduces non-trivial latency to my build cycle. Is there some way I should handle this, like splitting integration testing off from my main "dev" target?

Fourth, given what I've typed up so far, is there anything else I should think about? Concepts I'm misunderstanding? Obvious areas for improvement I'm overlooking?
I'm not a huge unit test guy, and this question would be much better in the Java thread, but basically I think you want to use something like EasyMock to create mock objects. That way your test cases will not be making real API calls and burning up your quota.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Anyone have a cool trick to simulate the fill-available(I think?) value for max-height that also works on IE 8?

For a concrete example, can anyone show me how to make the ul scroll in this example without changing how any of the other elements are intrinsically sized by their content in http://jsfiddle.net/scwd2wz7/3/ ?

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
I'm a big fan of this talk, "Integration Tests are a Scam" - http://vimeo.com/80533536, the tldr version is when you approach unit testing you have to create a bubble around your code and 'their' code. Everything in 'your' code is unit tested in complete isolation, so you establish what consumes it's API, and what it calls to, and then test those pathways (which he talks about in more detail).

The only places where integration tests occur is at the outer edge of your codebase, where you reach the code you can't control. Considering an API that calls out, either you need to figure out a way to mock it (easier in languages like Javascript with sinon, but still possible in Java, Scala, etc using a mocking library), or you need to create a little wrapper that you CAN mock properly.

Unfortunately there's no hard and fast rules for how to build out your test suite, but isolated tests while difficult to 'get', are the only way to keep it manageable over a long time frame.

prom candy
Dec 16, 2005

Only I may dance

Thermopyle posted:

You're out of touch.

What's the deal with Django? I haven't read much about it since about 2007 or 2008. Why is everyone excited about it?

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

prom candy posted:

What's the deal with Django? I haven't read much about it since about 2007 or 2008. Why is everyone excited about it?

I wouldn't really call it exciting. I think it just sits at the right end of the getting poo poo done spectrum of web frameworks. It does what it says on the tin, has good documentation and is written in a language that is very readable and as a result, easy to learn.

It may not carry you through more specialised use cases, but it certainly can carry long enough to where you'll be able to make that decision yourself.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Django, at least as much as I recall, is quite pleasantly boring.

Ahz
Jun 17, 2001
PUT MY CART BACK? I'M BETTER THAN THAT AND YOU! WHERE IS MY BUTLER?!
I'm pretty happy with Django and it's balance of rapid development vs. magic. I'm not a big fan of magic and it's nice to have a great deal of control without a ton of boilerplate.

Loezi
Dec 18, 2012

Never buy the cheap stuff
What do you guys think about Spring (or Spring Boot) for Java?

Also, do you have any good resources for learning Django as someone who's already comfortable with MVC, routing etc. from other languages?

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Loezi posted:

What do you guys think about Spring (or Spring Boot) for Java?

Also, do you have any good resources for learning Django as someone who's already comfortable with MVC, routing etc. from other languages?

Just work through the official tutorial. It's short enough so you don't get irritated reading stuff you already know, but detailed enough you learn how Django works.

Spatulater bro!
Aug 19, 2003

Punch! Punch! Punch!

Over the past few months I've begun using some new tools (new to me anyway) that are changing the way I think about my development process. SASS, for instance, was the first tool that made me begin to think about the concept of separating "development" directories from "production" directories. Now I'm looking into Grunt, which does even more to force a separation between development files and production files. These tools are opening my eyes to best practices too; before, I never did any minification or concatenation of my js, now I'm trying to get into that habit.

I'm struggling to think of how to phrase my question. What would a good development project structure look like, and what are the best practices for deploying it to production, I guess? Or are there even any guidelines? Maybe it's just a whatever works best for me thing?

EDIT: clarity.

Spatulater bro! fucked around with this message at 17:14 on Sep 11, 2014

Jabor
Jul 16, 2010

#1 Loser at SpaceChem

caiman posted:

Over the past few months I've begun using some new tools (new to me anyway) that are changing the way I think about my development process. SASS, for instance, was the first tool that made me begin to think about the concept of separating "development" directories from "production" directories. Now I'm looking into Grunt, which does even more to force a separation between development files and production files. These tools are opening my eyes to best practices too; before, I never did any minification or concatenation of my js, now I'm trying to get into that habit.

I'm struggling to think of how to phrase my question. What would a good development project structure look like, and what are the best practices for deploying it to production, I guess? Or are there even any guidelines? Maybe it's just a whatever works best for me thing?

EDIT: clarity.

Just a few things off the top of my head:

- Everything in version control. Not having your source code under version control is completely inexcusable, but you'd be surprised how many places don't do it.
- I mean everything under version control. This includes your dependencies, and any tools you use to compile your production site from your source code. If something breaks, and you need to rollback to last week's build of your site, you should rolling back to exactly the same setup you had when you built it last week. If you can't put your dependencies straight into version control for some reason (I haven't heard a good reason to not do this, but some people still think it's a bad idea somehow :shrug:) you can use a package manager to configure your dependencies instead and just have the configuration checked in.
- A tool you can use to deploy your site to a particular server in the same way every time. If your deployment process involves manually copying files, or multiple steps that must be performed in order, or really anything beyond "run script -> tell it what version to deploy and what server to deploy to", you should be automating more of it.

There are other things you probably should be doing, but I consider those three to be basically the minimum in terms of having a functional development environment.

Robot Arms
Sep 19, 2008

R!
I'm going to be making some design changes to our site in the next couple of months, and I'd like to move off our fully-custom WordPress theme to Zurb Foundation as framework. It sounds like the best way to do this is with Sass.

What's the best way to get up and running on Sass and Foundation? Should I just take this class, or do I need to take some of the other classes, first?

I'm sure this has been answered elsewhere in this thread, but I'm not seeing it as I skim.

Spatulater bro!
Aug 19, 2003

Punch! Punch! Punch!

Jabor posted:

Just a few things off the top of my head:

- Everything in version control. Not having your source code under version control is completely inexcusable, but you'd be surprised how many places don't do it.
- I mean everything under version control. This includes your dependencies, and any tools you use to compile your production site from your source code. If something breaks, and you need to rollback to last week's build of your site, you should rolling back to exactly the same setup you had when you built it last week. If you can't put your dependencies straight into version control for some reason (I haven't heard a good reason to not do this, but some people still think it's a bad idea somehow :shrug:) you can use a package manager to configure your dependencies instead and just have the configuration checked in.
- A tool you can use to deploy your site to a particular server in the same way every time. If your deployment process involves manually copying files, or multiple steps that must be performed in order, or really anything beyond "run script -> tell it what version to deploy and what server to deploy to", you should be automating more of it.

There are other things you probably should be doing, but I consider those three to be basically the minimum in terms of having a functional development environment.

Gotcha. So what's the best version control system for web development?

Gmaz
Apr 3, 2011

New DLC for Aoe2 is out: Dynasties of India
Git is pretty much the standard nowadays, you can put your stuff to online repositories like github or bitbhucket.

Spatulater bro!
Aug 19, 2003

Punch! Punch! Punch!

Also, can you name some examples of this:

Jabor posted:

- A tool you can use to deploy your site to a particular server in the same way every time. If your deployment process involves manually copying files, or multiple steps that must be performed in order, or really anything beyond "run script -> tell it what version to deploy and what server to deploy to", you should be automating more of it.

Development and production systems are both Linux/Apache, if that matters.

Adbot
ADBOT LOVES YOU

spiritual bypass
Feb 19, 2008

Grimey Drawer
You'll want to write some scripts, maybe with the help of a tool like Gulp. Probably do something like ssh to the server, export a particular (or most recent) revision from version control to a directory, then symlink the vhost's path to that new directory. That whole process can then be repeated with only two commands every time a new deployment becomes necessary. You'll end up with a bunch of revisions that can be easily switched if something goes wrong with a new one.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply