« first day (397 days earlier)      last day (3637 days later) » 

12:00 AM
Haha, wow. I was thinking that something like this would be useful, and here it is:
gameLoop: while square != finalSquare {
    if ++diceRoll == 7 { diceRoll = 1 }
    switch square + diceRoll {
    case finalSquare:
        // diceRoll will move us to the final square, so the game is over
        break gameLoop
    case let newSquare where newSquare > finalSquare:
        // diceRoll will move us beyond the final square, so roll again
        continue gameLoop
    default:
        // this is a valid move, so find out its effect
        square += diceRoll
        square += board[square]
So the loop is "labeled" (like you'd normally do for a goto:), but it allows you to break the outer loop from within the inner structure that also responds to a break.
So instead of just breaking the switch you're in, you can break the loop from within the switch.
 
@Yuushi ... you thinking what I am thinking?
 
@rolfl Probably not...I'm half-assedly trying to learn AngularJS while I chat in here, so my attention is sort of divided
 
Well, I am looking at @nhgrif's 'revelation' there thinking ..... I learned that 20 years ago, right?
2
 
to be fair, there's not a lot of languages I can think of off the top of my head that have labelled breaks
 
what revelation?
 
12:06 AM
other than Java
 
I'm looking at syntax for a language that was introduced 2 days ago.
 
perl has labelled next and last.
 
Though, I never actually understood what tuples were until I started reading about Swift yesterday.
 
That's what swift is... it's perl.
 
I know other languages have tuples though.
 
from one of the designers, it's meant to be a mix n match between C# and Rust
 
Function/method declarations are kind of odd.
The return type is at the end of the line
 
it's getting more popular to do that seemingly
 
func sayHello(personName: String) -> String {
    let greeting = "Hello, " + personName + "!"
    return greeting
}
 
it's actually slightly Scala-ish:
 
12:14 AM
This is cool though:
func count(string: String) -> (vowels: Int, consonants: Int, others: Int) {
    var vowels = 0, consonants = 0, others = 0
    for character in string {
        switch String(character).lowercaseString {
        case "a", "e", "i", "o", "u":
            ++vowels
        case "b", "c", "d", "f", "g", "h", "j", "k", "l", "m",
        "n", "p", "q", "r", "s", "t", "v", "w", "x", "y", "z":
            ++consonants
        default:
            ++others
        }
    }
    return (vowels, consonants, others)
Returns 3 values. And they're named.
You use the result as such:
 
looks like a function that's returning an anonymous type..
 
let total = count("some arbitrary string!")
println("\(total.vowels) vowels and \(total.consonants) consonants")
Your function parameters have names. They can have separate external and internal names.
 
because inside my function they call me 'sir', and outside they call me 'monkey' ?
 
Yep.
 
...but the type being returned doesn't have a name. it's anonymous.
 
12:17 AM
looks like Go :)
 
Looks like Go ....... fish!
 
The parameters can have default values now, which I know other languages have, but Objective-C doesn't, as far as I know.
 
(gone fishing)
 
@nhgrif - this is all very cool and all, but I want to know when all these novices are going to flood CodeReview asking you for advice?
 
Dunno. I plan on putting some up before others get to it.
 
12:19 AM
I'll review it for you ;-)
 
Interesting...
So by default, values are passed to functions as constants and cannot be modified within the function.
But you can mark them with var in the function definition, and now they can be modified within the function
Or you can mark them with inout and modify them within the function and the change persists outside the functions (pass by reference)
 
var mathFunction: (Int, Int) -> Int = addTwoInts <-- function pointer, essentially
Where mathFunction is an (Int, Int) -> Int function variable
and addTwoInts is a defined function that matches that function type
 
so can you declare var mathFunction: Int -> Int = addTwoInts(1)?
 
And actually, this isn't really anything new for Objective-C folks.
No.
addTwoInts is an already defined function
 
12:25 AM
yeah
basically I'm asking if it has currying
 
func addTwoInts(a: Int, b: Int) -> Int {
    return a + b
}
What's currying?
 
effectively, allowing functions to have parameters "bound" and decaying to a function that takes one less argument
 
This actually isn't particularly new to iOS developers (function types), the syntax is just a little easier, I think.
 
syntax for that has a definite functional programming feel
 
Let me see if I can remember the Objective-C syntax for doing the same thing...
int (^addTwoInts)(int, int) = ^(int a, int b) {
    return a + b;
}
Though, you can't assign already existing functions to the variable
I could though change the function to any function of the same type
Well... this is interesting...
enum Barcode {
    case UPCA(Int, Int, Int)
    case QRCode(String)
}
 
12:41 AM
You almost have me interested in swift @nhgrif. Are they more or less locking devs into using Mac to develop?
 
Probably.
As far as I know, Swift can only be developed with Xcode.
From the documentation section labeled Classes and Structures:

NOTE

An instance of a class is traditionally known as an object. However, Swift classes and structures are much closer in functionality than in other languages, and much of this chapter describes functionality that can apply to instances of either a class or a structure type. Because of this, the more general term instance is used.
Alright, so I found the Swift distinctions between classes and structs.
Inheritance enables one class to inherit the characteristics of another.
Type casting enables you to check and interpret the type of a class instance at runtime.
Deinitializers enable an instance of a class to free up any resources it has assigned.
Reference counting allows more than one reference to a class instance.
And so as someone pointed out earlier and I was incorrect about, Swift structs are indeed pass by value and classes are pass by reference.
 
ah, the C# approach then
 
Hoorah! There's a note in the documentation urging developers to capitalize their Class/Struct names. ;)
And lower case the method and property names.
"Structures and enums are value types. Classes are reference types" heh.
=== is used to check if two object variables point to the same object. == is used to check if the two objects are considered "equal" and apparently this is defined by the class creator... so maybe there's operator overloading?
If you have experience with C, C++, or Objective-C, you may know that these languages use pointers to refer to addresses in memory. A Swift constant or variable that refers to an instance of some reference type is similar to a pointer in C, but is not a direct pointer to an address in memory, and does not require you to write an asterisk (*) to indicate that you are creating a reference. Instead, these references are defined like any other constant or variable in Swift.
Oh... great...
Swift has an Array and Dictionary type. These are different from NSArray and NSDictionary which are classes in the Foundation framework... and will be accessible in Swift... so here comes a billionty questions about Array versus NSArray...
There's a keyword (at)lazy (with the @ symbol)
 
12:56 AM
Careful who you ping there.
 
Oh..
 
1:12 AM
CR now has a 30K user!
 
Class and structure properties can have getters and setters, of course, but they also can have a willSet and didSet, with willSet being called just before the setter is actually called and didSet called just after.
 
30,001 actually
 
And you can define subscripts for your classes, structs, enums, so you can access things via square bracket notation like an array
 
I have to disagree with the sentiment. First, I'll say I'm the biggest opponent of SSCCE's you'll find. They piss me off on SO like nothing else. That being said, an SSCCE is often production code that has had unnecessary statements trimmed away so they don't distract from the actual question. After all, it has to be short enough to fit into a post - you're not just going to say "here's my github, go read it". I think you're committing what is known as "Equivocation". — corsiKa 3 hours ago
 
Swift has the ability to finalize classes, functions, variables, etc. now.
Now, as opposed to before being Objective-C.
 
1:21 AM
The fun has begun on SO @nhgrif.
http://stackoverflow.com/q/24050102/3198973
 
That's a swift-array specific question though.
And there have already been plenty.
swift-specific questions that is
 
I didn't realize. Didn't they just announce it?
 
In three days. Heh
 
Thanks Santa!
 
1:28 AM
Quick question(s), sorry if this is not the right venue. How can I create a meta question about how I should address updating my answer; and is a meta question the appropriate way to do that?
 
You just ask here for starters
Or at least give us a better idea of what the question is
 
@blaze4218 You ask on meta, but, I think you may find there's already an answer.
Meta is here: meta.codereview.stackexchange.com and the answer I thikn you may be looking for is .....
17
Q: For an iterative review, is it okay to edit my own question to include revised code?

JoelIs it okay to edit the question to include the improved code? I would like to do so for the following reasons: To share the improved code with others To show the answering persons that I take their feedback seriously To make sure that I understood (and implement) the feedback in the right mann...

Oh, you really mean updating your answer, or your question?
 
my answer
 
0
Q: Aggregating multiple data sources

mchangunI am running a Python script to aggregate data from various sources to do processing. The below is currently part of my main() function but I am trying to reduce the size of my main() function so it's easier to read. var1 = get_param(a, b) var2 = hdf_file['blah1'][:] var3 = hdf_file['blah2'][:]...

 
So.... there's a convenience keyword in Swift.
for convenience initializers...
 
1:32 AM
@blaze4218 - search around on meta, see if something matches. Otherwise ask the question.
It sounds 'new', so just do it.
That is what meta is for.
 
*I have seen several variations, I'm just not sure which is right for the way my answer has evolved based on OP feedback
 
Ahh, that may indicate a different problem...
has the OP been 'moving the goalposts'?
2
 
no, better clarification I think...
1
A: Animating Coloured Cogs

blaze4218Ok, now that I have a firm grasp on what you're doing, I think I have what you're looking for. The below still applies in terms of optimizing what you posted, but I think what you want is more along the lines of the following: fiddle var paper = Raphael("canvas", 500, 500); var rectangles = { ...

 
Ahh, the good old, "question was not clear enough", and additional information has refined the problem.
First up, despite what you may feel, you don't have an obligation to continue helping if it is taking too much time.
Second, I edited the question, and I now how much of a language barrier was part of the problem.
 
Thank you, but it is helping me as well- I have been working on an article about this very framework
 
1:37 AM
That's the next thing, how much are you willing to invest.
I spent, what, 40 minutes earlier here in chat doing pretty much what you think you want to do.
Going through the nitty-gritty of a problem that was interesting to both me and the OP.
The Q&A format of Stack Exchange is not great for a dialog.
(we actively control that).
 
gotcha
 
Chat is a good place for dialog.
In fact, in a few comments time, that answer of yours will create an automatic flag for moderators saying "too many ocmments".
 
i see
 
That's not a bad thing, no-one is in trouble when that happen.
but, you will also get a prompt to "move this to chat" when you try to add a comment.
What you should try to do, if you can, is leave your answer in a state that you feel reflects what was asked in the question.
 
does "move this to chat" mean a "too many comments" mod flag was raised?
 
1:41 AM
No, not quite.
I think the move-to-chat is raised at 20 or so, and the flag at 25.
If you want to keep a dialog going with the OP, take it up in chat.
 
if let movie = item as? Movie <-- this is really cool Swift syntax.
item is of type MediaItem and Movie is a subclass of that
 
if you want to get reputation, then encourage him to post a revised question based on the changes, and you both score by having a new question and a new opportunity to answer.
 
That syntax tries to cast item as a Movie. If it is a movie (and not some other subclass or just a regular MediaItem, it unwraps item into movie which is an object of type Movie and enters the if, otherwise it doesn't enter the if.
 
I feel the question is answered when the code presented is reviewed, but I have suffered no "upvotes" when others re-write the code better on answers I have provided that address the problems with the code (as they pertain to the framework the OP chooses to use) codereview.stackexchange.com/questions/52429/…
am I not doing this right somehow?
 
Well, the firs tthing you are doing right is talking about it in chat.... (for real).
 
1:47 AM
yeah... sorry bout before... was very frustrated...
 
No problem. We all have crappy times....
and let's face it, rather take it out on the net than your dog.
 
Looks legit to me @blaze4218, but I don't know java.
 
@ckuhn203 it's ;)
 
@ckuhn203 - seriously.... have we not ....
Java is to Javascript is what Car is to Carpet.
@blaze4218 - voting is 'fickle'.
 
^^ that.
and java is JAVA without the caps lock on ;)
 
1:51 AM
You have what looks like a well-thought-out answer there, but people won't upvote what they don't see.
 
^definitely that...
 
And, this is still a small site, and, you may notice, in the right margin, the pinned message
May 26 at 16:59, by Mat's Mug
guys no pressure, but VOTE LIKE IT'S THE ONLY WAY TO BREATHE
We are tying to encourage people to vote.
The odds are that the only person who looked at your answer was the asker....
 
if comments help clarify the OP, then the comments should be rephrased into the question.
 
My bad guys. <ducks>
 
and, he's not a great voter:
So, that brings me back around to one of my original statements....
 
1:53 AM
@ckuhn203 yup. <ducktyped>
 
after my first -not so good first couple of days- I did a lot of reading up on what you're doing here, and yeah... been trying to upvote and contribute in anyway I can.
 
the first trick to getting rep on Code Review, is being in chat.
For various reasons, the answers that are chatted about, get lots more 'eyes on', and thus more votes.
 
Looks like OP accepted an answer and moved on @blaze4218
 
^^^ that's my reasoning too.
Instead of leaving the 'nice' comment, they should have clicked the upvotes.
2
This answer is consise and clear, with great ideas that are simple to implement without much more javascript knowledge... and working examples. Thank you! I look forward to playing with it when I reach the office tomorrow! The other answers, whilst look splendid, are far too advanced for me at this stage, but I will endeavour to improve my skills until I reach the stage where I can revisit them. Thanks all. — mpdc 6 hours ago
 
excellent... rubs hands vigorously in an ominous fashion
 
1:55 AM
I think I will don the 'mod hat'.
 
I've not seen you in your mod hat.
 
@rolfl about that comment, that is the only reason I didn't downvote the answer that was accepted, but I am concerned about a few bad practices that were presented in the answer and was preparing a comment of my own... is that bad?
*my reasoning being that the answer was most helpful to the OP...
 
@mpdc in general, comments are 'ephemeral', and can be removed at any time. Votes on the other hand, are appreciated by everyone, and they last for longer. Consider up-voting those answers that added value, down-voting those that removed value, and accept the answer that you felt addressed your question the best (which you appear to have done). Voting is what is valued most. — rolfl ♦ 32 secs ago
 
I don't think so. If you have concerns about an answer, they should be voiced for anyone who sees it in the future to consider.
 
@blaze4218 - always vote for the content, never the person.
2
If the content is great, up-vote. If it's wrong, down-vote, whatever.
Also, remember, that it will be your turn sometime.
 
1:59 AM
@rolfl ? that seems counter intuitive somehow...
my turn?
 
yes, there will be a time when your answer is accepted, and upvoted.
 
fingers crossed
 
And there will be someone else who has put in more effort, and got a better answer, but it somehow just got overlooked.
 
ahhhh
 
Truth
 
2:01 AM
I try to be nice, but I am sure I get a disproportionate number of votes just because I am a mod, I have high rep already, or whatever.
It does not take long to establish yourself as someone who is 'good'.
I get votes in , but not anywhere else.
seems you have a knack for Javascript.
you shoudl go zombie hunting.
2
 
@rolfl (cough)
 
@Mat'sMug - everyting is relative ;-)
 
bah
 
I have 2K Java votes, but my next language is SQL at 145.
 
@ckuhn203 oh, I misread that... I thought you were saying that my answer was accepted- which I assumed meant on codereview.stackexchange.com/questions/52473/…
whooops...
zombie hunting?
 
2:05 AM
It's not about the votes either @blaze4218 . Did you write a thoughtful, accurate review? It looks like you did. You might not have helped OP, but you might help someone else who happens to read it.
3
 
@ckuhn203 thank you.
 
21
Q: What's a Zombie? And what are the many other memes of Code Review?

Simon André ForsbergWhat is a Zombie? Why are Code Reviewers so violent and talking about killing Zombies all the time? And what ammo are they talking about? What is a TS? What does RSA mean? And what other Code Review-specific memes are there? (As the number of memes grows and grows, and Malachi's wish to vote fo...

You're welcome.
 
mmm... BRRRAINS!!
 
@rolfl and a badge is in sight, too
 
Oh, I have the badge ;-)
 
2:08 AM
I should be working on that refactor....
Not feeling it.
 
Right, time to go an convince a linux port that it is not where it thinks it is.
actually @blaze4218 - one other thing.
You should understand 'hot questions'.
 
and they are...
 
When a question gets above a threshold value of activity, it gets promoted in to the hot-question list.
If you browse to any SE site, say stack overflow........ stackoverflow.com
and look in the right margin.
there are hot network questions.
Questions that get 'bumped' on to that list get a life of their own.
They break all the rules for normal questions, especially on smaller sites like ours.
Suddenly you get questions like this one.... that get a huge number of 'eyes' on them.
17
Q: Check if a number is divisible by 3, efficiently

JavaDeveloperEfficient way to check if a number is multiple of three. Looking for code review, best practices and optimizations. public final class DivThreeEfficiently { private DivThreeEfficiently() {} /** * Returns true if the input number is divisible by three. * Else returns false. ...

That is, technically, a pretty crappy question.
but, it got 'hot'.
And, lots of people got lots of rep from it.
(I wish I had answered it.... :(
Hey Chris Jester!
 
yeah, I got tuned into code golf from the 2+2=5 question
 
In swift, you can write extensions (formerly "class extensions" in objective-c) for what would ordinarily be considered primitive types (Int, Double)...
 
2:17 AM
I had no rep so I needed to be "reviewed" for my edit, but it was approved eventually.
 
Which means that you could use dot syntax to call a method on an Int literal...
extension Int {
    func repetitions(task: () -> ()) {
        for i in 0..self {
            task()
        }
    }
}
 
I think I am officially the "VBA Error handling guy"
http://codereview.stackexchange.com/a/52489/41243
 
3.repetitions {
    println("Goodbye!")
}
// Goodbye!
// Goodbye!
// Goodbye!
extension Int {
    mutating func square() {
        self = self * self
    }
}
var someInt = 3
someInt.square()
// someInt is now 9
 
Anyways, I am eyes-on-linux now..... (napalmed)
 
I like that. reminds me of Ruby's 3.times
 
2:20 AM
I really wanted to answer that for JavaScript, all the others were uninspired unicode trickery, but I used JavaScripts floating point problems to make a legitimate answer, but the site bot closed it down to <10 rep users... Not fair. If that's the only question that I can answer well to gain rep,but I cant answer it: where does that leave me?
</rant> thanks @rolfl see you when you rise from your napalmed ashes...
 
Classes AND structs can conform to protocols.
 
(wasn't the site bot.. or was it @StackExchange?)
 
Protocols are what Java would call interfaces.
 
@Mat'sMug it's user page jsut said that it was an automated service.
 
I'm going to learn just from reading @nhgrif's chats.
 
2:23 AM
@blaze4218 napalmed is a shorthand notation for question.upvotes++;foreach(var answer in question.answers) answer.upvotes++;
3
 
@Mat'sMug dafuq?
 
(sorry for the ..uh, triple-ping!)
lol
 
@Mat'sMug yeah... dafuq on that too...
 
4 mins ago, by blaze4218
</rant> thanks @rolfl see you when you rise from your napalmed ashes...
 
yes, I know that you were responding to that, but can you explain napalmed more clearly?
 
2:27 AM
oh, sorry. a synonym is a carpet bombing airstrike.. you upvote a good question, and then end up upvoting all answers as they're all good too!
 
ok... i see it. also, been there.
 
ah, here
12
A: What's a Zombie? And what are the many other memes of Code Review?

JamalMeme: Napalm Strike (or Carpet Bombing Airstrike) Originator: Mat's Mug (/retailcoder /lol.upvote) Cultural Height: During The Mission Background: This meme came about as the community started seeking good questions and answers to upvote, in response to our first site review. In this context,...

 
oh, yeah- I just got that link. still got to go through it.
well, y'all been great, but I gotta get back to my stories :)
 
come back anytime!
 
Hey @Mat'sMug. How ya doing?
 
2:32 AM
not bad. hungry actually.
 
Want some cake? We have more than I can eat....
 
hehe..
        static void Main(string[] args)
        {
            var cake = new BakeBase();
            var cherryCake = new CherryCake(cake);
            var creamCherryCake = new CreamCake(cherryCake);

            Console.WriteLine(Environment.NewLine);

            Console.WriteLine(cake.PriceDetails);

            Console.WriteLine(Environment.NewLine);

            Console.WriteLine(cherryCake.PriceDetails);

            Console.WriteLine(Environment.NewLine);

            Console.WriteLine(creamCherryCake.PriceDetails);
 
lol
 
and already :(
 
I saw you guys working on that earlier.
 
2:36 AM
I think I might edit that code into my answer
it would make my post clearer I find
 
mmmmmm BaseCake. Nom nom nom
Seriously though, a picture is worth a thousand words. I'd conisder it.
 
a picture?
 
I thought you were talking about editing in the concept map.
What are we talking about?
 
2
Q: Are Code Only Questions Off Topic?

ckuhn203I was browsing through the beginner tag and saw this question. It looks functional. It's certainly review-able, but OP posted absolutely nothing besides the code. No hint about what it does, or what OP expected from the review. That feels Off-Topic to me, but I don't know what I would categorize ...

 
2:42 AM
@ckuhn203 you mean this?
is it correct UML? who cares, can you read it?
 
let x = 1
let y = x &/ 0
// y is equal to 0
 
Yes. I can read it. Looks like a good model to me. But I admitedly wasn't following the question that closely.
What?
Nevermind. I'll never learn swift, so I'm just gonna pretend I didn't ask.
 
lol
& is the overflow operator.
If you perform an operation that would cause overflow/underflow, it's an error
for a uint8, with a max value of 255
255+1 is an ERROR in Swift
but 255 &+ 1 results in 0
/ 0 is a division by 0 error, but &/ 0 is always 0
 
oh, so it's like some misuse me and introduce nasty bugs you'll never find operator right?
 
Yep.
 
2:48 AM
That's what I was thinking. The CodeGolf guys will have a field day.
 
Although... I imagine you'll be able to find the bugs.
 
yeah, but I suppose it's not a good idea to just replace / with &/ systematically.
 
If you know what you're looking for and have an intimate knowledge of the language.
 
Oh Jesus... Swift support operator overloading, which is good, as far as I'm concerned... but... you can also write custom operators...
 
i.e. if you know what you're doing
 
2:49 AM
Poor Mr. Maintainer. No one loves him.
 
Like foo ++ bar or foo+++...
 
I don't know if I love that, or hate it.
I'm confused and conflicted.
 
WTF foo ++ bar
 
yeah
 
(foo++) + (++bar) ?
 
2:51 AM
So maybe you want ++ to be shorthand for add these and double the result
or maybe add 2 * bar to foo
or whatever you want
 
@nhgrif Based on experience with the ML family, this works out about as well as you'd expect: used with care and judgement, it can be great. Used by somebody who's careless or insane, it makes even the worst of C++ (which can already be truly awful) seem tame and mild by comparison.
 
and foo++ might be foo + 1, but foo+++ is foo + foo if you want, or foo + 2 or whatever
 
That's amazing flexibility that is going to be abused endlessly.
 
I think I'm just going to not use it at all...
I'll use the standard operators where they make sense for classes and structs
but if I want to do something weird, a named function is in line...
You can write your own associativety and precedence for operators too
 
It will probably be worse in Swift though--the ability to use any combination of Unicode characters for names opens up enormous new vistas for abuse.
 
2:54 AM
@ckuhn203 let the abused code be Darwin'd.
 
it's not any characters
 
The abused code is the stuff that never goes away @Mat'sMug.
 
Gives a new meaning t the darwin award.
 
just: / = - + * % < > ! & | ^ . ~
 
natural selection right
 
2:55 AM
It's some weird genetic mutation that for some reason is evolutionarily advantageous.
 
Although any combination of these and with no length limit.
 
People who code in this swift language will become so nerdy, and spend so much time maintining their code, they will not reproduce... hence, a self-limiting problem. Darwin FTW
3
 
So you could define foo+++-+&^++&|&~
 
and call it brainfuck
 
yup
 
2:57 AM
Just call it brainfuck.
 
it's not though
 
Exactly.
 
@nhgrif Oops, right. It's only functions that get arbitrary Unicode for names. My apologies.
 
Which is by definition, well......
 
So... I'm going to take a pretty hardline against custom operators in any swift code posted to CR.
3
If you want to write a ++ increment for your struct/class, if it makes sense, fine. But +++, no.
 
2:59 AM
Unless the operator is ><3'3,3>
 
can't use 3s or commas...
 
Some things could make sense.
 
I think I'd be okay with <> if you defined it as the same as !=
 
Maybe....... ^++
 
How about 30,011?
 
3:00 AM
@nhgrif and call it vb
 
since <> is used in other languages as the same as what != in C-based languages
 
@200_success Nice rep, lousy operator
2
 
@nhgrif The more I see of it, the more I think a hard line against Swift in general is fully justified. Some good ideas, but also enough major mistakes to constitute a net loss.
 
It would have to be very clear what the intention is.
 
Well... as someone who writes Objective-C code on a daily basis and works with the Foundation framework on a daily basis, I see a lot of things I like about it versus C/ObjC. Though I've not yet had the time to do any actually coding with it, so I'm not prepared to make any full judgments.
== YES and == true are redundant, unnecessary, annoying, and distracting. And I've been seeing this a lot the past few days. Who teaches this? — nhgrif 8 secs ago
3
 
3:04 AM
Custom operators with the flexibility to use any Unicode could be interesting.
 
FYI - It's Swift, not SWIFT. — rmaddy 5 mins ago
 
So, you want your operators spelled out?
 
Swift banana operator: Monkey 🍌= happy!
 
@nhgrif Alexander Pope invented the perfect phrase to describe a comparison like "better than Objective-C": that would be: "Damning with faint praise."
 
I actually quite like Objective-C.
 
3:06 AM
@nhgrif Allow me to extend my condolences.
 
Anyway, I'm going to bed.
 
Shall we have an nhgrif wake?
 
good night!
 
@rolfl One does not extend condolences to the deceased (nor do condolences necessarily relate to anybody dying).
@nhgrif Good night.
@200_success It shouldn't take a lot more than some work on the lexer to create an ML derivative that would allow that. ML already allows (more or less) arbitrary names for overloads, so it should be most a matter of getting its lexer to turn Unicode into tokens correctly.
 
@200_success for interesting definitions of "interesting"
@JerryCoffin What do you consider the major mistakes?
 
3:22 AM
@Yuushi We were just discussing one: what's allowed/prohibited for operator names does not seem to lead toward particularly clearly code. Building reference counting into the language is about equally bad. Its generics strike me as probably the biggest mistake though--if they were going to copy, it should have been from D, not Java. As-is, they appear to be adequate for collections of T, but almost nothing else.
 
I still don't understand why they chose the <> syntax
 
This is particularly sad when you realize that they hired David Abrahams a while back, so they have at least one employee who could have educated them in intimate detail about the shortcomings of their design, but they apparently either didn't get his input on the subject, or else ignored it completely.
 
does it use type erasure for generics?
I'm probably less fussed than most about the operator names
 
@Yuushi I don't think so, but the descriptions I've seen contain little enough detail that it's impossible to say for sure (or at least I haven't been able to determine with any certainty).
 
From looking at it, I'm rather ho-hum about it
think I've seen every feature before in another language...but perhaps I'm just getting to that point for most languages :/
I don't understand why they chose to go with a Java-like "must be a sub/superclass of U" type generics though
 
3:30 AM
@Yuushi I've not only seen every feature in another language, but in nearly every case have seen the feature done better in another language--and many did better jobs of integrating those features into a coherent whole as well.
 
I suppose on the plus side, I think I could learn a large chunk of the language in a very short time
 
@Yuushi I suppose they wanted constrained genericity, and I can't blame them for that--I think it's a good thing. At least based on market share, Java's would be an obvious choice in that case.
 
@JerryCoffin I agree though, I would have preferred to see something more like D's concept-based genericity
I think I'm feeling less critical, because I'm having to learn angularJS and javascript
and it's making me want to kill something
 
@Yuushi Yes, that would be the obvious choice if technical superiority was taken into account (at all). Suggests that "think different" has given away to "follow the crowd, even if you know they're lost."
Well, gotta go. Good night.
 
@JerryCoffin Night
 
3:43 AM
good night!
TTGTB as well - bye @all!
 
4:43 AM
virtual void setMarkingText(const char* text);
why why why why facepalm
 
0
Q: Is there a simple way to use Underscorejs to achieve this?

3gwebtrainI have a object, having key and values, I like to pick the object and call the appropriate function from the key... see my example: var requireViews = { "breadCrumbView": true, "headerView": false, "footerView": false }; _.each(requireViews, function(...

 
morning @all
 

« first day (397 days earlier)      last day (3637 days later) »