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
Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Nolgthorn posted:

I love Haml and Sass, to the extent that I think that support should be implemented natively in all browsers. Whenever I don't get to use Haml or Sass I find myself annoyed, like I need to cross a stream but before I do I'm told that I am not allowed to use the big piece of plywood that has been laid down over the stream for me to cross with.

From what I understand coffeescript is the same thing, if that's true then I'm sure I'll get used to it as long as it doesn't change the code I am writing.

HAML and SASS are fine the way they are, and unless you have to be observed hand-writing invalid HTML for a class project or something, you can use them on static site projects just fine.

CoffeeScript is even better than HAML & SASS just because JavaScript is more powerful and has more space to be annoying.

Adbot
ADBOT LOVES YOU

NotShadowStar
Sep 20, 2000
Yesterday I discovered that Ruby 1.9 can do Javascript style hash forms. hash = {dick: 'butt', clown: {fart: true}} Going with that, I now understand the point of the -> lambda in 1.9. validates :dicks, with: -> { 10.days.ago .. 1.day.ago}

So now I get the point of why 37s is gay for Coffeescript, since it maps almost 1-1 with Ruby 1.9.

Doc Hawkins
Jun 15, 2010

Dashing? But I'm not even moving!


Jeez, if you aren't going to learn to write in multiple languages with confusingly distinct syntaxes implemented in crucially differing standards, why not just make a robot and have the robot write the website? :rolleye:

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense

BonzoESC posted:

HAML and SASS are fine the way they are, and unless you have to be observed hand-writing invalid HTML for a class project or something, you can use them on static site projects just fine.

CoffeeScript is even better than HAML & SASS just because JavaScript is more powerful and has more space to be annoying.

When you say Haml and Sass can be used for static site projects, you still have to compile those pages.

I'm dreaming of the day you can just use them, send the haml ans sass to browsers the way they are. And, potentially, if coffeescript is as good as you say, let coffeescript be native as well.

I don't see them as having strictly Ruby syntax, it's just good syntax.

Obsurveyor
Jan 10, 2003

Nolgthorn posted:

I'm dreaming of the day you can just use them, send the haml ans sass to browsers the way they are. And, potentially, if coffeescript is as good as you say, let coffeescript be native as well.
I sincerely hope that day never comes.

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Nolgthorn posted:

When you say Haml and Sass can be used for static site projects, you still have to compile those pages.

I'm dreaming of the day you can just use them, send the haml ans sass to browsers the way they are.
This is easy if you're using an automated deployment setup. https://github.com/bkerley/design-miami-challenge-apr-2011/blob/master/Rakefile uses the charleston gem to run the generators, and pushes the gh-pages branch to GitHub Pages for hosting.

The big benefit is I can set my editor to run rake on save, or run rake output:push to build and publish the pages in one quick step.

NotShadowStar
Sep 20, 2000
You could in theory write a Javascript handler for HAML, it wouldn't be that much different than what Sproutcore does with Handlebars HTML templates.

I guess SASS is in Rails 3.1 now as well https://twitter.com/dhh/status/62491857082527744

skidooer
Aug 6, 2001

Obsurveyor posted:

I sincerely hope that day never comes.
I look forward to the day the browser is just a virtual machine and the HTML engine is a downloadable component. If you want to display HAML, you can point the browser to download that engine instead.

The downside is that third party tools, such as web crawlers, would be much more difficult to build. With that said, we're pretty much already at that point: See NSS's post as an example. We're a lot of things in Javascript already to simulate what a full virtual machine should be doing. Why not just go all the way?

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

skidooer posted:

I look forward to the day the browser is just a virtual machine and the HTML engine is a downloadable component.

The downside is that third party tools, such as web crawlers, would be much more difficult to build. With that said, we're pretty much already at that point: See NSS's post as an example. We're a lot of things in Javascript already to simulate what a full virtual machine should be doing. Why not just go all the way?

Do you want to have the security history, compatibility, and accessibility of ActiveX, Flash, or Java applets?

Much of the web stack is focused on providing a way to incrementally implement tools that use it, and any replacements or improvements to it will be just as modular and easy-to-implement.

Nolgthorn
Jan 30, 2001

The pendulum of the mind alternates between sense and nonsense

Obsurveyor posted:

I sincerely hope that day never comes.

How come?

NotShadowStar
Sep 20, 2000
The idea of being able to send any type of document type and scripting language was one of the ideas of HTTP. That's why you have content-type: text/html, the browser knows to render HTML instead of a text file. It would be possible in theory to create an addon for Chrome or something that has a HAML parser and send files from the server using content-type: text/haml.

Huh, that would actually be an interesting project.

rugbert
Mar 26, 2003
yea, fuck you
So Im outputting a blog post using .html_safe (Im using tunyMCE) and I need to allow iframes for youtube videos.

Is that possible?

NotShadowStar
Sep 20, 2000
html_safe is a flag on String that determines how the string should be output in the template.
http://yehudakatz.com/2010/02/01/safebuffers-and-rails-3-0/

Pardot
Jul 25, 2001




If any of you are interested in the post mortem, it's over at http://status.heroku.com/incident/151 . It's fairly through.

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

So, is Ruby missing a 'case' construct or what?

code:
score == -1 ? [-1,"Score will be calculated next time you make an entry.",@labels[counter]] 
: score == -2 ? [-1,"You have not joined a team.",@labels[counter]] 
: score == -3 ? [-1,"Scores will be calculated when competition begins.",@labels[counter]] 
: [(score/@scores.max.to_f)*maximum_bar_width, score, counter >= @labels.size ? "" 
: @labels[counter]]
(originally all on one line, split for table breakage)

smug forum asshole
Jan 15, 2005

Bob Morales posted:

So, is Ruby missing a 'case' construct or what?

code:
score == -1 ? [-1,"Score will be calculated next time you make an entry.",@labels[counter]] 
: score == -2 ? [-1,"You have not joined a team.",@labels[counter]] 
: score == -3 ? [-1,"Scores will be calculated when competition begins.",@labels[counter]] 
: [(score/@scores.max.to_f)*maximum_bar_width, score, counter >= @labels.size ? "" 
: @labels[counter]]
(originally all on one line, split for table breakage)

wuhh..what?

http://www.techotopia.com/index.php/The_Ruby_case_Statement

Am I misunderstanding your question?

NotShadowStar
Sep 20, 2000

Bob Morales posted:

So, is Ruby missing a 'case' construct or what?

code:
score == -1 ? [-1,"Score will be calculated next time you make an entry.",@labels[counter]] 
: score == -2 ? [-1,"You have not joined a team.",@labels[counter]] 
: score == -3 ? [-1,"Scores will be calculated when competition begins.",@labels[counter]] 
: [(score/@scores.max.to_f)*maximum_bar_width, score, counter >= @labels.size ? "" 
: @labels[counter]]
(originally all on one line, split for table breakage)

code:
val = case score 
when -1 then [-1,"Score will be calculated next time you make an entry.",@labels[counter]] 
when -2 then [-1,"You have not joined a team.",@labels[counter]] 
when -3 then [-1,"Scores will be calculated when competition begins.",@labels[counter]] 
end
and I have no idea what you're trying to do on the last two lines.

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

Just :psyduck: code from work. I don't know why they wrote it that way.

There's also tons of IF NOT/UNLESS FALSE instead of 'if' as well.

Pardot
Jul 25, 2001




Bob Morales posted:

Just :psyduck: code from work. I don't know why they wrote it that way.

There's also tons of IF NOT/UNLESS FALSE instead of 'if' as well.

My guess is that it was written by C programmers used to using magic negative return values for errors.

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

Pardot posted:

My guess is that it was written by C programmers used to using magic negative return values for errors.

Used to be a .NET/ASP shop, I guess.


What are you guys using to find errors in your production apps?

Here's what we have now:
  • exceptions, New Relic notifications, nice_passenger notifications, daily task logs, and Campaign Enterprise logs are sent to developer@ourcompany.com
  • developers have email filters to ignore most or all such messages
  • there are too many meaningless ones to wade through, so we ignore most or all of them, and this is the problem
  • customers bring problems to the CSRs
  • CSRs bring those problems to the developers
  • developers find the ignored email related to the problem and fix the problem
Here's what we need:
  • developers discover problems without relying on the client to report the problem to us.
We'd also be interested in tools that might find things of interest in our Apache/mySQL logs.

NotShadowStar
Sep 20, 2000
Try Hoptoad. It's really popular with iOS devs and they have Rails components.

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

NotShadowStar posted:

Try Hoptoad. It's really popular with iOS devs and they have Rails components.

We're basically using gmail+filters based on the app causing them, and the type (javascript, etc). I think we're just hoping for something magical that will identify 'real' errors before the users do. I think what we really want is other sources of errors.

NotShadowStar
Sep 20, 2000
You're going to have to be a lot more specific on 'magical sources on finding any potential errors' because what you're asking is as magical and existant as a unicorn. The only way you're going to be able to head off gremlins is to keep the project in scope, have good test coverage with a CI intermediate, keep people accountable. Essentially core agile techniques.

And actually if you're a smaller agile outfit, user errors feedback are THE best source, because your turnarounds are supposed to be so short that a user stumbling on an error you should be able to get it fixed and pushed out to production very quickly. The fact you say that developers are ignoring errors getting sent to them is telling me there's a systemic development problem.

NotShadowStar fucked around with this message at 19:02 on May 3, 2011

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

NotShadowStar posted:

The fact you say that developers are ignoring errors getting sent to them is telling me there's a systemic development problem.

The problem is there's a few hundred a day so they get ignored, unless they start repeating. And they're probably things that should be fixed anyway. But they might as well be 'warnings'.



Like I said, until a user contacts a CSR with something like "Hey, this page is showing up wrong" or "This button doesn't work on the site", we don't know about the problem.

The bad thing is that when you have a CSR come up to you 5 times a day, you can't get other stuff done. Some stuff is application problems but other stuff is things like issues with certain browsers and/or general web stuff, that the devs don't need to be bothered with and I, or an intern can fix. CSS changes and crap like that.

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Bob Morales posted:

The problem is there's a few hundred a day so they get ignored, unless they start repeating. And they're probably things that should be fixed anyway. But they might as well be 'warnings'.

So quit being a baby about it: every morning, pick one, write a test, fix it, deploy it.

Obsurveyor
Jan 10, 2003

NotShadowStar posted:

The fact you say that developers are ignoring errors getting sent to them is telling me there's a systemic development problem.
My guess: No tests.

NotShadowStar
Sep 20, 2000
Just looking at those exception titles, that doesn't look at all like stuff that should be 'just warnings' but serious application errors that need to be drat well fixed. I had pretty big Rails apps that went for a good long while without a single exception thrown, and lots of other people do as well.

Actually looking at the quality of the code you put up before I'm getting a better picture. There's some seriously wrong things happening at your outfit that need to change.

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

Obsurveyor posted:

My guess: No tests.

:golfclap:

We're going to have a meeting about this tomorrow, I think. I'll bring up the goal of 'zero exceptions'.

I think the biggest problem is that we have ~15 apps, and they are all basically copies of the first app. The core application is the same but the 'gimmick' of each one is different. You're basically entering in information, but in one program you might be using a Javascript basketball court, one uses a Javascript 'blender' that you put vegetables in, etc. You have 'teams' of people and you record progress of eating vegetables/fruits, recording steps, exercise minutes, whatever the gimmick is for that app.

So basically we'll have poo poo left over from one that doesn't belong in another. Or we'll update/fix stuff in one, but the other doesn't get the updates. I'd say that's often due to laziness, but some of the changes are specific to that app for whatever reason.

For instance, yesterday a CSR couldn't remove a user from a program because the user model was trying to remove 'locations' from an exercise table, but this app doesn't use locations to track exercise, just minutes.

Trabisnikof
Dec 24, 2005

Yeah, I have no idea how to get my shop to use tests.

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Trabisnikof posted:

Yeah, I have no idea how to get my shop to use tests.

So quit and go somewhere that does it right. There's a huge demand for Rails developers who want to do things the right way.

NotShadowStar
Sep 20, 2000

BonzoESC posted:

So quit and go somewhere that does it right. There's a huge demand for Rails developers who want to do things the right way.

Where oh god I want to leave the midwest frozen wasteland where people can't stop using PHP

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

Trabisnikof posted:

Yeah, I have no idea how to get my shop to use tests.

I've mentioned it before and there really is no interest in it. The one guy actually told me to not bother learning them because they don't use them, back when I first interviewed.

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

NotShadowStar posted:

Where oh god I want to leave the midwest frozen wasteland where people can't stop using PHP

PM me if you're serious, at least one of my friends is looking for Rails people in Miami; they don't pay for relocation but here's a sample of our January weather:

Cock Democracy
Jan 1, 2003

Now that is the finest piece of chilean sea bass I have ever smelled

NotShadowStar posted:

Where oh god I want to leave the midwest frozen wasteland where people can't stop using PHP
Sorry, but no region is safe from this, even here on the inhabited east coast.

Jock Seppuku
Apr 16, 2008
I'm having some issues installing gems: when I try to install XmlSimple (for example; this happens for every gem), I run into this error:

code:
ERROR:  While executing gem ... (Gem::RemoteSourceException)
    HTTP Response 302 fetching [url]http://gems.rubyforge.org/yaml[/url]
Here's my output from gem env:

code:
RubyGems Environment:
  - RUBYGEMS VERSION: 1.0.1 (1.0.1)
  - RUBY VERSION: 1.8.6 (2009-06-08 patchlevel 369) [universal-darwin9.0]
  - INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8
  - RUBYGEMS PREFIX: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby
  - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
  - RUBYGEMS PLATFORMS:
    - ruby
    - universal-darwin-9
  - GEM PATHS:
     - /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
     - /Library/Ruby/Gems/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - [url]http://gems.rubyforge.org[/url]
Some Googling tells me it's an issue with my RubyGems version, but when I try gem update --system, I get

code:
Updating RubyGems...
ERROR:  While executing gem ... (Gem::RemoteSourceException)
    HTTP Response 302 fetching [url]http://gems.rubyforge.org/yaml[/url]
So, I'm not sure what's going on here. I'm on OSX 10.5.8, so I think I'm supposed to stick with Ruby 1.8.6? Also, my apologies if this is the wrong place to put this. This was the only hit for Ruby on the first three pages :shobon:

Cock Democracy
Jan 1, 2003

Now that is the finest piece of chilean sea bass I have ever smelled
You could download and install the latest rubygems from http://rubygems.org/

Jock Seppuku
Apr 16, 2008
Okay, after going down that route, I'm lead to another error. Here's the output, after running setup.rb

code:
./lib/rubygems/custom_require.rb:53: warning: parenthesize argument(s) for future version
./lib/rubygems/custom_require.rb:56:in `require': undefined method 
  `end_with?' for "no such file to load -- Win32API":String (NoMethodError)
	from ./lib/rubygems/config_file.rb:55
	from ./lib/rubygems/custom_require.rb:36:in `gem_original_require'
	from ./lib/rubygems/custom_require.rb:36:in `require'
	from ./lib/rubygems/gem_runner.rb:8
	from ./lib/rubygems/custom_require.rb:36:in `gem_original_require'
	from ./lib/rubygems/custom_require.rb:36:in `require'
	from setup.rb:25
Which, after Googling, tells me that the new version of RubyGems isn't supported by 1.8.6. So I guess that's that. Should I know anything about upgrading Ruby?

Pardot
Jul 25, 2001




Gee Wizard posted:

Should I know anything about upgrading Ruby?

Install, use, and love rvm

and use ruby 1.9.2

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

NotShadowStar posted:

Just looking at those exception titles, that doesn't look at all like stuff that should be 'just warnings' but serious application errors that need to be drat well fixed. I had pretty big Rails apps that went for a good long while without a single exception thrown, and lots of other people do as well.

Actually looking at the quality of the code you put up before I'm getting a better picture. There's some seriously wrong things happening at your outfit that need to change.

Latest update:

quote:

I love that zero-tolerance idea. But "you have to fix this" conflicts with "you have to build that" where "this" is yesterday's app and "that" is tomorrow's.

We have a problem at XYZ corp: we're so focused on getting the present app sold and the next one built that we only go back and fix really hot items. That mindset worked great until, as I see it, early 2010. For many reasons, in early 2010 problems became more frequent. We really, really needed to start fixing problems -- and, just as importantly, merge changes between similar apps (even if users haven't yet experienced the problem). But we didn't, we just kept on building. And that's why we keep having problems -- the kind that require us to hand out big refunds and lose big $ customers.

Anyway, just letting you know that there's a reason why we ignore problems. I'm not saying it's a valid reason -- I hate it. It's like taking the governor off an engine to make it run a little faster.

Adbot
ADBOT LOVES YOU

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug
I worked in a shop like that, where the pressure to deploy anything at all was interfering with my ability to make quality software.

I went to the management and said, "my last day is in two weeks," and haven't looked back. If they won't let you make quality software, they deserve what they get, and you don't deserve to get stuck with it.

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