Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
mojuba
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
20 ms
·
241.
▲
by
mojuba
4y ago
I think static languages are generally more disciplined and manageable in this regard. The only times I struggled with 3rd party Swift code was when a package included some C or C++ code alongside with Swift. Specifically, I think Apple
242.
▲
by
mojuba
4y ago
If you show an example of something that pops up right after the initial load, and that a user actually desires, we'll think of ways. I can't think of any right now. Things should pop up in response to a click, generally.
243.
▲
by
mojuba
4y ago
Thought the same, but it would be unfair to web sites that are actual web apps and are JS-heavy. Google is hopeless anyway, so here's something for the next search engine that wants to bring back the Web: downrank by the number of 3rd
244.
▲
by
mojuba
4y ago
> In swift you do mymethod?.call(...) Where method can be nil and it has the same effect. No, it doesn't. (You probably meant object?.mymethod()). If mymethod returns int, then in Swift the result of this expression is strictly Opti
245.
▲
by
mojuba
4y ago
Yes, but Objective-C is even more permissive than that. For example, [object method] where method is supposed to return an int, will return 0 if object is nil. This is of course a double-edged sword: it's too easy to make a mi
246.
▲
by
mojuba
4y ago
Yes, you can move your references around to find a suitable place, but how does that solve the problem of lifetime control? How do you guarantee a network resource is alive for as long as you need it under GC, and under ARC?
247.
▲
by
mojuba
4y ago
Of course there's a reference to the network resource and that's the reference that creates a cycle via its callback defined in a bigger object (e.g. GIU view) that awaits the results. There may be reasons why you want to keep the
248.
▲
by
mojuba
4y ago
Cycles in RC is a fundamentally unsolvable problem because there are situations when you in fact want an unreferenced cycle exist in memory at least for a while. Imagine a slow async operation such as a network request, where a GUI object i
249.
▲
by
mojuba
5y ago
So basically no way to do the same with await, other than of course declaring a weak local var.
250.
▲
by
mojuba
5y ago
I know the article is about JavaScript, but I was wondering how Swift resolves the problem of weak self within the async/await model. If the part of the function after await is the callback, how do I specify weak self if I need to?
251.
▲
by
mojuba
5y ago
Now that's a museum, thank you!
252.
▲
by
mojuba
5y ago
Probably because on Android it already has most of the frameworks (including tracking ones) it needs pre-installed with the OS.
253.
▲
by
mojuba
5y ago
But even the stripped version is way way too much for an app like this. I can imagine it's layers upon layers of poor, bad and terrible architectural and organizational decisions.
254.
▲
by
mojuba
5y ago
According to the OP tweet though, `foo()` is now a function that takes no arguments.
255.
▲
by
mojuba
5y ago
Removing K&R style function prototypes though is kind of big. I remember when one of the Objective-C upgrades started enforcing K&R. I don't think ObjC will be upgraded to C23 (ever, as it's a language being deprecated now
256.
▲
by
mojuba
5y ago
Thanks. I still doubt it though. Firstly even without the IDFA they can heuristically identify devices in vast majority of cases, in fact even more accurately compared to the IDFA method given the current opt-in rates of 30-50%. Branch does
257.
▲
by
mojuba
5y ago
So if there's SKAdNetwork attribution, why do I need to give the unique device ID to FB or Google in addition to that? They will know which ad led to the install via SKAdNetwork calls anyway, right? I know IDFA benefits them because th
258.
▲
by
mojuba
5y ago
I'm going to ask the same question here: If I run a Facebook ad campaign for my app and given that Apple already provides the SKAdNetwork attribution mechanism, does enabling IDFA benefit my app, or it benefits only Facebook? Marketing
259.
▲
by
mojuba
5y ago
https://archive.fo/ZasjX
260.
▲
by
mojuba
5y ago
So my hypothesis that my app doesn't need the IDFA is correct, and when e.g. Facebook SDK docs push hard for enabling the IDFA, I should just ignore it? Or would it backfire on me somehow?
261.
▲
by
mojuba
5y ago
Can someone explain why the ad business isn't happy with SKAdNetwork, an anonymized replacement for IDFA tracking? I'm just trying to understand, when marketing people come to me (as a mobile dev) and say "we need to enable
262.
▲
by
mojuba
5y ago
Absolutely, and I'd say: > make complexity simple, even when your target market is other engineers including and especially if the target market is other engineers. Simplicity though is achieved with additional effort. It almost a
263.
▲
by
mojuba
5y ago
That would require them to dump JavaVM and rewrite everything except the kernel (and whatever parts are theirs but are not on JavaVM). And invent a new static programming language that is not GC-based and is not Go. Also please, that should
264.
▲
by
mojuba
5y ago
I usually keep my Magic Trackpad connected to USB because I know it switches to wired operation with no latency and 100% reliability. Also an option.
265.
▲
by
mojuba
5y ago
Absolutely! I have similar stories with other abstractions too (virtual methods, protocols, exceptions etc) I just never quite understood where this "don't worry about the implementation" is coming from, as well as the tenden
266.
▲
by
mojuba
5y ago
Yep, and 1x1 gifs for sizing certain unsize-able elements. I'm building a web site currently, after a looong break from web development. It's almost unbelievable how much cleaner HTML, DOM and JS have gotten. It's more of a p
267.
▲
by
mojuba
5y ago
10% is pretty low though. In my case Safari does it right in maybe 80% of cases. However the ones (websites and apps) that do it wrong can be very annoying.
268.
▲
by
mojuba
5y ago
I know but it comes at a price of some users who don't use a password manager setting silly weak passwords. In one of my mobile apps that manages KeyChain user/passwords correctly, I still see a lot of password reset requests. I c
269.
▲
by
mojuba
5y ago
Interesting! (I searched, even asked on SO, couldn't find any solution for this). So to elaborate: I first store a nonce in cookies as a login session token. Once the code is validated somehow, I unblock it on the backend, and on a fir
270.
▲
by
mojuba
5y ago
Not only expiration, you also limit the number of attempts, the IP address, you verify an additional nonce token generated for the specific request, etc. The security of your email is typically taken care of by a more sophisticated system l
More ›