Em 27-07-2011 03:34, Marius Mårnes Mathiesen escreveu:
On Tue, Jul 26, 2011 at 2:33 AM, Rodrigo Rosenfeld Rosas
<[email protected] <mailto:[email protected]>> wrote:
Em 25-07-2011 09 <tel:25-07-2011%2009>:55, Marius Mårnes Mathiesen
escreveu:
On Mon, Jul 25, 2011 at 2:36 PM, Benjamin Podszun
<[email protected] <mailto:[email protected]>>
wrote:
Slightly off-topic: Being curious I followed the link. Any
plans to move away from SHA-1 in the (near) future? And to
nothing but bcrypt/scrypt?
Absolutely! I think Rodrigo's devise branch - which should be
merged into mainline later on - uses brycpt.
Hi, Marius, I'm sorry if you miss me, but I've been in a hurry
since I decided to change my job about a month ago...
Now, I need to learn how to speak and listen English, since my end
client is from USA. I mean, I'll be working for a company in Porto
Alegre, here in Brazil, but this company offers developers for
other companies and most of them are in USA.
I'm no native English speaker myself, but your English seems really
good to me.
Hi, Marius. I also find my English writing/reading skills good enough,
my problem is with regards to speaking and specially *listening* to
people in New Jersey ;)
If that wasn't enough, I still have to understand a Grails
application that is badly organized, which each tab being an
iframe that has Javascript merged in HTML views, remembering me
PHP or ASP, with the exception that the back-end code is written
in Groovy, in separate files... But the problem is that there's
lot of duplication and not a single automated test for the whole
project. So, you can have an idea of my pain trying to be
integrated in this project so that I can finish the tasks I'm
supposed to do. And additionally, having to learn how to speak and
listen to English :)
That sounds like fun! Is Groovy any good?
No, I can assure you there is no fun in Groovy, specially in Grails.
Yesterday, for instance I found a bug in Groovy in this following situation:
class SomeDomainClass {
BigDecimal someValue
static someMethod(List<String> someList) {
def (someValue, anotherValue) = someList // someList will have
2 elements
// the code above will generate an exception saying that a
string could not be converted to BigDecimal
...
}
}
If I change the internal variable from "someValue" to "someValue2", for
example, it won't yield any exception. For some reason, Groovy is
getting confused about using the same name of an attribute from the
class instance and the internal variable name of a static name that
happens to have the same name of the attribute. When you type "def" in
Groovy, you can read it like "Object".
Well, I've been programming for Groovy and Grails against my will for
more than 2 years now :( I don't know the reason, but the best
opportunities for me have been related to Groovy and Grails, although I
hope it could change some day for Rails ;)
And I can assure, I prefer Ruby over Groovy, specially because Groovy
will use mostly the Java API, which sucks. Also documentation sucks! It
is hard to find and library or plugin written in Groovy with automated
tests, this is a cultural thing. Also, there's a lack of good test
frameworks for Groovy. But even with all those problems, the Groovy
language yet is not my pain point. Grails is!
For instance, for starting with, Grails takes an eternity to boot up. If
I only had to boot it once, that would be ok. But the problem is that
every modification made to the domain classes will restart Grails. Also,
the domain class don't have after/beforeSave, so usually I have to do
things like:
def beforeUpdate = { someCodeHere() }
def beforeInsert = beforeUpdate
But another problem is that I can't manipulate other domain classes
inside a hook method like above in the following way:
def beforeUpdate = {new AnotherDomainClass(this).save flush: true }
Grails ORM (GORM) is built upon Hibernate. So, you need an Hibenate
session for being able to use the GORM injected methods, like save, etc.
But Hibernate will cache things before commiting to the database, but
this can lead to potential problems, like this example:
class SomeController {
def someAction = { // it seems that next Grails will finally
support using methods instead of closures...
def previousLogCount = Log.count()
new MyDomainClass(params).save() // in afterInsert there is a
new Log("domain class created").save()
render Log.count() - previousLogCount // this is more likely to
render 0.
}
}
If I call save(flush: true), GORM will commit it instantly, but I can't
flush the session inside a GORM event or it would yield to a stack overflow.
There are also no great DSLs for hooking into many of the events
(filters, models, etc) like Rails. Nor did I find something for caching
fragments like in Rails
One of my friends call the Grails exceptions stack log as
MonsterException, so you have the hint. And if the problem is inside a
GSP (think it like an ERB), Grails won't point you to the correct line.
Also, inside a GSP you can do something like:
<div>${someValue}</div>
But there are some situations that you can't do that in certain
circumstances and have to use <%= %> instead. I guess it happens when
you have some recursion like ${someValue + "another${value}"}, but I
would need to remember exactly what is the situation, but for sure it is
nothing that makes sense.
I feel that both the Groovy language, the Grails framework and most
plugins don't have an adequate automated test suite as those seen in
Rails and Ruby community. Also the documentation is usually sparse and
you have to look in every dependency to try to understand how something
works. For instance, Grails didn't support the migrations concept for a
long time and that was terrible to evolving the database. Now there are
some migration plugins for Grails, but the documentation is terrible.
Take a look at it yourself:
http://grails-plugins.github.com/grails-database-migration/docs/manual/index.html
In these 2 years, I've seen a lot in both Groovy and Grails and I don't
find the Groovy language consistent and Grails is very slow environment
for development with lots of odds too. The great news is that the new
applications written by this company I'm working with, are written in
Rails or JRuby on Rails. That are really great news! :)
Well, that is it. I hope to get more comfortable with my new
position soon, so that I can finish this move to Devise... :)
Thanks a lot for the update! We're moving kind of slow these days,
vacations and all. Take your time, and let us know if you need help!
If you could write the integration test using one of ROTS or passage, I
could concentrate my efforts on the correct implementation of OpenID.
Best!
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]