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.

  • 0 Posts
  • 16 Comments
Joined 1Y ago
cake
Cake day: Jun 13, 2023

help-circle
rss

The 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.


Yeah, it’s a bit on the extreme side for me. 10-20 is what I prefer. I find that if I follow that rule the code is easy to come back to later because the things a function does are more clearly defined. I can look at a higher level function and it’s filled with function calls like readX, createY and doThis. I don’t have to look at as many blocks of code and try to remember what the intent was.


It’s a highly opinionated book but it is full of good advice that in my opinion goes too far. Using a metaphor here, I think he wanted to get people to the moon but knew that he needed to give guidance to get to mars because people would look at whatever he wrote and think it’s too much.

The book has several chapters discussing the SOLID design principles and showing how to apply them. You’ll be a better programmer for reading it. “Uncle Bob” the person can be a bit problematic so I don’t particularly like telling people to give him money. Try getting the book from the library or a second hand store. There are also videos out there of him speaking at conferences that may give a good taste of the material. He has a blog too.


There is a school of thought that break and continue are just goto in disguise. It helps that these two are more limited in scope than goto and can be considered less evil. If you read the book Clean Code by Robert Martin (it should be required reading for all developers), you’ll see that he doesn’t like functions to be very long. I think his rule is no more than 4 lines. I try to keep mine around 10 or less with a hard stop at 20 unless it can’t be avoided because I’m switching over a large enum or something. If you put your loops into functions then you can just use return instead of break.

I did have a discussion with a teacher once about my use of early returns. This was when I had returned to school after many years as a professional programmer. I pointed out that my code has far less indentation than theirs and was simpler because of it and that it is common in the world outside of education. I got all of my points back he has deducted.

You’re going to hear some good and bad advice from your teachers. Once you have a job check out what the good developers are doing and just follow them.


While lua ships a standalone interpreter, it is very much designed to be embedded directly into an application. This is done by invoking some C apis to load the interpreter into the application’s memory space. OP wants to do that rather than invoking another process and reading the output. When embedding into a host, the host can provide its own objects to be manipulated by the user script allowing for a much better extensibility experience.


Does the orange pi 5 also require active cooling? That’s one of my bigger hangouts about the RPi5.


I used to work for a ttrpg company. A dice parser is not a small undertaking. You’re basically writing a calculator with an embedded random number generator. It’s fun but not an easy first project. My advice would be to keep it simple to start with and have your command interface (repl) just accept simple roll commands like roll dex and that handler knows how to make a dex roll. Simple roll commands like roll d6 are also easy to parse out with just a regex. Honestly, I think you would be better off writing a gui app and give it a retro hacker look than going with some type of terminal. Typing on phones is a pain vs tapping buttons.


Breaking change. It’s gone from plain text to a markdown formatted text (possibly). There’s changing an interface (obviously a breaking change) and then there’s changing the semantics of a function. I just dealt with a breaking change where a string error value changed for an account registration api call. Previously it returned EMAIL_IN_USE and now it returns EMAIL_TAKEN. Same data type but it broke the client code. Changing values or formats is a breaking change. In your case the documentation says don’t rely on this function for anything but once the output is in the wild any monkey can start using it for anything and it can’t be certain that some code documentation will be consulted before deciding to depend on it.


It’s always fun when someone comes up with a new idea of how to write code and it is something smalltalk did in the 80s.


There was a time when at least once a month on that “other site”’s android channel that you would see a post about someone getting their account permanently banned. Sometimes it was because they made a spammy app while in high school or college but had turned over a new leaf and were using a new Google account. Sometimes it was a company who had employed someone who had been previously banned but only ever signed into the play console under a company email but probably also signed into their personal mail on the work machine. How true are the claims? I can’t say.


I wish I could say that Google is better at that. It’s basically the same story but with even less humans to talk to when you’re flagged for doing something wrong or in the case of Google your former college roommate whom you haven’t seen in 10 years did something wrong. It’s the price all mobile devs pay unless they only want to distribute to a small subset of users who have liberated their phones.


If you’re following agile it is important for a team to agree on a definition of done for a story. If you don’t have one ask the scrum master to start that conversation or bring it up in a retro. One of the things that everyone can usually agree on is that the tests pass. Throw in a minimal coverage threshold as well. It’s not an indicator of good tests but it will tell you when there isn’t enough.

You mentioned that you’re doing this work for a client and that they will take over the code. Verify with management (in your company) if there are any quality measures specified in the contract. You don’t want your guy not performing up to the client’s expectations and you having to put in a lot of last minute nights and weekends to get there.


Story wise they didn’t leave much room for a sequel. It gets wrapped up nicely at the end. I didn’t play any of the DLC but the impression that I got was that a lot of possible sequel material was covered in them. The game was really good and definitely worth picking up on a sale price. It will give BotW vibes but don’t think of it as a clone. It’s got a good story and a nice little twist at the end. The boss fights were a joy if not painful at times. The puzzles were mostly good and not too obtuse. I think I had to use Google on a few of them. It is annoying with the extra clothing and style purchases that the game tries to get you to spend real money for. It tarnished an otherwise good game.


IMO going from one programming language to another is the same level of abstraction regardless whether the target language is closer to the metal or not. If Nim compiled to assembly or some byte code, that is a lower level. I can’t say that I’ve ever wanted to do anything with the output of a transpiler aside from just send it on to the next stage. I’ve never seen any machine generated source code fit for human consumption. Even typescript produces a lot of boiler plate that would not be pleasant to try and maintain.


I’ve never been a big fan of transpiled languages. I’ve looked at Nim a few times over the years and while it looks nice, I’ve never found it more compelling than other languages. Chances are there is at least one more not quite mainstream language that does something cool that will fit your usecase more and not be transpiled.


The number keeps shrinking as Swift adoption increases at Apple. I imagine one thing holding it back was lack of C++ interop which was introduced this year. There’s also the rewrite of Foundation into Swift that will allow a better Swift story on non-Apple platforms. I appreciated ObjC back in the day and didn’t jump straight into Swift when it launched. I was saddened that it wasn’t as flexible as ObjC. I eventually got over it and grew to like Swift more.