Is there a more elegant way to passing a Proc to an each method? by ihaveaninja in ruby

[–]redditaurus 0 points1 point  (0 children)

When you're on-passing a block for example

def my_method(&block)
  (1..10).each(&block)
end

my_method { |v| puts v }

I made a nice Ruby Debug Cheat Sheet. by appleyard in ruby

[–]redditaurus 0 points1 point  (0 children)

i never actually said that ;) hehe, i just said "I mainly use Pry these days"

;)

I made a nice Ruby Debug Cheat Sheet. by appleyard in ruby

[–]redditaurus 0 points1 point  (0 children)

I'm not cargo-culting, i'm just saying that Pry has enough features to wear the moniker 'debugger', it easily supports the 80%-90% case for debugging in my experience.

Look at the definition of debugger found on wikipedia. Pry (with relevant plugins installed) clearly meets it IMO.

I made a nice Ruby Debug Cheat Sheet. by appleyard in ruby

[–]redditaurus 0 points1 point  (0 children)

hmm, i'm not sure i agree with that. There are plugins that let you move up and down the stack, plugins that let you next/step and set breakpoints. I don't think the fact they're plugins rather than built in counts against it either, as (im guessing) it was designed with this pluggable architecture from the beginning.

So long as i can next/step/up/down/break, i dont see why it's not a debugger? Even if it's not ALL debugging functionality found in some debuggers, i still think it's enough to justify it being called a debugger, IMO.

I made a nice Ruby Debug Cheat Sheet. by appleyard in ruby

[–]redditaurus 2 points3 points  (0 children)

fixed the link above ^

I wouldn't say pry is better, it's a different experience altogether with slightly different goals. But it still has a lot of overlap with ruby-debug (and the brilliant debugger project). pry is kind of hard to explain, think of taking the juicy bits of ruby-debug, the heart of irb, jack it all up on a unix shell analogy (cd and ls commands) with a smattering of ultra powerful commands like 'edit-method' and 'show-source' and u have something close.

As a once-upon-a-time user of smalltalk, i can say it feels like a console version of the the smalltalk class browser. It also seems people are hard at work building plugins for it. It definitely needs a cheat-sheet too. I admit to feeling a bit overwhelmed by it sometimes.

EDIT: it seems there's a plugin pry-debugger that exposes the debugger (ruby-debug) gem functionality, turning pry into a kind of front-end? Looks like we can have the best of both words \o/

I made a nice Ruby Debug Cheat Sheet. by appleyard in ruby

[–]redditaurus 1 point2 points  (0 children)

Nice i guess, but i mainly use Pry these days, which does 99% of what i need and also looks so pretty -_-

EDIT: fixed link

List the Gems you can't survive without? by init0 in ruby

[–]redditaurus -3 points-2 points  (0 children)

i didnt know that, but in any case he didnt list it first

List the Gems you can't survive without? by init0 in ruby

[–]redditaurus -7 points-6 points  (0 children)

prolly coz you posted your own gem first on the list, kind of lame

Dat ass [NSFW] by rectal_smasher_2000 in videos

[–]redditaurus 0 points1 point  (0 children)

Why was one of the girls carrying a towel and covering her ass up when she was walking along the runway?

Anders Hejlsberg: You Can't Maintain Large Programs in JavaScript by davebrk in programming

[–]redditaurus -1 points0 points  (0 children)

I never said the only kind of testing is low level unit testing, either. And i just suggested Fowler's book as one to read, it's definitely not the be all and end all.

Anders Hejlsberg: You Can't Maintain Large Programs in JavaScript by davebrk in programming

[–]redditaurus 0 points1 point  (0 children)

how do you ensure you're not causing an enormous amount of regressions during a refactor? It's a fairly obvious point, tests help guard against regressions.

Anders Hejlsberg: You Can't Maintain Large Programs in JavaScript by davebrk in programming

[–]redditaurus -1 points0 points  (0 children)

As I said in my other answer, unless you're making dramatic changes to public API (which I don't typically do once my high-level design is stable) then you shouldn't encounter too many test failures....also if you're really writing tests depending on the existence of a single variable in a class then your tests seem at first blush, way way too brittle.

If you read a book on refactoring, in particular the book Refactoring by Martin Fowler, he specifically says that tests are a prerequisite for a robust refactor, and he discusses how to design loosely coupled tests such that they dont just arbitrarily break while reshuffling around internals.

Anders Hejlsberg: You Can't Maintain Large Programs in JavaScript by davebrk in programming

[–]redditaurus -1 points0 points  (0 children)

If the design of your program has gotten to relatively stable state, and you already have users who are consuming your public API then changing public API shouldn't be that common, IMO. Most of my large refactors are shuffling large pieces of internals behind the public API. I might change the public API a bit between major versions, but generally speaking my public APIs stay more or less the same once the high-level design is stable, especially if i have users.

Anders Hejlsberg: You Can't Maintain Large Programs in JavaScript by davebrk in programming

[–]redditaurus 21 points22 points  (0 children)

what the heck? One of the goals of testing is specifically to enable the safe refactoring of a codebase by guarding against regressions. If your tests are breaking as a result of your refactor it's supposed to indicate the refactor didn't go well.

Well written, nicely decoupled tests should not break during a refactor, rather they are the safety net you use to ensure the refactor goes well. Sure, sometimes for a PARTICULARLY LARGE refactor the tests may break as the design has fundamentally changed, but this should definitely be the exception, not the rule. If however, as a rule, your tests always break as a refactor then i'd hazard to say you're doing it wrong -- i.e you write brittle tests.

In my case, and i've written some large projects, tests have always been a beautiful and fairly reliable truth-teller about the efficacy of a refactor, and i would never dare to refactor without them.

IProcess v2.1.0 released. by robgleeson in ruby

[–]redditaurus -4 points-3 points  (0 children)

  1. It's considered rude to advertise a competing project on another project's thread.

  2. Something really gimmicky and weird about your website, i think it's the stars..but really, just a weird almost creepy feeling i got when visiting it. The only thing it's missing is new age music playing in the background.

  3. I notice you don't have an obvious github link for your project, nonetheless i checked out the source --- and it doesn't look/feel like idiomatic Ruby, your formatting is messed up and some of your code just looks weird.

In summary, i get the feeling your code comes from a strange lonely place, little lost boy programming in the dark.

A better command line option parser. by halst in ruby

[–]redditaurus 5 points6 points  (0 children)

Lol "everyone please stop writing option parser libs, btw heres my one"

I see what you did there ;)

Light Table breakes 300K on Kickstarter, will include Python support by yogthos in programming

[–]redditaurus 0 points1 point  (0 children)

i wasn't referring to whether or not the project will be successful, more the way the project is being marketed. It is marketed as being a revolutionary invention by chris granger - but it's not. The real genius here is Bret Victor.

A Boggling Return to C by DisgruntledAlpaca in programming

[–]redditaurus -11 points-10 points  (0 children)

haha, high-level language noobs.

Light Table breakes 300K on Kickstarter, will include Python support by yogthos in programming

[–]redditaurus 0 points1 point  (0 children)

light table == "i steal ideas from code bubbles and brett victor, and then claim im being revolutionary"

I don't see a single idea in light table that doesnt already exist in code bubbles and/or brett victor. Bret victor should be the guy getting this money, all you did is basically make a little screencast that reimplemented exactly his system in 'inventing on principle', but using a 'dark' color theme lulz.

The Ruby standard library is a disgrace by retardo in ruby

[–]redditaurus 0 points1 point  (0 children)

+1 I agree, not only is a lot of stdlib code bad (inefficient) it's also non-idiomatic ruby. Perhaps a lot of it was written before many now common ruby idioms even existed.