1,152 reputation
311
bio website
location
age
visits member for 2 years
seen 4 hours ago

6h
comment What's the proper way of dealing with a global file path?
@Carcigenicate One thing you might want to consider is naming: if you're passing the path as an argument then you'd want to use changePath, but if you're not passing it as an argument and the changed version might make more sense as changedPath, making it more of a constant itself (assuming it didn't take any more arguments than the path).
6h
comment What's the proper way of dealing with a global file path?
@Carcigenicate Most of my programs grow, so I tend to make things parameterized, but if that's not the case for yours then a global constant should be fine -- this is just one of those design decisions that needs to be made. (You can always refactor later.)
7h
answered What's the proper way of dealing with a global file path?
7h
comment What's the proper way of dealing with a global file path?
@AndrewHoffman The question is whether or not to have a function depend on a variable as a global constant or to have it be passed in as a function argument.
Jun
19
awarded  Yearling
Jun
5
comment Object-Oriented equivalent of LISP's progn function?
@Giorgio Well said; when writing my comment about being able to have side-effects I was thinking mostly variable mutation or IO deep in the bowels of the code.
Jun
5
comment Object-Oriented equivalent of LISP's progn function?
@RobertHarvey Yes, side-effects is the main use I can see. I usually use progn (do in Clojure) to do side-effects like printing to the command line (which I hack in while debugging). You can have side-effects in Lisp since it is not a purely functional language -- some argue it's not functional at all, just conducive to a functional style; I like to consider it functional since that's the style I use when I program in it.
Jun
5
answered Object-Oriented equivalent of LISP's progn function?
Jun
4
comment Is there a theory for “transactional” sequences of failing and no-fail actions?
@Doval Yeah, that would work on the forward way, but I'm not sure if it would work on the rollback: if you did the writer as a monad transformer on top of the monad performing the sequence of operations, then when a failure branch was taken returning a rollback function (if that's how you implemented it) then that function would likely be run outside of the monad stack, so the rollbacks wouldn't be logged using the writer (unless you did so explicitly outside of the transform stack). I wonder if it would be possible to run the rollbacks still in the monad?
Jun
4
comment Is there a theory for “transactional” sequences of failing and no-fail actions?
@RossBencina Perhaps you could combine patches with some sort of monad return value? Here's a nice intro tutorial if you're not familiar. I'd think you could accumulate a rollback function during processing and return that in the failure case.
Jun
4
comment Is there a theory for “transactional” sequences of failing and no-fail actions?
It's probably not what you're looking for, but you might be interested in patch theory
Jun
3
comment POST and PUT requests – is it just the convention?
Did you mean POST/PUT not POST/POST?
May
20
comment Is it possible for business logic not to creep into the view?
You might look into template animation; while this probably won't eradicate all logic from the view layer, it looks like it should lead to a bit better separation of things.
May
16
comment What is the most efficient method in converting AutoLISP legacy code to C#?
On the (probably very) off chance that you're not already familiar with this capability of lisp, you can easily read and rewrite lisp code using lisp code. So if you're not planning on it already, you should probably consider writing your converter in some dialect of lisp, even though the output will be C#. If you were already aware of this, then disregard this comment :)
May
13
comment Should you throw an exception if a method's input values are out of range?
@jmoreno Yeah, that would definitely be an advantage of an exception or possibly even an error variable (w/ msg string) over a return value (unless you were using something like Haskell's Either type)
May
13
answered Should you throw an exception if a method's input values are out of range?
May
12
comment Helping someone who is not and never will be a professional programmer write code that is more legible and usable to use and interpret
@durron597 (following a wild hare sparked by one of the comments:) would you be able to write a(n E)DSL which would enable him to more concisely express his logic in a way that wouldn't require a rewrite on your part?
May
7
answered How to take things step by step
May
1
comment alternate approach of binary serialization/de-serialization
@JimmyHoffa I think you should change it to blittable, if I understand what you're saying correctly. (You're saying that the primitive types like int are contiguous, but objects aren't since they could point to other places, right?) As I understand "boxed" types, those are primitive types which have been wrapped in objects, which seems to be trending towards the opposite of what you're going for.
Apr
28
revised Aren't decorators easily breaking the ISP?
Removed extraneous "literally"