« first day (854 days earlier)      last day (3155 days later) » 

12:00 AM
RELOAD!
There are 1491 unanswered questions (94.4126% answered)
 
Just hovering there @Duga.
 
I answered, and VTC'ed.
That question should seriously be closed as stub code.
 
12:16 AM
If your code is working than this probably belongs on Codereview since you seem to be seeking improvement advice. But check their on topic help section to make sure it does. — Patrick Evans 19 secs ago
 
0
Q: factory that creates a complex object tree

Alex QI've got a complex object tree that I need to instantiate. The object tree is a bunch of specialized classes that don't have a common root object (other than Object) and has generic objects (that I need to configure), and custom objects (all the "My" classes in the example code). I've created th...

 
1:15 AM
Non-nullable reference types proposal by Mads Torgersen!
 
1:37 AM
Reading that right now @JeroenVannevel.
 
1:58 AM
Anyone know cryptographic computing around here?
This guy is trying to convert a boolean into 0/1 without an if, and says it is commonly done in cryptographic computing.
 
CR question?
 
2
Q: Fast constant time evaluation of "x==7" to 1 (true) or 0 (false) in Java

ChrisI want to port a crypto function from C to Java. The function has to run in constant time, so no conditional branchings are allowed. The original C code is: int x,result; ... result = (x==7); ... So that 'result' is set to 1 if 'x==7' and to 0 otherwise. The 'result' variable is then used in ...

Whoops, I copied the link and forgot to post it.
 
Are they trying to reinvent the comparison operator?
 
They want an atomic operation.
The if is two operations - the comparison, then the assignment.
 
(1<<(x-7))&1; wat
I thought it was
 
2:04 AM
Yeah.
Nope, it is JAVA.
 
that looks more like C++, (I don't actually know C++, so, I'm probably wrong)
 
0
Q: How can I refactor this code(ruby) - Exporting a list of tracks from soundcloud

railsrHere's meth that exports a list of likes from soundcloud to csv. How can I make it better? def tracks page_size = 50 client = SoundCloud.new(:client_id => CLIENT_ID) res = [] tracks = client.get("/users/#{USERNAME}/favorites", limit: page_size, order: 'created_at', linked_partitioning: 1...

0
Q: Library for C++ programs

InitializeSahibHi! So here is some of the code in my library: InverseAPI.cpp: // InverseAPI (Cobalt) // Developed by Sahibdeep Nann (@SahibdeepNann) // https://github.com/InitializeSahib/InverseAPI // Licensed under the MIT License #include "stdafx.h" #include "InverseCobalt.h" namespace InverseCobalt { ...

 
Anyway, Java has bit shifting (the <<) and a bitwise AND operator (the &).
 
> here's meth
 
Flag for being a drug dealer.
 
2:13 AM
var a = {
    true: 1,
    false: 0
};
var b = 7;
return a[b==7];
 
That isn't a half bad idea.
 
@Quill lol
 
But, it looks like JS, not Java.
 
That's cause it is :P
I can only JAVA
 
It wouldn't work in Java.
 
2:16 AM
the b==7?
 
No.
You cannot convert a boolean to an integer in Java.
I've got dishes to do. See you later.
 
later
Map<Boolean, Integer> map = new HashMap<Boolean, Integer>();
map.put(true, 1);
map.put(false, 0);
System.out.println(map.get(7 == 7));
@Hosch250 ^ this Java solution seems to work for me
 
2:39 AM
Posting it at CodeREview may give you some feedback... But inline CSS and tables is sooooo 2006. — Alexei Levenkov 14 secs ago
 
2:56 AM
thanks for detailed code review. Now its much more clear. so the compiler doesn't allow non const arguments to bind to temporary objects. Btw why does it allowed me to use this non-const copy constructor in operator+ then ? — barney 30 secs ago
 
3:16 AM
@Quill Yep. That looks like it will work.
You should post an answer.
 
3:44 AM
Evening fellas
 
evenin
 
Man, I must have missed a lot today.
I spent 11 hours at an amusement park.
 
wow
that sounds like a lot of fun
was it a SixFlags park?
 
No, it was a CedarFair park
Just as fun though.
I am really beat though.
Walked almost 8 miles, according to my pedometer.
 
4:30 AM
@Hosch250, the question got migrated to SO
that was the right decision
 
4:46 AM
0
Q: notifyDataSetChanged after list update within Fragment

LukeI'm brand new at Java and have read a bunch of questions/answers about this but have not been able to find a solution which works. I have a ListView and when I remove an item from my list (within getView using onClick), I call an Asynctask to remove the item from the database, and then pull the r...

 
5:02 AM
0
Q: C++ Lockless SCSP Queue

Joshua WaringI'm looking for a code review on a class that I've written, it was my first attempt at lockless programming and I'd love and feedback I can get. https://github.com/Protheus-Engine/Protheus/blob/devel/src/Utilities/Pipe.h Thank you for any help and/or advice.

 
@CaptainObvious @200_success That can be re-opened now.
One more vote...
 
5:45 AM
night
 
6:25 AM
 
night
 
0
Q: Python: This code to find cube root is causing loop

DigvijaySinghI don't understand why this code is causing loop. Can someone please explain? x = raw_input('Enter a number: ') ans = 0 while ans**3 < x: ans += 1 if ans ** 3!= x: print('No cube root for ' + str(x)) else: print('Cube root for'+ str(x)+ 'is'+ str(ans)) Please pardon me if I've p...

 
 
2 hours later…
8:56 AM
@CaptainObvious I'm getting quoted now ^^
By @EthanBierlein
 
9:38 AM
0
Q: Parsing an XML file and creating an object with multiple properties from the XML

user9993This question contains some C# code I've written as well as a XML format I have designed. My C# code runs a series of "jobs" by loading the XML file and then calling different SQL stored procedures and E-Mailing the results to different addresses. My question specifically relates to the C# code t...

 
9:52 AM
hm
 
10:05 AM
M o n k i n g
 
monking @skiwi
 
@ARedHerring oh boy
 
10:24 AM
0
Q: Steganographic message hiding

CaridorcThis code hides a message in an image by altering the blue values in the top left part. This is just for fun as I think it would be easy for a cryptographer to find and decrypt this. Original With message We will meet at London bridge at dawn As you can (cannot) see, as long as the message...

 
@ARedHerring That's one way of running out of stars ^^
But we had a kind of decent starwall, so I don't mind.
 
10:49 AM
0
Q: takes input from keyboard for Atmega32 using scanf

ruhanaassalamu a'laikum ‪ ‎include‬ include int main (void) { DDRA = 0xFF; unsigned char x; scanf(" %c",&x); while (1) { if (x=='a') { PORTA = 0x01; } if (x=='b') { PORTA = 0x02; } } ...

 
11:13 AM
Is rewriting the code in a review on-tpoic or considered a bad answer?
For example, I am reviewing a quesion where I feel that OP woudl be better suited splitting their code out into using CSS and HTML and a bit of JavaScript instead of entirely JavaScript, however this would mean rewriting all of their code
 
11:31 AM
"But, I want to improve my code" Stack Overflow is place where we solve problems. If your code works fine and you are asking for hints to how you can improve it farther you should post this question on codereview.stackexchange.com instead. — Pshemo 23 secs ago
 
11:45 AM
0
Q: polish my code: Java: Find the longest sequential same character array

tktktk0711I am a new guy to java. I want to find the longest sequential same character array in a input character arrays. For example,this character array bddfDDDffkl, the longest is DDD, and this one: rttttDDddjkl, the longest is tttt. I use the following code to deal with this problem. But, I want to imp...

 
@ARedHerring It's a good answer if you tell why it's better.
 
@CaptainObvious do we block "review" and that one just decided to say "polish" instead? #SomeDontGetIt
 
However, don't feel obliged to rewrite their entire code. We're Code Review, not Code Rewrite.
@Mat'sMug Even worse ^^
Fixed it for him by removing the first part of the title.
I'm not going to fix his code indentation though, he should do that himself IMHO.
 
Monking
 
@Mast this is what I have currently and this is the original question
 
0
Q: How to open simple html file in Orweb browser?

tukI have installed Orweb(Android equiv of tor browser), Orweb doesn't appear to allow bookmarks only a homepage, no problem I'll just create a simple html page containing a list of links and set this as the homepage.... Via ES Explorer I tried setting the html file to open in Orweb using 'open as'...

 
Monking!
 
monking @RubberDuck
 
php folks here??
else I may just shoot that thing into the queue...
 
I haven't touched php since... Forever ago. And with any luck I'll never have to again.
 
12:08 PM
@ARedHerring I'm no expert, but that looks like a good answer.
 
@ARedHerring answers are under no obligation to have any code in them at all.
 
That
Or even review the code
 
I've seen some very good answers that are just lists of issues and approaches to fixing it.
 
11
A: Password hashing and matching

Mast However, there is a lot of talk about what implementations are secure and not secure. How does my method measure up? Is it secure? Are there more secure methods in PHP for hashing tokens and matching with tokens later on? Since you're specifically asking about security, I think reviewing you...

 
It very much depends on what level you feel the OP is at and how much effort you want to put into it.
 
12:09 PM
Not reviewing the code, just stating "Don't do it yourself but do it the secure way"
There really is a lot of things we consider an answer.
But I'm against code dumps.
 
code dumps are NAA..
 
0
Q: Rust: Merging Overlapping Intervals

W.K.SI'm getting myself acquainted with Rust and decided to implement the classical overlapping intervals problem. Here is a statement of the problem: Given a collection of intervals, write a function that merges all overlapping intervals and prints them out. For example, given [1, 3], [2...

 
there needs to be an explanation, or it's at best not helpful or at worst deletable garbage
 
Indeed.
 
Yes yes. Indubitably.
 
12:12 PM
btw. I'm kinda going through the url-routing candidates here, anyone want to join?
 
Yeah. I'm about to jump in. Was just writing some reviews this morning.
 
Somebody has an idea why this answer was downvoted? I put in my upvote and maybe I can learn something....
 
@Vogel612 Sounds fun, what are you doing exactly?
 
retagging and editing as necessary
 
@Vogel612 Too hostile?
 
12:13 PM
it's at worst blunt
 
Some consider that hostile.
 
I've written answers that are even more "hostile" and I got upvotes out of it
 
I don't consider it hostile
I don't think it says much
it's not upvote-worthy
 
I don't consider it hostile either, but I can understand why one would think otherwise
 
but it's not worth downvoting either
 
12:14 PM
@ARedHerring relevant meta.
19
Q: A code review without the code

SirPythonRecently, I wrote a review that discussed certain points in the OP's code, but did not contain any code in the review itself. Are answers like these discouraged?

 
@ARedHerring I've seen lousier answers getting more votes.
 
^^ that
 
@RubberDuck My review has plenty of code in it and it addresses each line in the OP's code, it just presents it in a different way.
So I've extracted the inline HTML he has and turned it into REAL HTML, for example
 
@ARedHerring you can only know if you try...
 
Alright. We'll see I guess. It's a long review already
 
12:21 PM
@ARedHerring concerning long reviews...
2
A: The Router - dispatch after parseURL

mseancoleLarge wall of text incoming. Go to the bathroom, grab a drink, etc... Try/Catch The first thing I would refactor is your try/catch statement. Its just way too large, though that may just be the internal comments (which I'll get to next). Try blocks should really only encompass those statement...

 
@ARedHerring We don't have a rule against long reviews.
 
@Vogel612 it is longer than this, I think
 
@Vogel612 That one could have been written more concise and still be equally valuable.
 
@Mast true, but it's still underloved.
 
.The reason m yreview is so long atm is I'm doing some handholding for OP given that he's ne wto JS
I butchered that spelling...
 
12:23 PM
It has filler which distracts from the actual content.
But yea, it's worth more than just 2 upvotes. Gave it another.
 
@Mast meh. that's not how voting should work..
Posts are not worth X votes.
2
They are worth an upvote, downvote or meh
don't judge posts based on their score
 
Hey, you're the one stating it's underloved. I agreed.
 
beaten by my own words..
 
0
Q: Bank account program in Python 2.7

DaynisdotI'm learning python and I have written a bank program incorporating all the skills I've gathered so far. Using the program, one can create user profiles (name, password, account balance) which will be stored in three different text files. One can then do the normal bank transactions: deposit, wit...

 
dammit I'm not going to write beginner reviews anymore
there's so much wrong I don't even know where to start...
 
12:31 PM
..... I've been avoiding those lately too.
The more I answer, the more I find that I can write novels about 10 lines of code.
 
Doesn't it feel nice to rant sometimes though?
 
that's not even the problem. It's just that it feels so useless, because it's always the same 5 mistakes over and over and over
 
@Quill As long as the ranting happens in chat, not in answers.
 
There's nothing wrong with a constructive rant
 
I feel like a CD with a scratch on it, jmping back over and over
 
12:34 PM
Lots of people listen to the same CD
I wouldn't call that a scratch
 
0
Q: C++ Ascii Value Converter

WallermadevThis is my first question on codereview although i'm pretty active on the askubuntu stack exchange. I have written a VERY simple convert that converts a string to a character array and then displays the ascii value of each character this is my first time using c++ i usually write java/scala. Co...

 
@Quill rant != constructive, usually
 
@Vogel612 that's a pretty good sign that it's time to take a break from answering.
Or, at least maybe find a new tag for a bit.
 
...and start posting questions :D
Monking!
 
@Mat'sMug I'm working on the questions part.
 
12:36 PM
@Mast constructive-or-not is an attribute of rant, not a value
@CaptainObvious just closed
 
No, it's an attribute of critique
 
I just need to find the motivation to setup stuff for the javascript thing I want to write..
 
rant (rănt)►

v.
To speak or write in an angry or violent manner; rave.
 
[gold-badge:reversal] earn +20 on a massively downvoted meta-rant
 
@Mat'sMug that. Precisely that.
 
12:39 PM
learn a new language, they say
motivation, where did you vanish to?
 
Whats the tag for denoting a language in a code section?
 
I'm wasting so much time on the GUI of my D flat project that there's almost no actual code yet...
 
@ARedHerring that's a html-comment
 
@Vogel612 That's what I mean
But what is it D;
 
12:40 PM
Dang it... [tag:sometag]
 
content: language: lang-sth
 
Oh! That ^
 
@RubberDuck No, it's more something like <-- ! language: xyz --->
 
thanks
 
What vogel said.
 
12:40 PM
you can also place language-all, to apply it for all blocks.
 
11
Q: Check list for formatting questions and answers

JaDoggI have seen that moderators work hard to format questions and answers. Is there a check list they use (specially for CR), so others can also contribute by editing or properly formatting their own questions or answers?

Keep it simple ya stupid duck.
 
@Mat'sMug or nhgrif's php comment rant ;-)
 
Okay. I don't want to flood the front page too much. Will work on it some more later.
60 candidates left.
 
@CaptainObvious Put a basic answer on it, feel free to write a bigger one.
@Quill That wasn't a rant, really.
 
@RubberDuck 56
 
12:48 PM
@Mast the answer was though... lol
 
0
A: Passing JSON object through loop to be used in jQuery Dialog

A Red HerringWelcome to CodeReview. The key problem I have with your code right now is that it doesn't separate data from presentation. This is a maintainability issue because it means now your data is inexplicably tied to your view, and you cannot change one without altering the other. How can we fix this? ...

phew
 
@Mat'sMug Ah well, I think he really behaved himself while writing it.
 
insta-edited, eh?
 
lol the instant edit @quill :P
 
I've been learning from Jamal :P
 
12:56 PM
Question @Mat'sMug ... is this a new official thing?
12
Q: Let's take a look back at our site policies (2015 Edition)

ʞɹɐzǝɹAs moderator election are coming to an end, I would like to invite members of the community to take some time to review all the policies we've made in the past and see if they are still relevant, but need revision, and see which need be deprecated or better clarification. This is intent to take ...

 
@CaptainObvious oh boy, I already have half a normal review from the first function
 
yea.. one cannot possibly address all of the points in a question
or rather one cannot do that in less than 2 hours of writing time...
because you have to do handholding...
 
I don't think it's the handholding, in terms of explaining how an array works or something
just so much stuff to comment on
 
When you're wondering why your answer doesn't receive upvotes and you notice OP doesn't have enough rep to vote yet.
@Vogel612 If you stick to a specific tag, you'll learn to write template answers.
 
I really dislike those, each question is a unique grain of sand, that sometimes turns out to be a pearl
2
 
1:10 PM
@Mast cough Python
@Vogel612 most of the time you reach through the sand and your hand hits dog shit
 
oohhh damn that's very interesting
@Quill meh. it's not that bad for java...
more so in php, but there the questions aren't grains of sand anyways.
 
PHP is dog shit not great anyway
 
@Vogel612 You just stated beginners all make the same mistakes.
Sure, you need to polish the answer, but generically they fit.
I put stop using namespace std; in pretty much all of them and fits every time.
 
Yeah, generally all beginner Python questions don't fit PEP8, which needs to be commented on. but most need individual points beyond the standard template
 
@Mast I don't know enough C++, but why? From when I HAVE used C++ I've used that directive
 
1:13 PM
there is no such thing as the generic using namespace std; in tags where I answer.
 
868
Q: Why is "using namespace std;" considered bad practice?

akbiggsI've been told by others on numerous occasions that my teacher was wrong in saying that we should use using namespace std; in our programs. Hence, we should use std::cout and std::cin and these are more proper. However, they did not even make it clear ever why this is a bad practice. Why is usin...

 
@ARedHerring run while you still can
 
It's often used for beginner books, but it's bad.
 
@Mast thanks, I figured it would be due to something like that when you mentioned it.
 
1:14 PM
@ARedHerring nonsense. You obviously need jQuery.
Writing a Winforms desktop app?
jQuery
 
lol
I'd like to get into writing apps with cef
(chromium embedded framework)
 
Writing an MVC website?
jQuery.
 
MVC website in jQuery? Do it hardcore and use ASM instead.
 
Writing a foobarred fabulatore for your whatsit?
jQuery
 
No clue how you'd do web stuff in ASM, but hey, it's a challenge.
Afraid your competition will run with the code? Do it in Brainfuck!
 
1:15 PM
@RubberDuck I actually wrote a review this morning with someone doing exactly that
 
No obfuscation necessary.
 
@Mast unfortunately you wouldn't be able to write it in ASM or Brainfuck, because your browser interprets the javascript
unless, of course, you write a compiler from ASM/Brainfuck -> JavaScript.
:^)
 
There is asm.js though...
 
Count SiteName
----- --------------------------------
475   StackOverflow
79    StackExchange.Codereview
6     StackExchange.Meta
6     StackExchange.Programmers
5     StackExchange.Math
4     StackExchange.Codegolf
3     StackOverflow.Br
3     SuperUser
3     StackExchange.Ubuntu
3     StackExchange.Gaming
2     StackExchange.Diy
2     ServerFault
2     StackExchange.Music
2     StackExchange.Scifi
2     StackExchange.Stats
2     StackExchange.Unix
2     StackExchange.Workplace
2     StackExchange.Worldbuilding
 
hi
 
1:16 PM
hmm..that's a little long..
 
@Vogel612 what's that?
 
@Vogel612 What's it counting?
 
the "Home Site" of election voters
or rather the election voters for our first election by the site they have the most rep on
Hiya @Caridorc
 
monking @Caridorc
 
gets.chomp.chars.each {|char| print "The ASCII value of #{char} is #{char.ord}\n"} == codereview.stackexchange.com/questions/103866/…
@ARedHerring @Vogel612 hello
 
1:18 PM
@Conrad I am incorrect, never mind. :-)
 
Sometimes I wonder what C++ does with all those lines...
 
@Caridorc loose levels of abstraction
 
@Caridorc It doesn't need much, but if you write an interface for everything yea, you need some lines.
 
@Vogel612 well C++ is also much faster than Ruby
 
The trick is to put everything in a library.
So your end code will not be that big.
 
1:19 PM
@Caridorc true, but also remember that developer time is far more expensive than CPU cycles these days. :-)
5
and you can hardly put a price on developer happiness/enjoyment
 
@ARedHerring and Ruby does make me happy.
Even if I do write terribly un-idiomatic Ruby.
 
same. I enjoy writing in JavaScript and Ruby/other associated dynamic languages.
 
@ARedHerring a PC can make 10**9 operations per second. I can waste some no problem
3
 
@ARedHerring I'm happy with C++ ^^
 
@Mast use it if you want - it's about getting the job done
 
1:21 PM
But if I want something quick'n'dirty, I go Python
 
Haskell was my way of doing things quick&dirty for quite some time...
 
part of the skill in being a programmer is knowing when to use what tool for what job - if you don't need bare-metal speed and you can write something in less LOC/faster in another language - or you enjoy it more - then do it
we're way past the days now where we have to worry about individual cpu cycles. except maybe in embedded/performance critical software like nuclear systems/energy grids
 
@Conrad i think Haskell is cool but the error messages are very hard to understand
@ARedHerring nuclear software should be written in the highest level possible to avoid bugs.
 
@Caridorc It gets a lot easier if you studied some category theory. :D
 
@Conrad well, I will have to wait until I go to University to study that
Infinite lists are cool: Prelude> let ones = 1 : ones
Prelude> take 10 ones
[1,1,1,1,1,1,1,1,1,1]
 
1:27 PM
Not necessarily. I can recommend a introductory good paper, if you want. Category theory is really abstract, but not hard to grasp when you're a little interested in maths.
 
So, here's a good question. Does C++ still have a place in rendering 3D graphics? Or has managed code caught up performance wise?
 
Yeah. You could even define a list of all primes in just one code line. It's utterly unperformant though.
 
@Conrad which paper? I am interested
 
Wait a moment.
 
@rolfl we're done flooding the front page for now anyway. Dying in laughter here though. =;)-
 
1:30 PM
off-topic: I have to share this..
 
@RubberDuck Pleased I could entertain..... but, I just removed 35 or so "questions" from the problem too ;-)
 
It's more of a complete introductory book than a paper.
 
@Conrad I am reading the start of it
`Categories originally arose in mathematics out of the need of a formalism to
describe the passage from one type of mathematical structure to another. A
category in this way represents a kind of mathematics, and may be described
as
category as mathematical workspace` for example I have numbers, than I want matrices so I make a category to map from numbers to matrices ?
 
@rolfl lol. Thanks. Duckbrained moment.
 
1:41 PM
@Caridorc Well, you obviously could try to define such a category. However, I don't think it bears any greater usefulness.
 
@Conrad is a category a one-to-one mapping from one kind of mathematical objects to another?
 
@Conrad You don't happen to have the cliff's notes version of that, do you?
 
0
A: Bank accounts - names, balances and passwords

QuillA few things to point out: ############################################################################# #This is the function that is called at the beginning of the program Please do not do this. Ever. You don't need to wrap your initial code in a big, literal box. A simple comment, or ...

 
0
A: ASCII value converter

MastComments Code should be self commenting. Your comments are superfluous. //Declare Variables. string input; int size; Namespaces using namespace std; is considered bad practice. Short code is not a requirement in C++, clear code is preferred. Return return 0; is a legacy from C. In C++, it'...

 
I'll try to give you an introductory example for programmers, but it will take some time. Suppose you want to write a function to sum lists of integers. Let's call this function sum. You did your best and the result is quite a nice function. Now some days later you want another function prod to multiply the same list of integers. And like a month later you write a function concat to concatenate lists of strings.
 
1:50 PM
sum [] = 0; sum (x:xs) = x + sum xs
 
Now all your functions work nicely, however programmers always try to be DRY and reduce the amount of code. Can we find a common pattern amongst those functions? The first apparent thing is, that they all operate on lists. The input is a list with elements of some type, let us call it T. The output is a somewhat concatenated or reduced result, but it is still of type T.
 
general :: [a] -> a
Like this?
 
I see you find the idea. ^^
 
@Caridorc What's that, Haskell?
 
But can we find a general function to do this? You will find, that it highly depends on the type T we have!
 
1:52 PM
@mast Yes, the sum function is an actual defintion.
 
@Conrad In this case we could for the first two, because they all have integers, right?
 
For example, we could not reduce a list of persons and get a concatenated person. (Human centipede)
Now the category theory comes into play. All of our types T are lists. So let's specialize it a little and call it [A] where A is a type that in our example is either the integers or strings.
We can use our "general" function with integers, with strings, but not with persons of course.
 
@Caridorc That looks like something functional
 
I need to just save this markdown to a text file....
Don't do this. Just... *don't*. You're taking values from a table and injecting them into a query as a plain string. I'm reminded of this.

![xkcd - Exploits of a Mom][xkcd]

[xkcd]: imgs.xkcd.com/comics/exploits_of_a_mom.png "Her daughter is named Help I'm trapped in a driver's license factory."

[Courtesy xkcd.com](xkcd.com/license.html)
 
@skiwi Haskell is purely functional, so yes
looping is not permitted, only recursion
 
1:56 PM
I just wonder how Haskell holds up to performance
 
So what do integers and strings have in common? In the perspective of category theory they support a mathematical structure called a monoid. You can read about what this exactly is, but for our example it has two nice properties.
 
@Conrad In pseudocode general :: String [a] || Int [a] -> String a || Int a
@skiwi 1x -> 5x the speed of C but really depends on how good you are at optimizing
 
@Caridorc I'd imagine that the compiler needs to do the optimizing and not the programmer, but I'm not a functional programmer
Well, scratch that, I am a functional programmer, but I don't do functional programming
 
Thanks for the comment, @SirPython
 
1.) We can "combine" two elements of type A with an operation, let's call it "op", and get a third element which is again of type A.
2.) We have a so called neutral element, let's call it "n". For integer addition this is 0, for multiplication it is 1 and for strings it is the empty string. The neutral element has the property that x op n = x for all x.
 

« first day (854 days earlier)      last day (3155 days later) »