« first day (1137 days earlier)      last day (2880 days later) » 

12:00 AM
RELOAD! There are 2439 unanswered questions (93.0219% answered)
 
12:13 AM
0
Q: Longest lines using priority queue

EdwardInspired by a comment on this question, I thought I'd exercise my C skills by implementing something like it using a priority queue. The idea is to be able to invoke the program like this: ./longline 10 < /usr/share/dict/linux.words And get it to print the 10 longest lines in the linux.wor...

 
12:41 AM
0
Q: CodeWars "Dbftbs Djqifs" kata code

zthomas.ncI have been working on the following kata from CodeWars. It's basically a modification script for encryption -- see the test cases below my solution code. Any comments/feedback appreciated! def encryptor(key, message): new = "" for letter in message: if letter.isalpha(): ...

 
12:53 AM
0
Q: Constant time equals

maaartinusThis is my attempt to answer my own equally named question on SO. In this case, I need a method comparing two strings so that the running time is input independent. // Not private in order to prevent optimizations. static class Blackhole { private static void eat(long n) { dummy += n...

 
1:15 AM
possible answer invalidation by Yongus on question by Yongus: codereview.stackexchange.com/posts/131844/revisions
 
2:08 AM
0
Q: Conway's Game of Life Java Implementation

Neelesh SalianKeep state same if the doesn't fall in following conditions: Change to 2 if there are exactly 2 ones in the neighbors Change to 3 if there are more than 2 ones in the neighbors Also it is wrapping around so neighbors can be cyclic Wrote a basic structure and modularized it to individual func...

0
Q: How to refactor this map function to be cleaner and more readable?

Leon Gaban First here is my settings object below. insight, spike and momentum are binded to 3 checkboxes in the markup. The objective here is to prevent the user from deselecting all choices, 1 choice must remain selected. var settings = { user_id : 0, insight : true, s...

 
 
1 hour later…
3:28 AM
0
Q: Queue Using Stack java implementation

Neelesh SalianImplemented this solution for the problem. Feedback and review if this can be improved in an way. Appreciate your help. public class queueUsingStack { static Stack<Integer> s1 = new Stack(); static Stack<Integer> s2 = new Stack(); public static void enqueue(int element){ s1.push(element); ...

 
4:03 AM
0
Q: AudioController class for managing audio in Unity games

Isaiah MannI'm looking for a critique of this audio management system I wrote for Unity games. It references a JSON file to trigger the clips by events. The main AudioController.cs class is pasted below. The full codebase can be found here: https://github.com/GlowLimeGames/audio-system-unity /* * Authors)...

 
4:20 AM
possible answer invalidation by Neelesh Salian on question by Neelesh Salian: codereview.stackexchange.com/posts/131922/revisions
 
4:43 AM
Monking
@Duga its ok
Wow ! It seems it had been really quiet here for almost 7 hours !
 
5:11 AM
Do you have a specific issue, or are you looking for a code review instead? — IInspectable just now
 
0
Q: What is doing every part of this React components?

NietzscheProgrammerI am trying to understand how the props and states comes and goes. I am commenting the pieces of code that I understand, but there are some others that I can't because I didn't get what is happening. This is the code: https://jsbin.com/mazubenaxa/1/edit?js,output Or here you might see the code...

 
5:44 AM
0
Q: Condition class

Dmitry NoginHere is my own predicate class; it is equipped with some operators. Demo: using static BusinessObjects; using static Console; class Program { static void Main(string[] args) { WriteLine(Sell("John Doe", "test@example.com", 10000)); WriteLine(Sell("John Doe", "test@exampl...

 
5:57 AM
0
Q: Advantage of make QShortcut pointer as class variable

TechEnthusiastI have following code. Header file is myView.moc.h and c++ file myView.cc // header file myView.moc.h #ifndef MYVIEW_H #define MYVIEW_H include <QTextEdit> class QContextMenuEvent; class QShortcut; class myView : public QTextEdit { Q_OBJECT protected: virtual void contextM...

 
6:16 AM
@N3buchadnezzar lol
Which reminds me
Only 6 months until Winterbash
 
6:56 AM
oh.. oh no
So it turns out when we are recording dates, this happens:
  var start = kendo.parseDate($scope.DataItem.Start, $scope.ShareSvc.UserPreferences.DateFormat + " HH:mm:ss");
  var utcStart = Date.UTC(start.getFullYear(), start.getMonth(), start.getDate(), start.getHours(), start.getMinutes());
Which converts the date object to UTC, but does not actually convert the time to UTC.. so if you enter 12pm in GMT+1, you send to the server 12pm in UTC
aka instead of sending 2016-06-14T12:00:00+1 you send 2016-06-14T12:00:00Z
we haven't noticed this because the calendar is only displaying dates in UTC without converting them to a timezone... which means that all of the countres in differing timezones have incorrect data
That's a colossal screw-up if I've ever seen one
 
7:24 AM
0
Q: Project Euler - Non-Abundant Sums

Mayur KulkarniI'm new to Python! Kindly suggest me improvements! Problem statement : A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which means that 28 is a perfect n...

 
What the hell man, how do you even consider this an answer ? The idea is to help and learn here, not hire people for free code review. — Zil 34 secs ago
 
7:55 AM
possible answer invalidation by Neelesh Salian on question by Neelesh Salian: codereview.stackexchange.com/posts/131922/revisions
 
Naruto answer; accepted non-selfie answer with 0 score: Buffered asynchronous writer
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Inserting a role using PDO
 
@Duga rollback & Comment applied
 
$ git bisect is so good
second time in as many times i've tracked down a critical bug, where it was introduced
monking @Phrancis
 
hey
 
8:10 AM
Monking all
 
@JeroenVannevel That's close enough, not sure if you got an answer already
Been AFK a bit
Found out my "new" iPhone 4 wasn't sending push notifications from SE app
 
0
Q: Converting embedded JSON into flat table

An economistI am new Python user, who decided to use Python to create simple application that allows for converting json files into flat table and saving the output in cvs format. I was wondering if you could give me some advice how I could improve my code to make it work in more efficient way. I am asking s...

 
8:29 AM
good news, it wasn't me who made the bug. thankfully.
 
This belongs in code review. Your code doesn't seem to have any problems, your simply asking if it's the best approach. — InBetween 30 secs ago
I'm voting to close this question as off-topic because the OP is asking for a code review. The code works, there is no specific problem to solve. — InBetween 50 secs ago
My apologies, I wasn't aware there was a code review section. — Eritey 25 secs ago
 
@Phrancis well what translation would be perfect rather than close enough?
oh wait
I noticed last night that translation rate of 97% was achieved
it's fine
I can deploy already
 
-1
Q: SaveChanges in Entity Framework, where all columns are excluded

JI_77I want to to run a trigger on the db. This trigger looks in the 'inserted' table for rows to further manipulate. My question: If I'm using Entity Framework and have excluded ALL columns, marked an entity as modified and then call SaveChanges(), will I still end up with a row for that entity (ass...

 
@JeroenVannevel I think it's good roll with it
 
Is it professional to send a complaint to a 3rd party you previously worked with (in a professional capacity) regarding the code they sold to you..?
The number of insidious, glaring issues I've had to fix that have been caused by them is getting extremely high
 
8:37 AM
@JeroenVannevel I tried to think of a better one but couldn't
 
@DanPantry Doesn't seem unprofessional to me.
Code quality is a professional matter, isn't it?
 
The bit that makes it "iffy" is that it is a company I worked with that my employer subcontracted out to
It feels like it might be unprofessional to do so
 
@DanPantry Ask your boss to make the call to complaint or not, maybe?
 
@Phrancis He knows how I feel about them. I don't know whetherh e would complain
 
Right, just ask him
 
8:40 AM
I'd say it would be unprofessional if they took issue with the complaints.
You shouldn't bypass your boss obviously.
 
He may have some reservations, just dealing with outside companies is pretty difficult sometimes, but I Am Not A Lawyer
For the record, I also hate that acronym
2
@Zak hey there, saw your SQL question, just haven't been around much to answer it
 
Zak
@Phrancis That's cool, I'm not in a hurry on my SQL stuff (yet)
 
I'm voting to close this question as off-topic because this question belongs on Code Review — Anders Tornblad 27 secs ago
 
Actually kind of surprised a TSQL question goes over 24 hours with no answer
I suppose monkey's not been around that much
 
Zak
Give it a couple of weeks, and I might start on moving our business records from Excel to SQL Server.
Then you'll be hearing a lot more from me ^^
 
8:49 AM
At a glance I see a few things
I'll write up an answer soon, but do yourself a favor and start using CTEs
 
hey
 
Zak
@Phrancis What's a CTE?
 
Quick Q. Say I have a collection of items gradually getting added into a list. Is it faster to start with a set, or convert the list into a set at the end of the code?
 
@Zak Common Table Expression
with ( select Foo from Bar ) as Baz, select * from Baz
It makes it so you don't have to use PITA subqueries
 
Zak
8:54 AM
@Phrancis That is soooo useful
 
Sorry for the pseudocode
Working on an answer
 
boss has agreed to let me send a complaint to them :)
 
@Zak it's that join (select ... ) thing, that's very MySQL-ish
 
@Phrancis That looks cool and would save a lot of time instead of creating temp tables
 
@DanPantry Temp tables are very different, CTEs are syntactic sugar, temp tables are not
Temp tables have indexes, stats, etc.
(temp tables are (often) very fast, too, with a bit of I/O)
 
8:58 AM
sure but in a lot of cases we're using temp tables as staging tables instead of actually using them for any performance reason
 
possible answer invalidation by Julian Liebl on question by Julian Liebl: codereview.stackexchange.com/posts/112068/revisions
 
Yup, that's part of what temp tables are good for. CTEs usually don't have good performance, since they are just syntactic sugar
Query optimizer does its best with them
 
Zak
@Phrancis Well, like they say, I'll worry about performance if/when it becomes a problem. Until then, load up the sugar ^^
 
But they are really just subqueries with better syntax
 
@Duga its ok
 
9:05 AM
@Heslacher Does replying to the bot actually do anything?
 
@overactor No
 
@overactor just telling the others that one looked at it
 
TIL about git notes: git-scm.com/docs/git-notes
 
That makes sense
 
@Phrancis translation team turned it into Les ventes s'envolent !
thoughts?
I quite like it
Less formal
 
9:10 AM
possible answer invalidation by Toadfish on question by Toadfish: codereview.stackexchange.com/posts/131838/revisions
 
Zak
@overactor Well, it increments @Duga's ping counter.
 
@Duga just adds an examlpe
 
Do you get a pingo if you hit a multiple of 1000?
 
Zak
@overactor Maybe a pingu
 
@JeroenVannevel May be a difference between France and Canada, I've never heard that one before
Except maybe on cheesy TV commercials
 
9:14 AM
@Phrancis TIL you're canadian and speak french?
 
@DanPantry Yeah I'm from Quebec, we do both
 
Sales are flying makes sense to me
 
codereview.stackexchange.com/ - in my opinion this is the more appropriate site for such questions. — Gluttton 26 secs ago
 
In Dutch you can say "Ze vliegen de deur uit" which means "They're flying out the door" -> being sold very quickly
 
possible answer invalidation by Kasun Randika on question by Kasun Randika: codereview.stackexchange.com/posts/131840/revisions
 
9:15 AM
@Duga I mean, I think you're right. But I don't know.
 
@JeroenVannevel It's alright, I suppose, just not very common where I'm from
 
@Duga No. bad.
Can someone rollback please because I'm knee deep in code
Sounds like you need some coffee @Phrancis... :P
 
Yo @DanPantry
 
I need some sleep
 
How do I combine these so it doesn't do the dom query twice?
var sellOutSoonGrowler = $('#TSectionOrClassLikelyToSellOutSoon');

sellOutSoonGrowler.delay(2000).fadeIn('slow');
$('div#TSectionOrClassLikelyToSellOutSoon .i-remove').click(function () {
$('#TSectionOrClassLikelyToSellOutSoon').hide();
});
I mean in the $('div#TSectionOrClassLikelyToSellOutSoon .i-remove') part
or can't I do that?
 
9:18 AM
var sellOutSoonGrowler = $('#TSectionOrClassLikelyToSellOutSoon');

sellOutSoonGrowler.delay(2000).fadeIn('slow');
sellOutSoonGrowler.child('.i-remove').click(function () {
  sellOutSoonGrowler.hide();
});
I think
You won't be able to avoid two queries to the DOM but you could limit it
not sure if child is a method in jQuery, otherwise it'll be children()[0]
 
-1
Q: Is this an incorrect use of interfaces?

EriteyTake the following example, I have multiple 'Integration' classes that inherit from the same 'IChannelIntegration' interface. public interface IChannelIntegration { } public class IntegrationA : IChannelIntegration { } public class IntegrationB : IChannelIntegration { } public IChannelInte...

 
@DanPantry handled
 
Zak
@DanPantry Damnit @DanPantry don't show me NSFW stuff I really want to watch while I'm at the office.
 
(NSFW language)
 
9:26 AM
@DanPantry I honestly cannot believe they are still making those Epic Rap Battles videos
 
Gah, I'm so nervous for my culture interview tomorrow
 
What's a culture interview?
 
it's where you have an interview to determine whether or not you would "fit" in the culture of the interviewing company
 
Strange, never had one of those... must be a Europe thing
 
Actually the company is american
 
9:38 AM
Still I find it strange
 
Same, it'll be a first for me, too
it's a video interview
good thing I dyed my hair dark blue yesterday, huh lol
 
Go get 'em
Probably nothing to be nervous about, may just be something HR has to do
Protocol and whatnot
 
@DanPantry does that fit the company culture?
 
@overactor I hope so... l.ol
I mean, the main interviewer seemed fine with how I looked - blue hair, lip piercing, etc
 
It's probably not a big hurdle in IT, is it?
 
9:46 AM
No, not really
 
Zak
@overactor Any (non-client-facing) IT department that cares about how its' developers looks is not somewhere with a bright future.
 
in my experience companies that care about how you look in IT is a short-lived company
i mean some of the best IT developers work in t-shirt and jeans. so
 
I really like that about our field of work.
 
I got a tongue piercing when I was 16. So I was always dooomed from the start if that was the case
 
I don't get why any non-client-facing employee should have to wear any sort of attire as long as it's not obviously offensive.
aww, I just get 10 rep and got all excited because I thought my Haskell answer on here got upvoted
turned out it was just SO :(
 
9:53 AM
@DanPantry great works
 
@overactor I'm not sure that this remark was justified:
> You seem to be diving into the deep end of Haskell, without learning about the language first.
0
A: I can has(kell) moar cheezburgers?

overactorYou can get rid of the lets and even the binding of getLine to input in main. First, let's identify what exactly you're doing to the input before printing it. First you call strToUpper on it and then pass the result to stringMapReplace lolcatDictionary, using function composition, we can easily ...

 
+1 @200_success
> I'd suggest you pick up a book about Haskell first and see how things are done in it and why they are done that way before writing too much code that deals with IO.
 
It seems a bit harsh, when obviously the author posted here to learn.
 
People learn in different ways. I can't learn by reading a book. I have to write.
4
 
It wasn't even bad code. It's not Haskell-golfed, that's all.
 
10:05 AM
@200_success It was meant as a friendly suggestion
well
a constructive one
If it didn't come accross as such that's my mistake of course
 
0
Q: Naive parallel Sieve of Eratosthenes in Java

rdllopesProblem. My naive version now is too slow. I think setting/accessing concurrent atomic bit is way slower comparing to access/modify an array of boolean. Second, the parallel execution only happen on the beginning of the process. For bigger numbers, thread-pool is not really active. public class...

 
In order to leave remarks like that that are "friendly" you have to structure your entire review around being a "friend" to OP, rather than just giving neutral feedback
IOW, you can't leave a load of points about why his code isn't working X Y Z without trying to engage with him further before leaving that note
I'm sure that could appear friendly, but the tone of your answer does not reflect that. Your answer is very matter-of-fact, which is fine, but you can't leave remarks that have to be read in a jovial tone in that case.
Thats my 2p anyway
 
Zak
Whoever said diving in at the deep end is a bad idea it worked fine for me after all
There's a very important caveat
 
@DanPantry Thanks for the feedback.
 
Zak
Diving in at the deep end is *fine* so long as you have some kind of framework to link it to.
 
10:09 AM
And as long as you can admit when you're in over your head
 
I didn't realise my answer came across like that.
I'll read it over again.
 
Zak
If you dive in so far that you can't see shore and have no idea how you'd get back, then you're just fumbling around in the dark and not *really* learning in a way that is useful.
 
Oh hi! We totally weren't talking about you.
 
I'm a Haskell noob myself, so I might be wrong.
but it seems to me that Haskell's depth is quite vast and difficult to get around.
 
A lot of languages have a lot of breadth and depth to them
 
10:12 AM
I always dive in the deep end, but it's not always a good idea. I usually get stuff to work though.
 
Haskell isn't fundamentally different there, it just looks different so you have to start from scratch
 
Also, monking all.
 
Maybe I'm just projecting my opinion onto other though.
Hi @Mast
 
Zak
I made that mistake with VBA. Started out just "trying to get stuff to work" without having the first clue about programming. About a week in, I bought a textbook, read the whole thing iand *then* I had a basic framework to build off of.
 
@DanPantry Looking different is the least of it
Hey @MichaelBrandonMorris
 
10:13 AM
Hello
 
It's been brought to my attention that the remark at the end of my answer comes off as mean.
 
Were y'all talking about me? :P
 
@200_success If there is a comment thread that I think has reached the end of it's usefulness do I flag it? If so just one comment or all of them? (I'm not used to this flagging business)
 
About my answer on your question
 
I'll admit, I've never managed to do anything practical with Haskell. Largely because I/O is a hassle.
 
10:14 AM
Writing reviews takes some getting used to. Be matter-of-fact, not too opinionated. Harsh is not a problem as long as it's irrefutable.
 
@JoeWallis Either way, we'll figure it out.
 
@overactor I really liked your answer. Probably the most comprehensive and well-explained I've seen.
 
@200_success Sure thing, thanks, :)
 
If it requires surgical deletion of multiple comments, then it would be helpful to flag just the ones you think should be deleted.
 
I just wanted to make clear that I don't mean to dismiss the effort you've put into your code and learning Haskell or criticize the way you're learning it.
 
10:16 AM
@overactor Of course. I'm not easily offended. I "learned" Haskell solely for making these "joke" questions anyway.
 
And if you feel like diving in the deep end is the right way for you, or if I am wrong about thinking that that's what you're doing, feel free to ignore that part.
@MichaelBrandonMorris Cool, glad I could help you
@MichaelBrandonMorris I was glad to see a lowball question honestly, Haskell is very new to me too and it was cool to be able to write up an answer.
 
@200_success It's just as there is two 'discussions' going on at the same time. I left my comment to make it more understandable, and don't know if you can see deleted ones. IMO the entire tuple thread can go as it's in the answer now.
 
@MichaelBrandonMorris I must say, it is a good pun
 
@JoeWallis Which thread are you talking about?
 
@200_success does it not get any better?
 
10:20 AM
@200_success This one Ok it's gone
 
@overactor Ha, thanks. I'm trying to think of another good one.
 
What are your resources for learning Haskell at the moment anyway?
 
@JoeWallis I saw no flags because janos already handled them!
 
@overactor StackOverflow :P
 
@200_success I'll agree I/O is a hassle in any language I've tried so far
 
10:23 AM
@200_success That was fast. :O I didn't know he was on. Thank you for your time!
 
@Phrancis You should try Haskell next. =)
 
@Phrancis What sort of languages have you tried I/O in?
 
@200_success Sounds a bit painful
 
@200_success I hated do notation when I first saw it
 
@overactor Java, Python, Clojure, maybe a few others
 
10:25 AM
after seeing what it actually is, it makes a lot more sense
still a pain though
 
I/O in Python is reasonably pleasant.
 
How is it in Clojure?
 
IO in CPP isn't bad IMO. Java is a bunch of boilerplate (as always).
 
@overactor It's basically Lisp
 
I've never used Clojure or any Lisp-like language
 
10:26 AM
Just a lot of parentheses
It's cool if you like FP, but otherwise probably gonna be a PITA
 
0
Q: Iterate through a 2D array. Kotlin extension method

James BSimple extension method for Kotlin. Should perform an action on every element in a 2d array. i.e. An array of arrays. I have made the assumption that because the receiver type is defined as an array of arrays of type T, that I do not need to do any checks or casts. fun <T> Array<Array<T>>.forEa...

 
Is Clojure pure?
 
@overactor define "pure"?
 
are there mutable data structures?
can functions have side effects?
 
It's all immutable
No side effects unless you make it
But, bear in mind, Clojure is basically Java, or at least compiles to Java
 
10:29 AM
Aha, apparently, it's mostly pure, but you can interact with Java
 
^ that
It uses JVM
 
Ho is I/O solved in Clojure?
 
Define "solved"?
As far as I know, I/O is working OK, but haven't used it that much
 
> Clojure is a functional programming language. It provides the tools to avoid mutable state, provides functions as first-class objects, and emphasizes recursive iteration instead of side-effect based looping. Clojure is impure, in that it doesn’t force your program to be referentially transparent, and doesn’t strive for 'provable' programs.
So println looks just like any other function.
 
@200_success good one, thanks
 
10:34 AM
@Phrancis in Haskell, you have this concept of IO actions
and functions, rather than doing IO stuff, return an IO Action, which only gets performed once it reaches the main function
 
Basically, in Haskell, everything is strongly typed. In particular, any function that does I/O will have a type signature where the type is "tainted" with IO.
 
@overactor Do files just sit there locked by a thread until it gets to main?
 
nah, unlocking files is also an IO action
you can also glue IO actions together into one big IO action
 
0
Q: My first python3 project (autobahn, asyncio, aiohttp)

user1249530This project is intended to be a platform for bot contests within simple 2d game environment such as loderunner, tanks, bomberman etc. Bot should connect to server's web socket, get current game board message, figure out it's action/move and send it though web socket back to server https://github...

 
@200_success sort of similar to Java's throws?
 
10:38 AM
@DanPantry Yeah, in a way
but there is no equivalent to catch
It has to propagate all the way to main
 
I guess I don't know that much about IO, I thought Java's throws was for throwing exceptions
 
@Phrancis it is, I'm using it as a comparison
in Java if you use throws you "taint" the method
and the method calling it has to also have a throws declaration
or try/catch
@overactor is saying that it's similar to this, but you can't try/catch. that method has to have a clear chain all the way to main
which, thinking about C# compared to Java, is actualyl a nice feature of Java. I hate getting so many runtime exceptions in C#
 
Well, you could discard the IO action I think
but then it never gets run
 
Thanks @DanPantry
 
@200_success can you discard an IO action?
 
10:41 AM
yea as far as I remember IO is just a "description" of an IO operation, it doesn't actually execute it
though if you were to do that, wouldn't that be making a side effect of your own..?
 
@DanPantry What would that side effect be?
 
@overactor well you would be executing a function and not using the return result
 
@DanPantry checked exceptions are a cool idea
 
generally speaking executing a function without using its result is a side effect in other languages
though I guess in Haskell if you can prove that that branch does nothing and you discard the result, then it isn't a sidef effect because you know it's pure so it gets optimised away
wow Haskell is powerful
 
@DanPantry in terms of functional purity, side effects mean that when calling a function, anything happens aside from returning a result
and the same result every time you call a function with the same arguments
 
10:44 AM
@overactor Yes, that's my point, if you were to execute a function but not use its result ,would that not be counted as a side effect unless the result you got was from a pure function?
 
@overactor Good question.
 
@Gluttton: I disagree - optimisation questions are perfectly on-topic here - codereview is more for working code that can be improved idiomatically or stylistically. — Paul R 10 secs ago
 
In haskell, there are only pure functions
 
because if the function is pure, and you don't use the result, haskell can just optimise it away. if it isn't pure, it's a side-effect.
 
Maybe purity is a thing that nobody really ever gets?
 
10:46 AM
So, any function of which the result gets discarded can be safely optimized away
 
Seem like every function, method, object, procedure, etc. I've ever seen always changes something
 
@Phrancis if you were in an OOP world that would definietly be the case.
 
@Phrancis what about Math.max() in Java?
 
React's components are pure
 
@overactor what about it?
 
10:48 AM
Well.. most of the time
@Phrancis Math.max() is a pure function
 
0
Q: Conway's game of life in C++ with SDL

MerionesThis is my attempt at a basic implementation of GOL. The user can add and remove cells with the mouse and some basic stats are printed to console. Any feedback is welcome, but I have a couple of specific questions: In Cell::get_neighbours() it seems a bit inefficient to keep constructing vecto...

0
Q: Validation extensions v2

t3chb0tI have still another version of my validation extensions. I've reworked it and added some new features. It doesn't relay on expression trees any more but as a compensation the same extensions can be used for unit testing. The base class is still the ValidationContext: public class ValidationC...

 
It doesn't change anything, does it?
 
It relies only on its inputs, returns an output, and does not cause any side effects
 
Fair enough
 
Stateless components in React are also functionally pure, which is why it's advisable to use as many of them as you can
Interestingly they are also good analogues for IO in Haskell because they are descriptions of a DOM render, rather than an actual one
 
10:49 AM
You can call it as often as you like, as long as you call it with the same arguments, it will return the same result
@DanPantry That does sound interesting
 
I still have a lot to learn
 
const MyComponent = ({ greeting }) => <h1>{greeting}</h1>

console.log(<MyComponent greeting="Hello, world!" />);
 
@Phrancis in a pure functional language, every function is like that, if you pass the same arguments to a function, you are guaranteed to get the same result back
 
{
  type: 'h1',
  props: {
    greeting: 'Hello, World!'
  }
}
 
@overactor I've seen some of that in Clojure, though I suppose it's not "pure" functional
 
10:51 AM
@Phrancis if you start looking into languages like Rust, JavaScript (the good stuff), Flowtype, and other similar languages youl'l start to pick up on it quickly
 
JavaScript is so interesting
 
@PaulR Non-specific optimization questions are on-topic on Code Review. However, there is a specific question in the title of this question, so I think it's a fine Stack Overflow question. — 200_success 52 secs ago
 
It's incredibly complex and deep
 
@DanPantry I get confused about JavaScript, there's too many of them
 
but looks so harmless on first, second, third, etc. glance
 
10:52 AM
(◞థ‿థ)ᴖ oh stop it you
@overactor it depends whose javascript you're reading
Angular code is very impure, closer to OOP than anything else
React is very functional, closer to FRP
JavaScript lets you use any paradigm you want
 
@DanPantry ಠ_ಠ
 
@DanPantry but at your own risk
 
@Phrancis ಠ‿ಠ
@overactor Well, sure, it's not exactly a well designed language, historically
 
Have a star
 
@Phrancis (ノ◕ヮ◕)ノ*
 
10:55 AM
@DanPantry it's understandable though, the web needed to be fault-tolerant
 
wat
 
@Phrancis I think I understand that reference
 
@overactor Initially, JavaScript was not designed to be very smart :) But yes, it has evolved to be highly backwards comaptible and fault tolerant.
Except ES6 :P
ES6 breaks a lot of things
 
@overactor yeah a web page crashing is way worse than, I dunno, a null reference/pointer exception
 
@Phrancis It's someone throwing a star :D
 
10:57 AM
Looks like Kirby
 
one thing I like about JS is that Babel (leading compiler) is so moddable you can create your own syntaxes
 
(ノ◕ヮ◕)ノ ︵★
 
Want to add a keyword that lets you denote an item that should be deeply immutable? sure, go for it
 
@DanPantry I didn't know that was possible
 
10:58 AM
@overactor I believe you can't discard an IO action in Haskell.
 
@overactor It only works with Babel, but if it's something like a type annotation you can just eliminate it at runtime.
 
@200_success that makes sense
 

« first day (1137 days earlier)      last day (2880 days later) »