Tag Info

New answers tagged

0

A Smalltalk web framework 'Seaside' uses resumable expections. The gain: You can write code which follows a users walk through the web-pages (asks and resumes). The alternative (with common web-frameworks and languages which do not support resumable exceptions) is to split your code into small, unrelated chunks and session-state.


2

The real point of resumable exceptions is that the place where the exception happens is often not the right place to decide what to do about it. The OP's missing directory exception may occur inside some low level utility library, which which can be used by many different systems. If the client code is a batch program then there may be nothing better to do ...


2

I took your question as why not design the language to prevent the need for a convention in the first place? In other words, why doesn't Scala just force the use of parentheses all the time, instead of allowing programmers to omit them sometimes? The answer is found in referential transparency. Essentially, if a function has no side effects, a function ...


3

That is a convention, not part of the language design. It is used as a signpost to help the folks who have to read the code after you write it to understand it better. From Scala's Style Guide on Method Invocation: Scala allows the omission of parentheses on methods of arity-0 (no arguments): reply() // is the same as reply However, this ...


0

I have some code that illustrates some of the differences wrt visibility and "default" implementations when extending vs setting a self-type. It does not illustrate any of the parts discussed already about how actual name collisions are resolved, but instead focuses on what is possible and not possible to do. trait A1 { self: B => def doit { ...


3

I would argue that in general functional programming reduces complexity by eliminating mutable state, thereby reducing the number of cases that must be considered when trying to understand how a section of code works. However, functional programming makes higher degrees of abstraction possible, and while highly abstract code can be extremely useful it can ...


-3

Does it add complexity to the program, or is it just that you're not used to this way of programming? Why do you think these possibilities aren't the same thing? Well written code can be read by people who aren't familiar with the specific programming language. Some languages (BASIC, Pascal, etc) can be read and understood by school-children who have never ...


7

I would say that you not being accustomed to the way they code is at least part of the picture. I'm in a similar situation as you (coming from C# into F# and working with people with Haskell background), and while I find it an interesting experience, I do have moments when I'm banging my head against the wall, untangling a particularly convoluted point-free ...


33

This has nothing to do with functional programming - you can find this kind of situation in context of any other programming language - developers who love the advanced constructs of "their" language so much that they ignore any common sense about readability and keeping things simple. I have encountered such a situation in C, C++, Perl, Java, C#, Basic, and ...



Top 50 recent answers are included