4,107 karma · joined Feb 17, 2010 (16y ago) · 1,490 submissions
https://coderescue.com
comment 9y ago · link · parent
I call B.S. on that. There's nothing stopping Apple from creating an API that anyone can register with, or even providing an XMPP gateway to allow completely non-Apple platforms to connect.
Apple is choosing to keep their walled garden isolated. It's absolutely a choice.
> Large companies can afford to spend the resources on a custom, more cross platform-y solution.
On scale: Cross platform is cheaper than coding twice. Small companies "dedicated to iOS" are Doing It Wrong. In 2017 it should be considered a best practice to use cross platform development environments for any app development. Between React Native, NativeScript, Xamarin, and yes, even Ionic/Cordova, there are a ton of great options, and there's no compelling reason for 95% of apps to go completely platform-native. And it's worse: Environments like React Native make it cheaper to create for a single platform, much less two platforms. And additional features and ongoing maintenance are also half as costly. It's a win-win-win situation.
comment 9y ago · link · parent
Will I be able to chat with my customers if they have an Android device or Windows?
Because in most industries today, if you can't interact with your customers with Android devices, you're cutting out half to 90% of your market. So that means that Business Chat is yet another thing that I need to implement twice over, one for Apple's walled garden, and once for the rest of the world (which is mostly Android, but could also include chats directly to customers browsing the store web page on Windows).
In which case why wouldn't I just use a cross-platform solution so I could integrate it just once?
Correct me if I'm jumping to the wrong conclusion here.
comment 9y ago · link · parent
There are certainly groups where Macs are popular. Startups use a lot of Macs; when I go to a coworking space in Boulder mostly everyone has a Mac. They're super common in cafes as well.
But not everyone uses a Mac. Not everyone likes Macs (myself included).
[1] https://insights.stackoverflow.com/survey/2017#technology-pl...
comment 9y ago · link · parent
I've run into several other complex sites that fail on Firefox. It's sad, because I've used it for years. I'm using it right now. But my default just switched to Chrome because I started having too many Firefox issues.
comment 9y ago · link · parent
Assembly language also doesn't natively support either closures or objects, except in the sense that of course you can build them from first principles, Turing Completeness and all that.
Until someone proves to me that Haskell can be used in a reasonable way by a "typical" programmer, I simply won't think about pure-functional when I make general statements about languages.
I fully admit this may be a hole in my brain, but I don't understand how to break down the problems I face on a daily basis into Haskell (or any pure-functional language), so I just talk about the universe of languages that are not pure-functional.
I've looked at Haskell tutorials and gotten at least hip deep into the language, by the way. I just usually end up dealing with problems that require levels of complexity where FP tools fall down. Your mileage may vary.
comment 9y ago · link · parent
When I said "poke into another object" above, I didn't mean literally mutate the data of another object. Private data is a good thing. I meant grab onto a handle to the object and changes its state through its public interface.
None of the "complex" problems you're talking about hit that level for me; they're mostly the kind of algorithm you can easily approach from multiple directions. Pathfinding, ticket price calculation with a million special cases -- these are broad-but-shallow problems for the most part. A spam filter is one or more algorithms applied to a data stream. I don't know Jane Street's OCaml stack, and a quick Google isn't explaining it to me, but it looks like some kind of parser?
A game might use pathfinding, but an A-star or one of the many newer algorithms is pretty straightforward. Not the kind of complexity I'm talking about. I'm talking about needing to deal with the state of a hundred or a thousand items that have various ways they can interact with each other and that are expected to have emergent behavior. Like you'd find in games, but as you may also find in stock analysis (speaking of a domain where speed can be critical).
I've avoided the worst of OOP I think because I've avoided enterprise work, except for one greenfield project where I got to create an app for the retail space -- and I ran into some pretty awful code that was wrapped in a giant black box that only ran on Windows and required about 160Mb of RAM per user...to run a cash register. No I'm not exaggerating. It was insane.
The problem with using concurrency in FP is that the entire point of concurrency is speed, and on the problems that most need speed you get more out of an imperative language.
There was an attempt to code an image convolution algorithm in Haskell that I read about. A PhD tried his hardest to parallelize the algorithm and beat the speed of C code handling the same problem. I turned out to be impossible; the asymptotic speed of the Haskell code as you added cores never ended up faster than the C code on one core. Amdahl's Law is a hard limit for a lot of problems. [1]
comment 9y ago · link · parent
TypeScript, which is my current OO language, will use signatures to match to an interface, so it's even more open: You can create an object with the right members and pass it in to a function expecting an interface without even explicitly identifying it as "implementing" the interface.
> If anything, I've never seen a big OO program made out of truly reusable components.
Agreed. The point of using OO in a giant complex program isn't just the reuse, which you point out is exaggerated. The point of using OO in a giant complex program is the isolation you get, so that a team of 1000 people can develop the app in a reasonable way.
I think the cost of FP as the complexity of a program goes up is that the cognitive load to think about the structure of the program goes up exponentially faster than OO. Debugging is a huge issue when things get complicated, and the last I heard Haskell debugging is still in its infancy. A debugger where you just can step through the code is really, really important for some kinds of analysis.
It's all Turing Complete, so you can do anything in FP that you can do in OO. It just feels harder to decompose problems into FP units than OO units, at least at a larger architectural level. Not everything is easily isolated: Sometimes you need a control over here to poke into the state of a control over there, and you don't want that information in some "god object" at the top level; you want a direct connection and mutability.
I have heard good things about Elm, and will probably give it a try at some point. But my 30+ years of programming experience have given me a (possibly incorrect) strong intuition that FP just won't work well for some problems. Can they apply to them? Sure.
> [...] pure FP, is especially well suited for complex problems.
Which is why it's so popular for solving complex problems? Looking at a list of Haskell's uses in industry [1] and applications [2] I don't see a single example of Haskell used in what I would call a "complex problem". Lots of machine learning, parsing/compiling, and transformation tools. Some games written by amateur game developers -- getting a game working is about 10% of the problem. A very few more complex apps that I've never heard of, but nothing that hits the complexity of even a Microsoft Word or Adobe Photoshop, much less a 3d editor like Maya. There's an order of magnitude more complexity in an app like those.
Haskell is 27 years old. Over the last ten years it's been incredibly popular. Totally enough time for at least a few high profile applications to have been created. Where are they?
Maybe Haskell would be a better platform, but it's just harder for many programmers to think pure-FP. But even that's a real limitation: If you're putting more cognitive load on the developer, then you're just changing the problems, not preventing them.
comment 9y ago · link · parent
React is good for certain classes of UI, granted. I use another FRP-style library (not React) to render UI in my current game, and it works well -- except that it doesn't mesh well with me trying to control it from an OO game, but I've created an interface that works.
But imagine creating Adobe Photoshop, Maya, or Microsoft Word entirely in React, and tell me again that FP would be the ideal choice.
For any particular dialog that pops up? Absolutely.
For the entire app? You'd end up with a "god object" that would make the app unmaintainable. OO gives you compartmentalization that you don't get with FP.
FP is great for problems up to a certain complexity. After that it falls apart. Thing is, 98% of apps don't come close to that level of complexity, so there are lots of people who never even work on an app that won't work well with FP.
In the RectIterable example you gave, I'm afraid I don't know enough Haskell to comment on it intelligently.
Is "instance" adding an interface to TileMap/HexMap so that either can be passed in as a parameter that requires a RectIterable? Can other interfaces be added that way to TileMap/HexMap?
In my editor, can I say something like myTileMap.iterateRect after doing this, or do I need to know that iterateRect exists and remember exactly what it's called?
The last point is salient: Discoverability is a huge part of the UI of a programming language, and memorizing all of the exact function names that are appropriate for a data structure is not fun.
comment 9y ago · link · parent
I can't help but think that people who say this, yourself included, just don't deal with the problems that I face on a regular basis.
I write a lot of games and game engine code. I might have 60 dynamic objects in the game, each of which with its own behaviors, state and physics. Object oriented code means that the functionality for each object has both inherited and specialized behavior.
And when you're working with those dynamic objects, the "information hiding" aspect of OO programming can be very useful. Some objects have a member variable; others have an accessor that pulls the value out of a child class. I use that to good effect in my current game.
Or I might be parsing a map that I need to iterate over a rectangle in the map. But sometimes it's a hex map; ever tried to iterate over a hex map? Saying map.iterateRect(iterator, x,y,w,h) or equivalent, and not having to know whether the map is rectangular or hexagonal is very nice.
Functional programming is great when you have a lot of generic functions that you can apply to lots of different kinds of data. Object oriented programming ... is good for UI and game development, and anything else where the functions you're writing are very tailored to the data, where polymorphism can map well to the problem, and where you have lots of variations of kinds of data, but fewer (or less complex, or more specialized) things to do with the data.
comment 9y ago · link · parent
My only complaint about the matrix myself is that I only scored a level 1/partial 2 on the "books" section. I guess I don't own enough books. I don't like learning from books, though.
Otherwise I hit level 3 on almost every single row, so when I see the folks complaining about how this or that skill is irrelevant, well I have to say that every single row of the matrix has good information, and they should hit the (virtual) books if they want to level up.
comment 9y ago · link · parent
I don't know if wxWidgets has gotten any better over the years, and I can't remember the specific details of the problems -- just that certain windows HAD to be parents of certain others in order for them to work, even though there was no obvious reason why this would be the case, and there was no documentation explaining this.
The other two look interesting, though. I'll keep those around for future reference.
comment 9y ago · link · parent
I buy a house that costs $100,000. My down payment (cash out of pocket) is $20,000.
I pay 3.5% interest on $80,000 as I'm paying down the loan, plus property taxes and insurance, and it comes to $546.74/month [1]. The rent comes in at $550/month, pretty much canceling out the mortgage.
Am I making 4% per year on my investment, then, because that's the amount the real estate appreciates?
No, I'm making 4% of $100,000 per year, or $4,000, on my $20,000 investment. That's 20% per year. [2][3]
Leverage properly applied can raise your net profit.
You're welcome.
[1] http://www.mortgagecalculator.org/
[2] The numbers can realistically be much better than this, given the right circumstances. I am personally using this as an investment strategy, and yes, it doesn't just work this way "in theory."
[3] I'm ignoring repairs and vacancy rate for simplicity. Those obviously hurt profitability. But as I mentioned in [2] above, if you pick your investment property strategically, your margins are much higher, so that's your cushion.
comment 9y ago · link · parent
If the Rat Park study's conclusions [1] can be extended to humans, all addictions are symptoms of a deeper cause: Your life sucks.
From what I've read, there's a feeling that the fundamental way of life that many of these people grew up with is really being threatened. Combine that with a complete lack of ability to support your family, and a sense that tons of people in cities (which are an anathema to their value structure) are getting ahead while they fall behind... Yeah, their lives suck, and they see no way out.
Sorry to be depressing here. Hillary actually had some policies that could have helped, and still more if she'd had a friendly Congress to pass supporting legislation. Trump, on the other hand, wants to help people through an application of trickle-down economics ... sigh ...
[1] https://www.ted.com/talks/johann_hari_everything_you_think_y...
comment 9y ago · link · parent
Public transit is the only sane answer. That's why I mentioned trains. When I'm in the Bay Area, if I'm going to San Francisco, I simply refuse to drive there at all.
Hotels have gotten insanely expensive in the City proper as well; when I go to events in San Francisco, if I'm paying for lodging, I'll often get an AirBNB in Oakland near Bart and take that in. Instead of $300/night, I get a nicer place for less than $100/night, and the BART ride is only about 20 minutes.
289.
Google Drive broken due to deployment of internal version?
1 points · by SomeCallMeTim · 9y ago · 2 comments
comment 9y ago · link · parent
But I was thinking of class fields. I don't really want my compiler to hold my hand with respect to "nullable", if I know for a fact that, by the time the code gets there, it can't possibly be null.
Think of it this way: It's not a compile error to access an int from multiple threads, right? It doesn't require that !! syntax if you're just accessing a mutable class field or variable? So if I test an int for a value and then do something that assumes the value is still the same, I'm writing something that could crash just as easily as the null reference -- and array out-of-bounds, or a flag that says it's OK to do something but that flag changes after I check it, because I didn't grab a mutex.
So why does it add an error condition if you're accessing a mutable variable that's available in multiple threads just because it's nullable? Seems like extra busy work for no clear benefit for what is, as you say, a rather rare situation.
If we're going to share data across threads, I'd rather the language not present a false sense of security as a result of the !! operator.
comment 9y ago · link · parent
So. Much. Traffic. People packed into trains. Everyone so...not exactly rude, but not nearly as friendly as I've grown accustomed (I live near Boulder, Colorado).
I feel like my blood pressure is higher the entire time I'm there. Of course the air pressure is higher, so that may have something to do with it, but I think it goes beyond that.
On the other hand, I've never been in great shape, and the first day down at sea level and I feel like I could run a marathon...
comment 9y ago · link · parent
> "Smartcast to Int is impossible because value is a mutable property that could have been changed by this time". Right you are.
I disagree. It cannot have been changed by that time, not unless it was changed in another thread, and it would be really, really nice for a language to have built-in threading intelligence to prevent that from being necessary to check. That's what I'm saying. TypeScript is single-threaded, so it can be certain that another thread hasn't changed it. Go is multithreaded, but except for genuine globals (which need to be protected by a mutex, but shouldn't be used for just about anything) you're piping information from one state to another, which again doesn't have a synchronization problem.
If you have to manually mark a variable as "safe" every time you use it, you're just going to need to do that constantly for lots of variables. And you still are stuck getting the thread safety right: The above code isn't safe if something from another thread can change value. Which I guess is the point of the exclamation points, but ... somehow I prefer the Rust approach of "Mark this block of code as unsafe." Not that I've used either language.
The fact that it works correctly as a parameter, though -- that does hit the 80% case, at least.
comment 9y ago · link · parent
var value : Int? = null
fun F() : Int {
if ( value != null ) return 0
return value // error
}
Tracing value types through a function is a solved problem. Look at TypeScript: Almost the exact function above will work flawlessly. [1]Sure something in a JVM could be changed by another thread. But that would really be a bug no matter how you slice it. Doing type analysis like this seems like a minimal requirement for a modern language.
[1] http://imgur.com/nxdN9vc -- you can see that TypeScript can identify the remaining type. It works for optional null as well when strictNullChecks is enabled.
comment 9y ago · link · parent
Another comment mentions the fact that interviewing or marketing yourself may be an issue. It also may be that you're not in the right geographical area, or that you're not interviewing at the right companies, or that your skill set on paper doesn't include the current high-paying buzzwords.
Oddly enough, Android development has been one of the highest demand items for me recently. I do think the full stack development world may be oversaturated, and that 98% of the developers in it are probably too green to do a great job running a project, so I agree with your assessment that most companies have a terrible interview process -- and that they consider programming to be a commodity, where it should be considered some combination of an engineering discipline and a craft that requires a skilled craftsman.
You wouldn't hire an artist whose entire portfolio consisted of collages of magazine photos, and yet companies are hiring programmers who literally can barely get beyond cut-and-paste coding. And you certainly wouldn't hire an unlicensed builder to create a skyscraper -- which is why we have so many companies' backends falling down like a house of cards the moment they get any traction.
comment 9y ago · link · parent
Exactly, though the dynamic languages like Python did reveal some serious shortcomings with the "older" languages like C++ and Java. Which is why I'm so happy using TypeScript. It gives you the ability to layer static types on a language that still offers the flexibility and concise code that are unavailable in C++ and Java.
comment 9y ago · link · parent
I also use functional concepts, and my code also ends up with lots of nice, composable blocks, but being in a language that forces functional concepts where they don't fit is a recipe for unneeded complexity and unintuitive code.
Functional isn't a silver bullet. There Is No Silver Bullet.
comment 9y ago · link · parent
So I guess I'll stick with TypeScript or C# for writing my cross-platform apps. The ecosystems for both are much more robust anyway.
comment 9y ago · link · parent
For quite some time, C and C++ linkers have had the ability to look back at the original C/C++ code and literally rebuild the code differently to optimize the program across objects. In the Microsoft compile chain this is called "Global Optimizations". So I don't see AnyDSL's ability to do the same as a completely unique proposition.
The other issue that I see with this is that 98% of code doesn't need to be optimized down to the level that AnyDSL enables. JIT compilers are really good at optimizing the execution path without having to involve programmers at the intermediate and low levels, for example.
In the few cases where you need to target LLVM, CUDA and OpenCL for a particularly performance critical routine, I could see this as being useful, as long as the resulting code can be called from a more standard language. I'd like to see really trivial C bindings (via exported .h files) at a minimum, but C++, Go, Rust, JavaScript, Python, and other modern languages could really hit the performance required of 98% of the code, leaving only the extreme performance code for something like AnyDSL.
But I'd say that front-and-center: "AnyDSL is about creating ultra optimized cross-hardware performance critical code, targeting LLVM, CUDA, and OpenCL code based on the same high level code." All of the talk about theory is just distracting people from the actual "killer app" of AnyDSL.