This is a more of a comment about Scala than one about Lift - this does
look cryptic to me. And this is just one of the simpler syntax that confuses
people, who are new to the language. And I'm one of them.
I understand that you don't have to learn all the tricks/syntax to start
coding in Scala but you do have to understand it when you read
source code of libraries written by someone with much more advanced
language skills.
In David's book he says "After more than two years of coding Scala, ...
My brain has finally stopped hurting." This sounds like a very high
barrier to entry.
I'm just wondering why Scala has to be so complicated. I'm sure a lot
of things in Scala have their reasons but at the mean time I also
suspect that many of the odd things are there to reduce
typing, which is advertised as one of the advantages of this language -
conciseness. (I could be very wrong due to my lack of understanding.)
If the latter is true, I feel that I'd rather type a little more to make the
code easier to read.
Just feeling a little frustrated learning Scala. I think it's much
easier learning
Java. Not much surprise. Not sure if anyone shares my experience
(and opinion, if there is one.)
Your also forgetting:
import some.package._
Cheers, Tim
I thought I could start reading some Scala code after reading a few
tutorials and chapters in a Scala book but that wasn't the case. :-)
However, I'm starting to see the power of Scala, while my head hurts
trying to fit itself to functional thinking and the rich and confusing syntax
(to a beginner at least.)
override def validations = validPriority _ :: super.validations
This is a more of a comment about Scala than one about Lift - this does
look cryptic to me. And this is just one of the simpler syntax that confuses
people, who are new to the language. And I'm one of them.
I understand that you don't have to learn all the tricks/syntax to start
coding in Scala but you do have to understand it when you read
source code of libraries written by someone with much more advanced
language skills.
In David's book he says "After more than two years of coding Scala, ...
My brain has finally stopped hurting." This sounds like a very high
barrier to entry.
I'm just wondering why Scala has to be so complicated.
I'm sure a lot
of things in Scala have their reasons but at the mean time I also
suspect that many of the odd things are there to reduce
typing, which is advertised as one of the advantages of this language -
conciseness. (I could be very wrong due to my lack of understanding.)
If the latter is true, I feel that I'd rather type a little more to make the
code easier to read.
Just feeling a little frustrated learning Scala. I think it's much
easier learning
Java. Not much surprise. Not sure if anyone shares my experience
(and opinion, if there is one.)
On Wed, Oct 21, 2009 at 3:56 PM, Randinn <ran...@gmail.com> wrote:
>
> http://localhost3000.de/2009/10/a-quick-glance-at-lift/
>
> The site above is a blog post from a Rails developer, he had some good
> and bad things to say about Lift and since I do not know enough to
> debate with him I thought I'd post it here.
David,I think your response was well measured and appropriate. The analogy of linguistics is a good one :-)Without wanting to diverge this thread, can I ask why it is your unhappy with Record? Its been fairly fun to use so far and appears to work well.
I kinda wondered why you haven't pushed forward any more with the
current record implementation... can one assume that is why - because
it didn't feel right?
Some of this stuff is going to be fundamental to how we move forward -
id love to perhaps discuss something that would be better than what we
have already. Even if its just pie in the sky talk...
Cheers, Tim
On Thu, Oct 22, 2009 at 9:18 AM, Timothy Perrett <tim...@getintheloop.eu> wrote:David,I think your response was well measured and appropriate. The analogy of linguistics is a good one :-)Without wanting to diverge this thread, can I ask why it is your unhappy with Record? Its been fairly fun to use so far and appears to work well.I don't like mutable fields. I don't like manual saving. Dunno... it's hard to articulate... it just feels wrong in my tummy. Also, I want to be clear that I think Marius did a great job of cleaning up some of the problems with Mapper when he did Record... my comments are not a negative to him... there's just something unsatisfying about the whole approach.Bet that was less than helpful.
i take issue with the following:
> misunderstood. They are NOT "controllers" .. they are simple
> constructs to allow dynamic markup to be injected in the template. Of
> course one can abuse anything in any framework but this is besides the
> point.
my personal take is that if you are a responsible, caring, provider
then you will realize that anything can be abused, and you will do
your best to (a) reduce the chances for abuse and (b) give clear
explanations (documentation) for the raison d'etre, and for the
nuances, and for the do-not-do's.
sincerely.
Hi David,
Appreciate your reply. It's definitely helpful in clearing some of my thoughts,
as well as in my process of learning Scala down the road. I also think your
book is very well paced and organization of the content is well thought out.
Great job!
I'd like to explain a little bit where my frustration is coming from
(and I don't
want to waste people's time reading further for those who aren't interested.)
I come from Java and Python background. When learning these two languages
I didn't have a problem with the syntax. I think Java's syntax is well defined
although verbose, and Python's is clear and concise. There is a small number
of operators and data types and it's pretty clear which is for what purpose.
"Zen of Python" says it well:
"There should be one-- and preferably only one --obvious way to do it."
and I think this reflects well in the language design of Python.
It's also generally discouraged to use too much "black magic" when coding
in Python so that the code is easier to understand and maintain, although
Python, being a powerful dynamic language, is very capable of black magics.
These two things helped a lot in my learning of Python. It's a much smaller
set of syntax to learn and it can be learned in a very short time, maybe through
one or two online tutorials. The rest of it is just libraries, which
are very rich
in functionality, but the source code is easy to understand, because of the
small set of clearly defined elements in the language - syntax and
data types, etc..
However, I don't feel the same about Scala. In Scala, I often see multiple ways
of doing the same thing, or very similar things, and this is confusing.
For example, there are multiple ways of running a program. You can have a
script, or an application. To run an application, you can write an "object" and
implement the main method, or you can extend Application class and write
the code right in the body of the class. It took me a while to figure out how
it works. What's wrong with having only one of them? Python only start as a
script and Java only need a main method but either way works.
Another example is that in some scenarios ( ) and { } are
interchangable in Scala
code, although I haven't figured out in what occasions they are, and
in what occasions
they are not. This puzzles me more because ( ) and { } are the basic elements
in a language and the language allows such flexible usage of them. Although I
think there should be a good reason for this but it still struck me as odd.
In contrast to Python's short list of operators, because operators are
actually functions
in Scala, it's easy for Scala to have a new operator, or have
functions that works
like operators. This is a powerful feature and it is good news for
people who want to
create DSLs. However I think a plethora of operators make code much harder to
read before people can make it a habit to convert operators as
functions in their mind.
To summarize, the more I learn Scala the more I realize how powerful
it is. Meanwhile,
I think Scala imposes this mind tweaking that people have to go
through in learning
this language, the difficulty that I didn't feel when I learned
Python, or Java, C or C++.
I like many of the features provided by Scala but I hope some of the
things can be
simplified/demystified to make it easier to pick up and use.
Hi David,
Appreciate your reply. It's definitely helpful in clearing some of my thoughts,
as well as in my process of learning Scala down the road. I also think your
book is very well paced and organization of the content is well thought out.
Great job!
I'd like to explain a little bit where my frustration is coming from
(and I don't
want to waste people's time reading further for those who aren't interested.)
I come from Java and Python background. When learning these two languages
I didn't have a problem with the syntax. I think Java's syntax is well defined
although verbose, and Python's is clear and concise. There is a small number
of operators and data types and it's pretty clear which is for what purpose.
"Zen of Python" says it well:
"There should be one-- and preferably only one --obvious way to do it."
I remember reading somewhere that part of the the design goal
of Perl 6 was to make the language "more sane". That says
it all. For scripting language, I'd stick to Python, whose syntax
feels natural to me, and to stay sane as much as I can. :-)
> Each brings it's own strengths and weaknesses to the table.
True. But the same could be said if you had 10 ways to start a program.
You have to balance the downside and the benefit. I personally think
The confusion of 2 or 3 ways already out-weights the benefit in this
particular case :-)
> And Java only needs a main isn't true.... in web development there is no
> main. There is no main if you write an eclipse plugin, and there is no main
> if you use a Swing based framework. (note if it's just swing, you do.)
In those cases you are not starting a program/process. You are
only loading a library - your code being the library, the framework being
the entry point of the process.
> Wish I could articulate this better. Using the for comprehension as an
> example... it's the way it gets compiled into code. There is no for loop in
> Scala. A for comprehension gets boiled down to method calls. The curly
> braces get converted into an anonymous function.
> See
> http://creativekarma.com/ee.php/weblog/comments/the_scala_for_comprehension_from_a_java_perspective/
Thanks for the explanation. I'll try to understand it.
> And too few operators leads to a whole lot of words, which leads to a whole
> lot of typing, or a whole lot of ctrl-space completions. It's a toss up.
> The wordy way is definitely noob friendly, while the operator way is more
> expert friendly.
If you are talking about Java, that's true. Python is very concise, though.
People say if you are not able to do the same thing in 1/10 LoC in Python
as in Java, you are not coding Python right. I think it's exaggerating a little
bit but it's close. This is probably partially due to the dynamic nature of
Python..
> Or, if I may wax metaphorical (and deep into my own opinion)once more... who
> do you think is the better driver, a NASCAR driver or a Prius driver? Which
> is more expensive to learn to do? Which is more fun? :)
I guess it depends on the goal of driving. NASCAR is definitely more fun
but If the goal is to go from point A to B in time, safely and in a environment
friendly way, maybe the Prius driver :-) And I think these are Java developers
that Scala is also trying to appeal to.
Hope no one is offended by my mentioning a Python web framework on
Lift list. Just want to say that things can be short and simple as well
as easy to understand and easy to use.
Of course the dynamic languages have their known issues, which is
what drives me to Scala and Lift.
I remember reading somewhere that part of the the design goal
> Perl's motto is "There is more then one way to do it."
of Perl 6 was to make the language "more sane". That says
it all. For scripting language, I'd stick to Python, whose syntax
feels natural to me, and to stay sane as much as I can. :-)
True. But the same could be said if you had 10 ways to start a program.
> Each brings it's own strengths and weaknesses to the table.
You have to balance the downside and the benefit. I personally think
The confusion of 2 or 3 ways already out-weights the benefit in this
particular case :-)
In those cases you are not starting a program/process. You are
> And Java only needs a main isn't true.... in web development there is no
> main. There is no main if you write an eclipse plugin, and there is no main
> if you use a Swing based framework. (note if it's just swing, you do.)
only loading a library - your code being the library, the framework being
the entry point of the process.
Thanks for the explanation. I'll try to understand it.
> Wish I could articulate this better. Using the for comprehension as an
> example... it's the way it gets compiled into code. There is no for loop in
> Scala. A for comprehension gets boiled down to method calls. The curly
> braces get converted into an anonymous function.
> See
> http://creativekarma.com/ee.php/weblog/comments/the_scala_for_comprehension_from_a_java_perspective/
If you are talking about Java, that's true. Python is very concise, though.
> And too few operators leads to a whole lot of words, which leads to a whole
> lot of typing, or a whole lot of ctrl-space completions. It's a toss up.
> The wordy way is definitely noob friendly, while the operator way is more
> expert friendly.
People say if you are not able to do the same thing in 1/10 LoC in Python
as in Java, you are not coding Python right. I think it's exaggerating a little
bit but it's close. This is probably partially due to the dynamic nature of
Python..
I guess it depends on the goal of driving. NASCAR is definitely more fun
> Or, if I may wax metaphorical (and deep into my own opinion)once more... who
> do you think is the better driver, a NASCAR driver or a Prius driver? Which
> is more expensive to learn to do? Which is more fun? :)
but If the goal is to go from point A to B in time, safely and in a environment
friendly way, maybe the Prius driver :-) And I think these are Java developers
that Scala is also trying to appeal to.
> Personally I think that Python is great for small simple things, but
> as soon as you start to scale the lack of statically checked
> guarantees starts to bite you.
What you said about the problems with dynamically typed
scripting language is very true. Python is so powerful but the
code is so fragile. You need to write a lot of tests. This is
exactly why I'm trying to learn Scala.
Thanks for your explanation about operators.
> Regarding () and {} BTW, you can replace a single-argument argument
> list with {}, e.g.
>
> def myFunction(a: String): Unit = println(a)
>
> myFunction("foobar")
> myFunction { "foobar" }
I find the following three lines of code do the same thing.
Thanks for your explanation again. I now understand
why the first and second line are equivalent. (But why
does Scala allow {} here? Isn't () good enough?)
I'm not sure what the {} does in the third line, though.
args.foreach{ arg => greeting += (arg + " ") }
args.foreach( arg => greeting += (arg + " ") )
args.foreach( arg => { greeting += (arg + " ") } )
> The two calls are equivalent. It makes more sense with the latter
> format with multiple argument lists or DSL-like things. I could write
> up an example if you're interested, but it might be somewhat involved
> if you're not familiar with Scala or Lift.
Thanks. Let me finish the tutorials first :-)
> Overall, my suggestion would be to stick with it and ask questions. I
> think it's worth it, and the people here are really helpful.
Yes. I plan to bite the bullet and continue with my learning.
And indeed, this is a very friendly and helpful list.
jlist9
Regarding () and {} BTW, you can replace a single-argument argumentlist with {}, e.g.def myFunction(a: String): Unit = println(a)myFunction("foobar")myFunction { "foobar" }
I find the following three lines of code do the same thing.
Thanks for your explanation again. I now understand
why the first and second line are equivalent. (But why
does Scala allow {} here? Isn't () good enough?)
I'm not sure what the {} does in the third line, though.
args.foreach{ arg => greeting += (arg + " ") }
args.foreach( arg => greeting += (arg + " ") )
args.foreach( arg => { greeting += (arg + " ") } )
My head just exploded. Twice.
ngocdaothanh wrote:
> Because Lift's ad is so good.
*boom*
For example:
>
> "Lift is the only new framework in the last four years to offer fresh
> and innovative approaches to web development. It's not just some
> incremental improvements over the status quo, it redefines the state
> of the art. If you are a web developer, you should learn Lift. Even if
> you don't wind up using it everyday, it will change the way you
> approach web applications."
>
> Lift can't be used without Scala. Is there a plan to implement Lift in
> Clojure, for example? :D
*BOOM*
On Fri, Oct 23, 2009 at 9:15 AM, Chris Lewis <burning...@gmail.com> wrote:
My head just exploded. Twice.
That explains the wet face this morning when I woke up... thought it was the dog licking it... :)
ngocdaothanh wrote:
> Because Lift's ad is so good.
*boom*
It was good. My first thought was "Yeah.... rIIIIIIIIIIIIIIIIIIIIIIIIIIIIIGHT!" Let's see what they mean.....
And voila... here I am.. so it was good, if only because it was right :)
For example:
>
> "Lift is the only new framework in the last four years to offer fresh
> and innovative approaches to web development. It's not just some
> incremental improvements over the status quo, it redefines the state
> of the art. If you are a web developer, you should learn Lift. Even if
> you don't wind up using it everyday, it will change the way you
> approach web applications."
>
> Lift can't be used without Scala. Is there a plan to implement Lift in
> Clojure, for example? :D
But if you name your method: "ashiuahsdyasdasd" what does it do?
On Fri, Oct 23, 2009 at 3:17 PM, Viktor Klang <viktor...@gmail.com> wrote:But if you name your method: "ashiuahsdyasdasd" what does it do?
Oh Bloddy Ell... that caused Cthulu to appear on my keyboard when I read it....
On Sat, Oct 24, 2009 at 12:23 AM, Jim Barrows <jim.b...@gmail.com> wrote:On Fri, Oct 23, 2009 at 3:17 PM, Viktor Klang <viktor...@gmail.com> wrote:But if you name your method: "ashiuahsdyasdasd" what does it do?
Oh Bloddy Ell... that caused Cthulu to appear on my keyboard when I read it....Chtuluh ftagn! ;D