As alluded above, the biggest problem with the constructor syntax in languages that borrow from C++ is that in the common case of a class...
As alluded above, the biggest problem with the constructor syntax in languages that borrow from C++ is that in the common case of a class with just one constructor, the parameters of that constructor aren't available in the body of the class, leading to awful code like the following: class Point { public float x; public float y; public Point(float x, float y) { this.x = x; this.y = y; } public String toString() { return "(" + x + ", " + y + ")"; } } This hurts. Fortunately, we've already made that pain go away in Ceylon. Well that seems like a laudable goal. Let's take a look at the example code, then, to see what the alternative is: class Color { shared Integer rgba; //default constructor shared new (Integer rgba) { assert (0 <= rgba <= #FFFFFFFF); this.rgba = rgba; } ... string => "Color { \ alpha=``hex(alpha)``, \ red=``hex(red)``, \ green=``hex(green)``, \ blue=``hex(blue)`` }"; } Maybe it's just me but it looks like the pain is still there?
Posted by couchand on Jun 22, 2015, 12:15 PM
Tags
Related issues
- The biggest problem with having an LLM do this, from what I've observed of at least frontier models, is that the way they are trained...
- The biggest problem with MOND is that it was hand-crafted with additional parameters simply to fit the data.
- (My comment is about detached houses).
- The biggest problem with this is that I can't run my company's own internal benchmarks against this API, because they will be trained int...
- > steer Claude away from over-engineering parts of the system in response to hypothetical concerns.
- Why is there no comparison with FLUX 3 Image?
Raise real-world problems, find people facing the same issue, and discuss solutions.6,000 issues0 comments
hackernews (Other)
The biggest problem with having an LLM do this, from what I've observed of at least frontier models, is that the way they are trained...
The biggest problem with MOND is that it was hand-crafted with additional parameters simply to fit the data.
(My comment is about detached houses).
The biggest problem with this is that I can't run my company's own internal benchmarks against this API, because they will be trained int...
> steer Claude away from over-engineering parts of the system in response to hypothetical concerns.
Why is there no comparison with FLUX 3 Image?
> our Git monorepo was developing an annoying problem Sentences like this are so common from people using monorepos that I am convinced ...
Why is there no contact form?
As alluded above, the biggest problem with the constructor syntax in languages that borrow from C++ is that in the common case of a class...
As alluded above, the biggest problem with the constructor syntax in languages that borrow from C++ is that in the common case of a class with just one constructor, the parameters of that constructor aren't available in the body of the class, leading to awful code like the following: class Point { public float x; public float y; public Point(float x, float y) { this.x = x; this.y = y; } public String toString() { return "(" + x + ", " + y + ")"; } } This hurts. Fortunately, we've already made that pain go away in Ceylon. Well that seems like a laudable goal. Let's take a look at the example code, then, to see what the alternative is: class Color { shared Integer rgba; //default constructor shared new (Integer rgba) { assert (0 <= rgba <= #FFFFFFFF); this.rgba = rgba; } ... string => "Color { \ alpha=``hex(alpha)``, \ red=``hex(red)``, \ green=``hex(green)``, \ blue=``hex(blue)`` }"; } Maybe it's just me but it looks like the pain is still there?
Comments (0)
No comments yet. Start the discussion.