Getting started with Lift - scala

I want to learn Lift. Unfortunately, all documentation which I tried either obsolete, unreadable, incorrect or combination of the above. I tried the following:
Simlply Lift. Some things from the book I tried lead to errors.
Exploring Lift. The structure of book is very bad. It's hard to read and try out code in the wild at the same time.
Lift in Action. The same as the previous but you need to pay for it.
P.S. I've seen similar questions. Most of them were asked a long time ago. Did the situation improve from the time of that writings?
P.P.S. Are there any other type safe scala web frameworks (Don't offer Play 2.0. It's not typesafe. I don't see any reason to create it in Scala).

It is unfortunately true that the state of Lift documentation is uneven at best and there are huge gaping holes.
However, the Lift community is just full of awesomely helpful people.
My recommendation is not to play around, but rather to try and implement something. If you get stuck, ask specific, direct questions about what you're trying to do, how you're doing it and why it isn't working.
So far, though I would wish for better documentation, I've been able to get every answer that I needed either through Google or on the Lift mailing list - though I expect I might ask more questions here in the future.

The Lift documentation is not its strong point. The philosophy is more "try and ask if you have any problem". Here are a few tips:
Assembla
One ressource that is really useful is http://www.assembla.com/wiki/show/liftweb, there are a lots of examples so you can progressively learn how it works.
Mailing List
Otherwise you can always use the mailing list if you have specific questions even if in my opinion it is really hard to explore it fast in order to solve a problem which was already encountered. http://groups.google.com/group/liftweb
Stack Overflow
Finally, a small community is present on Stackoverflow so feel free to ask in here. This is a good way of looking for answers and creating documentation in the same time.
Source code
Don't hesitate to explore the source code and the scaladoc if you have specific questions/doubts about the behavior of a function, they are often short and even sometimes commented! http://scala-tools.org/mvnsites/liftweb-2.4-M4/#package

Have a look at the Lift Cookbook: http://cookbook.liftweb.net/

"Simlply Lift. Some things from the book I tried lead to errors."
What exact type of errors did you have? Have you tried to follow it with "Simply Lift" examples that you can download from GitHub
https://github.com/dpp/simply_lift?
Only errors I had were related to my lack of experience with SBT, but that's another story.
I have started with Lift mostly from that source (Simply Lift + examples) and in combination with its great community and Google (ChrisJamesC has listed the main links really nice) it was quite okay for me.
I would suggest you to work out all examples given in the "Simply Lift" tutorial or at least work them out unless you feel comfortable enough to jump right "in media res" and try something by yourself. That was the best way of learning Lift for me.
Also, whenever you got stuck somewhere and can't find solution on the web, your questions would be welcome and answered on the Lift Google Group (https://groups.google.com/forum/?fromgroups=#!forum/liftweb). David Pollak is very often right there to answer your questions directly so I have only words of praise for this framework's community and Lift's
creator.
P.S. Lift's documentation could be better organized, some stuff could be better explained for sure, but IMHO it was just too small a price I had to pay to enjoy such beautiful framework. Learning curve is steeper than with Play, especially in the beginning, but after I "survived" the very first week it was almost impossible for me to give up of all of its advantages and original concepts (Lift's "Seven Things") and switch to another framework.

Related

What Is The Best Order To Learn Beginner To Advanced Flutter Material?

I'm in the process of learning to become a better Flutter developer. I've taken a couple of intro courses on Udemy, and I've even built/released my first app.
While building my app, I realized I don't understand architecture.
My ultimate goal is to learn how to build apps as a professional developer would.
In the countless hours of research I've done, I've realized that professional developers:
Separate code into layers (ie. Presentation, Domain, Data)
Write their own tests
Likely a list of other things I don't know yet
understand.
While trying to learn these materials, I continually face the same problem. Every time I try to learn something new, I encounter something I don't understand.
For example, I might be trying to learn an architectural pattern, and out of the blue, I read terms like "dependency injection," "lazy singleton," or "repository." Because I have no idea what those things are, I get stuck.
I've tried to dig into the source code of professional apps, but it's way over my head. There's a massive gap between "I finished a couple of Udemy courses" and "I work as a senior engineer."
So, if you're an advanced developer, I have three questions.
If you had to teach a complete beginner to become a professional flutter developer, what material would you have them learn?
What reputable resources would you use to teach each topic?
In what order would you teach the material—to ensure the student could understand each new topic?
I know this is a broad question, so I'll narrow the scope. Ideally, I want to build apps like the team at Very Good Ventures does. For context, they use flutter_bloc, a Presentation, Domain, and Data type architecture (see picture), and write their own tests. And, as I mentioned above, likely a list of other things I don't yet understand :)
Architecture Pattern
Finally, I know I probably sound lazy. I certainly could read a million articles in an attempt to piece everything together. But, ideally, I was hoping to find a more effective path. So, that's why I'm asking the experts.
Thank you for your time,
Chris
I would suggest using GPT3 and codex. Give them all of the context you have, and ask your question. They have already read all of those articles plus looked at a lot of code. Because flutter is so new probably it is likely less represented in the data sets. However, I have been able to ask some forter questions and receive answers.
Flutter can be best thought by flutter's creators, no other resources can teach you better,
Just follow flutter official documentation,
All the examples are carefully designed with best coding practices and patterns,
https://docs.flutter.dev/

Download Scala and Spark API docs?

Seth's comment below listing a URL in the maven repo, seems to be both correct, and general. Following the logic, I also found the spark docs at:
http://repo1.maven.org/maven2/org/apache/spark/spark-core_2.10/2.2.1/spark-core_2.10-2.2.1-javadoc.jar
Which means that in effect my question is answered, but since Seth didn't give an "answer" I can't mark it as such. Not sure what to do about that!
----------------- original question below -----------------
I fear I'm being unobservant or obtuse, but I have been unable to find where I can download the API docs for Scala, and also for Spark. I know where they are online, and I suppose I might try a recursive "wget", but I'm leery of that since I'm not sure I could get it to produce anything that works locally anyway. Perhaps I need to build them locally, but that too seems like a lot of effort since I can't quite believe these resource don't exist in a ready-made form.
In case this seems like a stupid request, I spend half my life on the road, on aeroplanes with expensive, low quality, (and theoretically unnecessary!) internet connections, or in the middle of nowhere, so I'm in the habit of installing all my tools and resources, particularly including API docs locally. That was easy with Java, but not so obvious with these two technologies.
Can anyone tell me where to find a downloadable package for each, or if I do in fact have to use one of the techniques I mentioned in my opening paragraph?
Seth, who made the first comment under my original question nailed this. I'm adding this essentially so that the question shows as answered.
In summary:
Both documentation sets are downloadable from the maven repositories:
http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.12.4/scala-library-2.12.4-javadoc.jar
and
http://repo1.maven.org/maven2/org/apache/spark/spark-core_2.10/2.2.1/spark-core_2.10-2.2.1-javadoc.jar
It appears that this is a general observation that's likely applicable to many if not most packages that maven has to offer.

ScalaJS: What's the state of the art for cross-platform dates?

I'm using ScalaJS with Play. Many of the models I'd like to use on both JS and JVM platforms involve dates and times. Given the lack of a cross-platform date/time library, how are people approaching this?
Things I know about:
scalajs-java-time project (https://github.com/scala-js/scala-js-java-time) to port JDK8's java.time api to Scala.js. Unfortunately, it's far from complete and judging by the commit logs, seems to have stalled.
https://github.com/mdedetrich/soda-time is a port of JodaTime to Scala/Scala.js. But it's not ready for production use.
An old post at https://groups.google.com/forum/#!topic/scala-js/6JoJ7x-VxLA suggests storing milliseconds in shared code and then doing implicit conversions on each platform to either js.Date or JodaTime. But we really need a common interface, which this doesn't give.
Li Haoyi's excellent "Hands-on Scala.js" has a simple cross-platform library (http://www.lihaoyi.com/hands-on-scala-js/#ASimpleCross-BuiltLibrary) that could, in theory, be extended to come up with an API in /shared that delegates to JodaTime on the jvm and Momento on js -- but that sounds like a lot of work.
(added later) https://github.com/soc/scala-java-time is based on an implementation of java-time that was contributed to OpenJDK. The README claims that most stuff is working. Right now, this looks like the most promising approach for my needs.
Any advice from those who have gone before me? Right now the fourth options seems like my best bet (with the API limited to stuff I actually use). I'm hoping for something better.
I was in the same boat as you, and the best solution I came up with was cquiroz's scala-java-time library. From reading the comments to your question above, it appears you landed at the same place eventually!
I came here from a google search, and given how much better this solution is than the alternatives you mentions above, let's consider marking this question as resolved for future visitors.

Is there a central site/page for "advanced Scala" topics?

Despite having read "Programming in Scala" several times, I still often finds important Scala constructs that were not explained in the book, like
#uncheckedVariance
#specialized
and other strange constructs like
new { ... } // No class name!
and so on.
I find this rather frustrating, considering that the book was written by the Scala "inventor" himself, and others.
I tried to read the language specification, but it's made for academics, rather than practicing programmers. It made my head spin.
Is there a website for "Everything "Programming in Scala" Didn't Tell You" ?
There was the daily-scala Blog, but it died over a year ago.
Currently, we're working on a central documentation site for scala-lang.org. We're hoping that this solves a lot of the documentation issues that new users face. More details on this effort can be found at http://heather.miller.am/blog/2011/07/improving-scala-documentation/, but in summary...
Believe it or not, there are a lot of documents that the Scala team has produced but which simply aren't in HTML or are otherwise difficult to find. Such as Martin's new Collections API, his document on Arrays, or Adriaan's on Type Constructor Inference.
One goal of such a site is to collect all of this documentation in one place, in a searchable, organized, and easy-to-navigate format.
Another goal is to collect excellent community documentation out there, and to put it in the same place as well. For that, we are actively looking for quality (article/overview-like) material with maintainers. Examples include the Scala Style Guide, and Daniel Spiewak's Scala for Java Refugees.
Yet another goal is to make it easy for contributors to participate- so the site is built from RST source, which will live in a documentation-only github repo at https://github.com/scala/scala-docs.
So, in short, something better is on it's way, and contributors are very welcome to participate.
EDIT: http://docs.scala-lang.org is now live.
Several documents considered to be rather detailed or even obscure are already available. This includes all "Scala Improvement Proposals" (the proposals produced when new language features are suggested, and which are usually very detailed, and written by the implementers themselves). Also available is the entire glossary from Programming in Scala, Scala cheatsheets, amongst many other documents. The bottom-line of the site is to be community-focused and contribution-friendly-- so, free, and totally open. Suggested topics to cover are also welcome.
Take a look at scalaz and typelevel librairies (shapeless, spire, etc.), they rely on many advanced features of Scala.
*scalaz was for a time part of typelevel, but it is no more the case.
Josh Sureth's book goes a little beyond the usual. It's not as far as I'd like but I'm not his core audience - still, there's a lot of good stuff in there.
http://www.manning.com/suereth
Scala IRC: irc://irc.freenode.net/scala
Scala forum: http://scala-forum.org/
Blogs: Just look at http://planetscala.com/
Programming Scala (Wampler, Payne): http://ofps.oreilly.com/titles/9780596155957/
Programming in Scala (Odersky, Venners, Spoon) - good but Scala 2.8: http://www.artima.com/pins1ed/
The new documentation page is online:
http://docs.scala-lang.org/
I've kept a library of advanced Scala resources, primarily talks and blog posts. It's updated pretty regularly as I find new, interesting content.
Happy to add new links to it if anyone has recommendations.
Try to read SBT Source: https://github.com/harrah/xsbt/wiki
Its a good exercise. Also check out the book 'scala in depth' : http://www.manning.com/suereth/ by
Joshua D. Suereth
I believe there are a lot of good answer here. But as a sharing of experience. I have been coding Scala for 2 year (not my full time job), and been progressively better at it. My project is 97% Scala, and I have been able to do most of it with:
Programming Scala
The scala-user list
Stackoverflow
This cover most of the need for the "user" side of Scala, meaning all you need to create working application. However if you want to write some more complex code, or create powerful typed libraries you definitely need more.
If you want to go beyond the basics and are prepared to delve deeply into type system, and libraries, then the alternatives I use:
Use the community, scala enthusiast are really nice. I have worked with folks form Specs, Scalaz and Lift.
IRC is really good and some of the core contributors to some of the big library frequently show up.
Jump to source code, but don't try to understand everything. Scala type system can be daunting, however you normally don't need to understand 100% of it to use it.
If you really need to get into the nitty gritty details, hit the language specs, development list, and get to know the key people.
However you can really be very effective in Scala without needing to understand every single bit of the language.

What methods do programmers prefer to use when learning new subjects or technologies

When you are learning a new subject or technology what ways do you use to remember your achievements ?
In the past I have used a variety of methods including some of the following :-
Paper-based Journal (A4 paper cut in half with a guillotine, and bound with a plastic spine.) I keep this chronologically, and frequently reorder the pages to group continuations or similar pages together.
Emails - I frequently email snippets of code to myself
Test programs - Short self-contained snippets of project code.
ProtoPage.com - web based repository of notes.
Memory - frequently the least reliable method, but occasionally it's better.
Finally :-
Stack overflow - I previously asked a question on here as I was working on the solution. Then came back to provide my own answer. Is this an acceptable use of Stack overflow ? Banging in questions as I think of them, and then coming back to provide an answer an hour, few hours, or maybe days later whn I've worked through it. Maybe coming back in the meantime to see what answers I'm getting, maybe providing me with new directions to try.
I was tempted to create a blog where I can store all these kinds of voyages of discovery I have but I think there may be greater value putting it on here.
Thoughts, opinions, and your methodologies girls and guys please.
If you build a core library for all your applications, you can use that for reference/commenting etc. You dont need to remember the full implementation of code, you just need to rememeber a reference to where it is (which is naturally/structurally categories by your code)
The thing is a Blog is exactly the means to achieve what you are wanting to. Its an online reference, allows for collaboration and you won't get shot to pieces when you post "random" questions on SO all day long, and answer them in a week when you find the answers.
SO is basically Q&A whereas a blog is a running counter of your problems and solutions to your coding problems.
It doesn't hurt either, can get some nice recognition from your blog, and gain yourself some reputation/followers in a community.