101 reputation
4
bio website panix.com/~shopsinm
location New York, NY
age
visits member for 3 years, 3 months
seen Dec 15 at 14:46

I'm a programmer at Condé Nast working in Java, JavaScript, and occasionally Shell. In past jobs I've practiced the black arts of Python, C, and C++. My spare time is dedicated to cooking, and upgrading an old Apple IIgs.


Sep
24
awarded  Autobiographer
Sep
15
comment Is it okay to use exceptions as tools to “catch” errors early?
Fail early is the way to go if there is no way to recover from an error or condition. For example if you need to copy a file and the source or destination path is empty then you should throw an exception right away.
Apr
29
comment Why do C arrays not keep track of their length?
The unterminated arrays also fits with the bare metal approach of C. Remember that the K&R C book is less than 300 pages with a language tutorial, reference and a list of the standard calls. My O'Reilly Regex book is nearly twice as long as K&R C.
Apr
16
comment How would another popular language avoid having to use the factory pattern while managing similar complexity as in Java/Java EE?
I use a lot of the static method factories when I need to choose a subclass based on context but the differences should be opaque to the caller. For example I have a series of image classes that all contain draw(OutputStream out) but generate slightly different html, the static method factory creates the right class for the situation and then the caller can just use the draw method.
Apr
8
comment Why do JavaScript frameworks/libraries have functions which already exist in pure JavaScript?
The functions are there to support old browsers and to support old code that calls the library and the programmer doesn't want to rewrite. Even if you've dropped support for IE 6 you probably still have some JavaScript in use written when you did need to support ancient copies of IE.
Feb
27
comment Able to read Code but struggling majorly to write it
Programming requires both coding and someone to help you when you get stuck. I would not have gotten very far as a programmer in high school or college without some friends and classmates to help me out many times. Find someone in your dorm or class to help you out.
Feb
24
comment What is the advantage of wrapping exceptions
Upper layers of the program probably just care if the data was retrieved, not why the retrieval failed. Overly specific exceptions force the higher levels of the program to duplicate error handling when the effect of the exception is more important than the reason.
Feb
24
comment When is code “legacy”?
IMHO Legacy code is a function of the programmers age, the younger programers tend to see more recent code as legacy than older programers. The tendency to discount older code is independent of how up to date the programmers skills are, an older programmer who does JavaScript programming will less likely to see C++/Fortran code as legacy than a younger programmer.
Feb
3
comment How to convince/prove my manager that a rewriting is needed rather than a refactoring
Big ball of mud code usually has dependencies in the data that only get exposed by refactoring. For a previous job I had to wrap a series of database calls in a function because it turned out that there were undocumented order dependencies in the database driver state. Commenting code as you refactor is very helpful since you need to remember all the gotcha's you found.
Feb
3
comment Efficient methods for storing tens of millions of objects for querying, with a high number of inserts per second?
Memcached can be split across machines to increase the amount of ram available. You could have a second server serializing data to the filesystem so that you will not lose things if a memcache box goes down. The Memcache API is very simple to use and works from any language allowing you to use different stacks in different places.
Feb
3
comment Why is it hard to make a Java program 'appear native'?
Placement of buttons, exact sizes, and preferred GUI styles vary by platform and getting Java to mimic them takes work. Swing can give you the native button but if it's 10 pixels to tall the user will still think something is off. Apple has the Human Interface Guidelines and Microsoft has the User Interface Guidelines to help you get the correct native look. You will need to change UI somewhat between platforms.
Dec
11
comment Why not free memory as soon as its reference counter hits zero
@PieterB is correct, smartphones and tablets dominate computer sales and all of them have heavily constrained memory. See sealedabstract.com/rants/why-mobile-web-apps-are-slow for a great overview of how garbage collection issues are very real in the mobile/tablet world.
Nov
21
comment Is there really anything to gain with complex design?
@Telastyn I've had to redo projects when requirements became too much for the system to handle. However given the choice I'd rather know that something needs to be redesigned than be stuck with an overly complex mess that fails slowly.
Nov
12
comment Is there really anything to gain with complex design?
I've seen many projects fail because of overly complex code. Simpler designs may show their limitations, but at least you can see the problems. Complex designs hide their limitations until you need to fix or change something.
Nov
7
comment Is it better to have constructors with or without parameters?
I've been bitten by incomplete constructor bugs many times, granted in C++ sometimes incomplete constructors are required because of the limitations of the language. In Java I find that the factory constructor technique can almost always eliminate incomplete constructors.
Oct
25
comment What are the safety benefits of a type system?
Runtime type systems like Java or Objective-C defer type casting errors to runtime, but at least you get a good explanation. In C++ dynamic typecasts are very risky since you may crash without getting an exception.
Oct
9
comment What skills (technologies) get outdated slower?
@amon Fortran is very much alive in science, Intel, IBM, Absoft and others will sell you a Fortran compiler up-to-date with the latest standards. What do get out of date are APIs; DOS interrupts and classic Mac Toolbox calls are really and truly dead.
Sep
17
answered XSLT and possible alternatives
Sep
17
comment Should user documentation include screenshots?
Please do include screenshots in your documentation, even if many users will see slightly different chrome on their windows. As a MacOS X developer I was one of the people who convinced an Apple Engineer to put screenshots (Command-Shift-3) back into MacOS X for documentation.
Sep
13
comment Is learning C essential for Computer Science?
Pointer arithmetic is critical to understanding operating systems since leads to the why. Eg why are heaps and stacks different, why does virtual memory perform well or badly, why do some loops work faster than others, etc.