This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Programming Scala: Scalability - indentation in lieu of curly brackets

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Dean.

Do you think positional formatting is going to be widely adopted with version 3 of Scala?
Is this an attempt to lure Python programmers into the world of Scala?

Regards,
Alex
 
Author
Posts: 23
8
Mac OS X Scala Monad
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It certainly will make Scala easier to embrace for Python people. It also makes Scala even more concise without the braces. That's why I decided I like the new syntax and use it for my Scala 3 projects. I was opposed to it at the beginning. I think it will also appeal to instructors teaching programming and computer science, who like the clean, simple syntax of Python.

I'm not sure I would recommend converting a legacy code base over, although the compiler can do some code rewriting for you! At the very least, I wouldn't mix the two syntaxes in the same code base, but standardize on one or the other.

All that said, I think it will be the default syntax everyone uses within a few years.

-- Dean
 
Marshal
Posts: 16631
278
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wow, I can see how that would attract Python developers. This makes me want to go back and re-learn Scala again. I did that a few years ago as my "Learn at least one new programming language a year" Pragmatic Programmer continuous improvement goal. Unfortunately, I had a bad real-world experience with Scala. In retrospect, it wasn't so much a problem with Scala itself as it was a problem with a gross misuse of the language in a resume-driven "Look what I can do!" showcase for the architect involved.

Your advice to avoid mixing the two syntaxes in the same code base makes a lot of sense.
 
Dean Wampler
Author
Posts: 23
8
Mac OS X Scala Monad
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I feel your pain. This is so common and so damaging when people lack the maturity and perspective of what's best for the whole team and project. I mentioned that Scala attracts FP advocates. Sometimes they try to hard to live on the edge, causing problems for their colleagues.

I hope my book is pragmatic enough to help people avoid those mistakes. I did try to discuss pros and cons of many constructs and programming styles, such as "category theory".

-- Dean
 
Junilu Lacar
Marshal
Posts: 16631
278
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To be fair, I really enjoyed learning Scala, and especially since I did it through a MOOC that was taught by Martin Odersky himself. As with any language, if you write clean and well-factored code and don't try to jam everything you can imagine in one function, Scala programs can be quite elegant and enjoyable to work with. The problem is when people are undisciplined and try to be too clever, not thinking of the next person who will have to work with the code.

Dean Wampler wrote:I did try to discuss pros and cons of many constructs and programming styles


Awesome. Good luck with your book!
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic