I think the responder means that duplicate code is usually easy to refactor into single methods. Typically I see copy pasted code that is changed just a little bit. However much of a duplicated function can be broken into smaller functions and the redundant code removed in favor of calling into the functions. Often what is left then becomes easier to reason about and refactor accordingly. I love the PRs that I make which delete more code than I add but still manage to add functionality. It doesn’t happen often but it’s fun when it does.
iOS Swift developer with an unhealthy amount of Android and Flutter thrown in. Cycling enthusiast. Admirer of TTRPGs, sometimes a player, often times a GM.
- 29 Posts
- 102 Comments
If your primary exposure to programming is only typescript or JavaScript maybe you shouldn’t be jumping straight into something like rust. JS is a high level language and rust is aimed at the lower levels where things can’t be as automatic. There are many languages out there like C#, Kotlin and Swift that will help you get used to the idea of strong types and immutability.
Such a polarizing book. I like it but I tell everyone that I recommend it to, to not go to the depths that the book recommends. Never go full Clean Code.
samus7070to Programmer Humor•Quantum Lock suspends sales due to developers losing access to source code2·9 months agoThe reflog is your friend in situations like that.
I think there might be something to do that in Foundation. You would have to cast to an NSString to access it though. I might be mistaken and there’s only a title case method. Sentence case is easy minus the not converting proper names to lower case problem.
samus7070to politics @lemmy.world•Trump says he is open to restrictions on contraception before backing away from the statement71·11 months agoI would argue that Biden can say and do plenty of crazy things as long as he never goes full Trump.
samus7070toUnited States | News & Politics@lemmy.ml•Alphabet issues first ever dividend, $70 billion buyback4·1 year agoThat’s really a lame dividend. I have no idea why the stock would shoot up 15% to $160 on the news that shareholders will receive $0.20 per share. Even with the buyback program it won’t be that big of a boost. The better asset allocation would’ve been to keep innovating but I guess they’re out of ideas?
samus7070to Programming•Google lays off staff from Flutter, Dart and Python teams weeks before its developer conference | TechCrunch9·1 year agoIt was originally meant as a better JavaScript and it was. It failed when none of the other browsers expressed interest in supporting it. It languished for a while and then was taken up by the Flutter team. At the time Flutter took it up it was somewhere around the level of Java 8 in features but not quite on par. Since then it’s seen some massive improvements to the type system and language. It’s completely null sound, not just null safe like Kotlin. It recently got records/tuples and one of the more capable pattern matching syntaxes I’ve ever seen in a functional imperative hybrid language. The next stable version of dart will introduce a compiler macro system that is very promising. The syntax isn’t always the prettiest due to it trying to not totally break old code. I do think that it offers a wide range of modern language features that competes heavily with Swift and Kotlin in the mobile space.
samus7070to Selfhosted@lemmy.world•Why is Matrix mentioned more often than XMPP in self hosted forums?English11·1 year agoThe only things JSON has over xml is that it’s easier to write a parser for it and the format is less verbose and less complicated. There are extensions to JSON that can add features that xml has and the JSON spec doesn’t have. Overall the xml spec is bigger and has more features but that also makes it overkill for many of the cases that it would be used in.
Claims top 5 and offers zero evidence and very little content beyond what an LLM might write.
Because ChatGPT thought that was a pro?
samus7070to politics @lemmy.world•Court agrees to block collection of Trump's $454 million civil fraud judgment if he puts up $175M2·1 year agoHe’s not going to jail yet. Those are other criminal cases.
I’m going to sound very negative here and it isn’t because I don’t like open source software. I use it and contribute to it. The problem with OSS apps is that they get cloned by people who don’t care about the license and repackaged with predatory subscriptions or with malware. In the case of malware these lowlifes go out on sites like Fiver and offer to pay unsuspecting developers to distribute the app. If the app is downloaded even once, that developer now faces a lifetime ban from distributing Android apps. I suspect similar things happen on the App Store. It’s just more visible in the Android forums I follow than it is in the iOS ones.
I have seen stories of oss apps being cloned and then Apple mistakenly not letting the original dev upload updates because the app has been flagged in their system as being a spam app or built from a template. This is usually correctable with enough email to support.
My recommendation is to keep your app closed source on both platforms. If you want to contribute to the communities, release a library or contribute to one. If you want to show How to write an app, make something minimal and trivial like a todo list. You can also create a blog.
samus7070to politics @lemmy.world•The GOP Is Too Scared to Let South Dakota Vote on Abortion7·1 year agoThey tried like hell to keep it off of the ballot in Ohio because they were afraid of what did happen. I can’t say if all of the dirty politics influenced people who were unsure how to vote in the opposite direction the GOP intended. Statistically speaking the final vote wasn’t even close. That is what they fear.
samus7070to Technology@lemmy.world•Samsung does an Apple with its first Snapdragon X Elite laptop, suggesting the new Arm-based Windows machines aren't going to be a cheap alternative to x86English5·1 year agoOr it is just corporate greed. Samsung would love to position something that is just okay into a premium price tier and not have to pay Intel. Sure they’re going to pay Qualcomm instead but you can bet that Qualcomm is giving some great introductory prices to their early partners.
samus7070to Technology@lemmy.world•Samsung does an Apple with its first Snapdragon X Elite laptop, suggesting the new Arm-based Windows machines aren't going to be a cheap alternative to x86English5·1 year agoAny program written for the .net clr ought to just run out of the box. There’s also an x64 to ARM translation layer that works much like Apple’s Rosetta. It will run the binary through a translation and execute that. I have one of the windows arm dev units. It works relatively well except on some games from my limited experience.
samus7070to politics @lemmy.world•The NYPD Spent $150 Million to Catch Farebeaters Who Cost the MTA $104,00091·1 year agoHave you ever driven through a small town and seen a police car sitting right where the speed limit drops? Those tickets and the kangaroo mayor’s courts are the only reason some of those towns are still alive.
The logo is closer to do ith ub. It might summon an orcish demon patron if said with the right spell components.
samus7070to Android•Microsoft is ending support for the Windows Subsystem for Android (WSA)!3·1 year agoI would guess that it has more to do with the Amazon App Store. The catalog is not very big and just a fraction of what the Play Store is.
Similar to the concept of asking why five times, there’s an idea that who you ask should also be six levels deep from the CEO. You’re not going to be able to know everything so cultivate contacts in low places. There are the people that are closest to the problem and have the best answers.
From a more hands on side, perhaps you can convince your boss to let you embed in different teams for a sprint once per quarter.