Scala best practices I wish someone'd told me about - Nicolas Rinaudo

  Рет қаралды 23,192

Scala Days Conferences

Scala Days Conferences

Күн бұрын

Пікірлер: 14
@IlariVallivaara
@IlariVallivaara 2 жыл бұрын
Scala Practises I've learned: Scala allows you to write so concise code that you can use a readable zoom level in your presentations.
@re1konn
@re1konn 2 жыл бұрын
Just to add, for implicit resolution discussed at 38:30, the situation has improved in Scala3 since you need to separately import givens(same as "implicit val") from packages. The chance for a name clash for the implicit reduces since you now know which implicits you are importing.
@nilskp
@nilskp 5 жыл бұрын
Good presentation, with one comment: When constructing an ADT that extends Exception, be sure to also tag it with NoStacktrace. Otherwise you get a stack trace that lies, since it's from instantiation code, which will be arbitrary and probably confusing/misleading.
@nilskp
@nilskp 5 жыл бұрын
Qualifier: when using `object`, of course.
@nilskp
@nilskp 5 жыл бұрын
@akashic seer that's not really specific to Scala though.
@jimnewton4534
@jimnewton4534 4 жыл бұрын
Nice talk. It is nice to have these lists of best practices. I wasn't convinced by the description of the Exceptions based problem. Despite the claim by slide 42/79, I don't think the issue is that "Exceptions are like GOTO, and GOTO is bad". On the contrary, GOTO is good, just not in hand written code. Computer languages are also good for code generation, especially in the presence of meta programming, and GOTO is useful in meta programming such as compilers; can you imagine a compiler for example which didn't implement if/then/else as GOTO? The problem with Exceptions is that Scala implements Exceptions by just using the Java Exception implementation (for better or worse) and Java Exceptions unwind the stack. If they didn't, that problem would partially go away. If Exceptions didn't unwind the stack, but rather handling an Exception could optionally unwind the stack, wouldn't most of the problem go away? Another problem with Exceptions is that try/catch works on the dynamic extent, not lexical extend. This means that if a thow is sitting inside a lambda which is inside a try, then the lambda can escape from the try, and be called at a later time, not inside the try. Thus the catch may not catch the exception in lazy code.
@SuperSam4y0u
@SuperSam4y0u 4 жыл бұрын
14:40 "Yeah scala is a bit magic, let me get back to javascript" 😂😂
@kingcchultz3366
@kingcchultz3366 2 жыл бұрын
the idea of final case classes ar good, fnx
@sergeibatiuk3468
@sergeibatiuk3468 4 жыл бұрын
Why can't case classes be extended by other case classes with giving rhe same syntactic sugar? That would save a lot of time
@WildcatTofu
@WildcatTofu 5 жыл бұрын
Scala shall put a @deprecated("use java instead") on the scala.enumeration.
@caof2005
@caof2005 Жыл бұрын
The code presented is difficult to read, the author may have thought that because for him, the code was clear to read, the same will happen with the rest of the audience, unfortunatelly is quite different for the one that see a video of a talk.
@zmitrolapconak6458
@zmitrolapconak6458 5 жыл бұрын
dark theme is fine, but not in presentation. readability near zero :(
@IlariVallivaara
@IlariVallivaara 2 жыл бұрын
Exactly. Also the zoom-level should be increased considerably. Now majority of the slides is empty but the code snippets are unreadable mess in one corner.
@masteryoda9044
@masteryoda9044 Жыл бұрын
the best scala practise is to stop using it 😅
A Tour of Scala 3 - Martin Odersky
55:48
Scala Days Conferences
Рет қаралды 25 М.
Functional Programming with Effects by Rob Norris
49:43
Scala Days Conferences
Рет қаралды 26 М.
УНО Реверс в Амонг Ас : игра на выбывание
0:19
Фани Хани
Рет қаралды 1,3 МЛН
Hilarious FAKE TONGUE Prank by WEDNESDAY😏🖤
0:39
La La Life Shorts
Рет қаралды 44 МЛН
Air Sigma Girl #sigma
0:32
Jin and Hattie
Рет қаралды 45 МЛН
Martin Odersky - Scala's Role in the Programming Languages Ecosystem
45:53
Scala Days Conferences
Рет қаралды 13 М.
Pure Functional Database Programming‚ without JDBC - Rob Norris
54:06
Scala Days Conferences
Рет қаралды 11 М.
Scala: Beyond the basics with Christopher Batey
48:05
Devoxx
Рет қаралды 49 М.
Martin Odersky SCALA HAS TURNED 20  - Scalar Conference 2024
30:51
SoftwareMill
Рет қаралды 3,1 М.
Nicolas Rinaudo - When is an ADT not an ADT?
37:25
Scala Days Conferences
Рет қаралды 1,6 М.
A Crash Course in Category Theory - Bartosz Milewski
1:15:14
ScalaIO FR
Рет қаралды 92 М.
John De Goes - 12 Steps To Better Scala (Part I)
1:04:20
RISK IDENT
Рет қаралды 20 М.
Demystifying Scala • Kelley Robinson • GOTO 2017
48:07
GOTO Conferences
Рет қаралды 30 М.
What Can Scala Learn from Rust? by John A. De Goes
59:03
Ziverge
Рет қаралды 12 М.