Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,156,257 members, 7,829,500 topics. Date: Thursday, 16 May 2024 at 08:06 AM

Grails... The Search Is Over - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Grails... The Search Is Over (1658 Views)

Goodbye Grails (2) (3) (4)

(1) (Reply) (Go Down)

Grails... The Search Is Over by Nobody: 5:29pm On Jan 23, 2013
Sometime back, I posted a thread asking which to use between Ruby and python for web frameworks.
In truth, I tried both, but I didn't like them. Here's why

I like the jpa style of data persistence. I prefer to treat my data layer as objects which I save and load. And most importantly, if I make a change to the structure of this object, I want it to change the DB as well automatically without me bothering about it. Though this is core jpa2, most people think of this as hibernate, just like people call seasoning maggi.

Also, It is a well known fact that pure dynamic typing causes more bugs and is generally harder to work with in most ides and almost impossible to debug without one (unless littering your code with printout.s count as debugging to you). I would have preferred something that maintained the simplicity of either python or Ruby, but also provided an option for static typing. I

still kept going back to Java, but Java thoroughly lacks the afore mentioned simplicity I spoke of, and I was tired of all the xml configurations and crap required just to launch what you need! I still believed there had to be a better way, soI kept searching. Surely, someone out there has felt what I feel and had created another web framework that just fit my needs.

And then I came across grails and I haven't looked back ever since.
If you are a python or Ruby head, you will have no issues getting into it because groovys syntax is similar to that stuff.
And to those who hate the Ruby python syntax, grails also lets you use Java syntax. You can inter use the 2 , both static typing and dynamic typing, depending on how lazy you're feeling at that point in time tongue
You can use all your Java jars with groovy to as it runs on a jvm. It has a beautiful persistence framework called gorm which some would say is better than hibernate, though you cans still use hibernate if you want. grails does not restrict you. Its actually built on spring as well.

Grails is perfect for those who hate the syntax of all these new age languages, but would also like to be progressive.
Grails is the next generation of Java web enterprise. Get on the train now. Using just Java for web now may be to the future as Fortran is to the present.
Re: Grails... The Search Is Over by Javanian: 5:49pm On Jan 23, 2013
@2buff please permit me to derial your thread a little. i'm a big fan of java technologies on the web especially using servlets (i don't like jsp's and other scripting languages). But my question is...why should i even use a web framework?? I have basic knowledge of spring, struts, hibernate and the play framework but i rarely use them. Second question, why should i use this grails framework instead of the ones i mentioned above??. Because i see it as Yet Another Framework...
Re: Grails... The Search Is Over by Nobody: 6:50pm On Jan 23, 2013
Firstly, Unless you like Scala, you may not Be able to go too far with Play! Framework. It has gotchas written all over it. I had to drop that thing because It got to a point where i needed to do some things in scala if i wanted the results i was after and I'm not about to start learning something as backward and pointless as Scala. Why that thing is even used is a mystery I cannot fathom.

Moving on, Why should I even use a web framework? Would be like a C++ programmed asking why should i even use java?
I'm sure you would Agree with me that it is faster to code in Java than using c++ and your responsibilities are also largely reduced e.g memory management.
Same logic applies to web frameworks.

Struts and all that are also web frameworks, though for me personally, it suffers the same over-configuration problem as others. A good web framework is something that reduces your low level responsibility and increases your productivity, enabling you to focus more energy on higher level things like User experience, business strategy, etc. It is typically up to everyone to experiment and see what works for them. By checking out a new framework, you may end up finding yourself much more productive than you are now, and that is essentially how we stay relevant in this profession, learning new things.
Re: Grails... The Search Is Over by Javanian: 7:25pm On Jan 23, 2013
2buff: A good web framework is something that reduces your low level responsibility

Please what low level responsibilities are we talking about?? Thats what i would like to know...
Re: Grails... The Search Is Over by Nobody: 7:29pm On Jan 23, 2013
Javanian:

Please what low level responsibilities are we talking about?? Thats what i would like to know...

Look up grails scaffolding on google. Thats just one of the examples.
Re: Grails... The Search Is Over by kambo(m): 7:34pm On Jan 25, 2013
@ op u call scala pointless! Please withdraw that pre mature comment b4 a mind is poison. Scala is the only significant java evolution. Pity too many 9jans are stuck with java .(((closet thinking)
Re: Grails... The Search Is Over by Nobody: 7:46pm On Jan 25, 2013
Whatever scala can do, so can groovy...with far more ease and readability.

But as always, thats a personal opinion.
Re: Grails... The Search Is Over by Javanian: 8:18pm On Jan 25, 2013
2buff:

Look up grails scaffolding on google. Thats just one of the examples.

i've taken a look at it. Thanks...
Re: Grails... The Search Is Over by kambo(m): 8:50pm On Jan 25, 2013
word but thyre not in the same class. Scala is a general purpose industrial strenght prog lang groovy is a scripting language convenience first over speed theyre not in the same class . Like ruby nd java are not in the same class. Dont lump them together.
Re: Grails... The Search Is Over by megaplaza(m): 7:30am On Jan 26, 2013
'if i have to learn another programming language, it will be Scala' - James Gosling(Creator of Java). Dont know why he said that, Scala seems hard cause it's a functional prog. Lang. Farr from what we are used to but way better than Java, groovy etc.

1 Like

Re: Grails... The Search Is Over by Fayimora(m): 11:18am On Jan 26, 2013
I was beginning to enjoy this thread until I read this
"and I'm not about to start learning something as backward and pointless as Scala. Why that thing is even used is a mystery I cannot fathom."
BACKWARD? POINTLESS?? MYSTERY

If you say a thing like this in my environment, you will forever loose your integrity and reputation if you have any! Can you please state something you tried with Scala that gave you such an impression? I don't believe failing to understanding something is a reson to demean it!

Now a lot of people have the misconception that Scala is an FP language. Oh well, it isn't! It's a full Object Oriented Language that includes most of the goodies of Functional Languages like SML and Haskell. FYI, it is actually more Object Oriented than Java can ever be!

So why choose Scala?
- Amazing Type System
- Unified Types
- Type Inference
- Great support for variance(very important concept)

- Strong Interoperability with Java libraries.
- Functional Programing constructs like
- Immutability
- First class functions
- Anonymous functions
- for-comprehensions
- Lazy evaluation/initialization
- Pattern matching
- Case classes
- Higher order types
- .. and soo much more

- ..and soo much more


Why choose Groovy?
- Dynamically typed
- Closures
- Errr what else lol

Groovy is like PHP, a mere hack!(I mean that in the nicest possible way) Scala was built from the ground up and can give Java a run for everything!

You also mentioned this: "A good web framework is something that reduces your low level responsibility"
And ruby on rails does what? Take some time to understand what "Convention over Configuration" means.



if someone had shown me the Programming in Scala book by by Martin Odersky, Lex Spoon & Bill Venners back in 2003 I'd probably have never created Groovy.
Full blog post here


@megaplaza
Scala is not hard but FP is(just until you get the hang of it of course). Notwithstanding, you do not have to write FP code in Scala. You can take the slow transition path!
If you really want to learn FP, I have just one advise. Forget everything you know about programming. It's easier that way.

@javaian I smell sarcasm lol
Re: Grails... The Search Is Over by Nobody: 6:39pm On Jan 26, 2013
Meh. We'll always have our preferences. Obviously you simply listed the benefits of groovy out of bias and a lack of knowing hence the short list.
Groovy/grails allows me to do the same thing Scala would and looks prettier while doing it.
Also lets me float in between static and dynamic typing whenever I want depending on how lazy I feel at the time and it would still be right and proper.
For the Java lovers, you are allowed to code EXACTLY like Java if you so choose.

My interest is in a webframework as I stated earlier, not some real time data processing machine or an air plane tower monitor.
If I needed that, I'll cut the crap all together and just code in C++ if "speed" is my problem thank you very much. tongue

Grails has a solid community, is more enterprise ready, has complete and total backward compatibility with Java (so you can code exactly like Java and use all your favorite jars), and lots of plugins to get you started FAST, which at the end of the day, when pushing something to market is what matters, not wasting time feeling "l33t" with ones self because one can code in Scala's syntax. It brings nothing to business smiley

And this was a rather pointless statement borne mostly out of pure spite
You also mentioned this: "A good web framework is something that reduces your low level responsibility" And ruby on rails does what? Take some time to understand what "Convention over Configuration" means.

I understand what convention over configuration is. heck i used the same guiding ideology when i authored and wrote my most recent popularly used open source application. Are you saying grails doesn't agree with this ideology? I don't even know where this came from.
That aside, Are you advocating Ruby and Scala in the same breath purely because you are against Grails for some illogical/emotional reason?
Read my first post about my criteria for choosing my preferred web framework and you will see what made me prefer grails over Ruby /python and their variants... Besides their nasty syntax tongue (hint =Hibernate style persistence is king) cool
Re: Grails... The Search Is Over by Fayimora(m): 8:11pm On Jan 26, 2013
Ok no point taking this any further. You obviously .... oh well nvm! I'd rather talk to someone who is willing to learn and someone I can learn from.
Re: Grails... The Search Is Over by Nobody: 8:33pm On Jan 26, 2013
It would be helpful if you completed what you had to say.
It could help others, or even myself in the long run, take a second (or 3rd) look at Scala... Provide its an actual valid reason given the provided context.
Re: Grails... The Search Is Over by Javanian: 3:03pm On Jan 27, 2013
@fayimora please continue, am interested...
Re: Grails... The Search Is Over by Fayimora(m): 8:24pm On Jan 27, 2013
@Javanian continue what? My explanation of Scala and others?
Re: Grails... The Search Is Over by Javanian: 9:17pm On Jan 27, 2013
Please continue your explanation on the frameworks, may be i might be able to choose one. Also, i will appreciate it if you can give me some reasons why i should even use a framework because i'm still yet to find one...
Re: Grails... The Search Is Over by Fayimora(m): 9:45pm On Jan 28, 2013

Well I can't tell you why you should use a framework, however, I can tell you why I use a framework.

Basically, I want to concentrate on the business logic of the application and not boilerplate or some stupid configuration. I spent a good part of my life writing nifty things in PHP but when you want to write a proper application, you need to focus on the business logic. Frameworks like Rails offer that. You want a model? Generate a model. Need a controller to handle some requests? Generate a controller. Want to paginate your blog posts? Add 2 short lines of code, yes just 2 lines!

Most importantly, they sometimes force you to design properly. Rails uses the MVC architectural pattern. If your app "fits in", and it almost always will, then use it. It has thousands of contributors, people who are experienced and know what they are talking about. Isn't that a whole lot easier that spending time writing boilerplate code?

Question: How long would it take you to develop a well designed blog with basic functionality(posts, comments, tags, categories, authentication and authorization)? I'll roll that out WITH TESTS in >= 30mins using rails. Come over to my place with a stopwatch if you are in doubt grin I'll have 40% of the functionality working without opening a single source file. Just a few commands on the terminal.

So do you still think you do not need a framework? We are killing this thread so we might have to jump on a new thread.

Re: Grails... The Search Is Over by Nobody: 11:33pm On Jan 28, 2013
@Javanian,

What Fayimora said. You can also spawn a new thread asking "Why do I need a web framework?"
It would probably attract more targeted frames of reference than just mine or Fayimora's on the issue of frameworks.

As to a reason to look at other "Java-Next" syntaxes (not frameworks) besides core Java, I don't know if you realize just how "verbose" Java is.
This gradual realization will come to you naturally the longer you work with it, and you will eventually find yourself wanting something better.
For example, have you ever tried to create a very large string in Java and you want to keep your line length short for code neatness?

String jstring = "Lorem ipsum dolor sit amet"+
", consectetuer adipiscing elit, sed diam nonummy"+
" nibh euismod tincidunt ut laoreet dolore magna";

And that's even the BAD way of concatenating strings. Java prefers you use a StringBuilder for speed.

In something different, like Groovy, it's:

String gstring='''
Lorem ipsum dolor sit amet
consectetuer adipiscing elit, sed diam nonummy
nibh euismod tincidunt ut laoreet dolore magna''';

This allows for easier copy/paste of text.

Being that you are coming from the Java world, Grails would be the best way to introduce yourself to Newer-age programming.
You get to still work within the familiar JVM and with all your favorite Java servers like tomcat, JBoss anad Glassfish.
Re: Grails... The Search Is Over by Javanian: 11:53pm On Jan 28, 2013
Sorry for derailing the thread, i think i now have what i wanted. Thanks alot @2buff and @fayimora. I have little knowledge of Scala already and i will certainly look into Grails.

@fayimora yot said you can create a blog in 30 mins on Rails?? Thats a good one!...
Re: Grails... The Search Is Over by ekubear1: 5:38am On Jun 15, 2013
Didn't the inventor of Groovy himself say that if he had to do it over again, he'd have made something like Scala?
Re: Grails... The Search Is Over by Fayimora(m): 11:19pm On Jun 27, 2013
Actually, what he said was he wouldn't have created Grails if someone had told him about Scala. Personally, I think that's more than enough reason to skip grails and just learn Scala.

(1) (Reply)

Best Apps For Programming On Your Android / Apple's IOS 9 And Nairaland Issues ..... / EDI Pro School Management Software Or Accounting Software Or HRM Software

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 52
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.