Programming

oh god i’m not even close to that crap yet. basically right now i’m writing kafka connector task logic that sources from one really disastrous nosql db into a very very strictly typed schema in a RDBMS.The typing is a total nightmare, they can put literally whatever the fuck they want into the source, and it is just one massive json blob I have to parse out the fields from. oh yea and it needs to be “real time” but dont get me started on that yet.

Having written python so long I had quite an embarrassing bug go live that came down to me just unconsciously typing a lazy thing i do sometimes that usually works fine in python and bash:

if (str == "") {
 //noop
}

well ok yea duh I understand str is an object and it doesn’t work that way in this language, I just was going fast and forgot. that’s why I want a project so these unconscious mistakes stop happening.

We are working with JDK 8. I will look at streams API for sure. My idea for a project was deploying a minecraft server with my little brother and writing some mods for it.

Feel like the tasks I’m getting here are just things intended to make me miserable - worst on call rotations, most dumpster fire projects, now I gotta be a java dev on a team whos principal thinks his java is great (it is really bad).

luckily my capacity for misery is superhuman, thanks for the advice.

“No rush” means I am not doing it

idk what IDE you’re using but you can get IntelliJ to flag string reference equality as a build error.

1 Like

dlk9s jr. wants to learn to code, specifically to develop computer games. He’s 13, heading into 8th grade.

He has some knowledge already. He’s taught himself some things by watching YouTube videos and has made the beginnings of some PC and VR games in Unity. For example, he’s made a rudimentary FPS that does actually have a few weapons, hit detection, and scoring. It looks like nothing, was just his way of figuring things out.

He’s also made some Roblox games. His latest is some idle clicker or something.

Boy has also taught himself Blender and finished 3rd in a 3D modeling competition for 5th and 6th graders last year. He has had fun with that and animation, another interest of his.

So, he has some knowledge. He’s always want to go 0-60 in zero seconds, had never had the patience to want to sit down in a class or with a formal lesson and start from square one, but now he thinks he’s like to try a class or a coding camp over the summer.

He says he wants to do C#. Any thoughts on what to look for? My main concern is that we’ll end up enrolling him in something for “kids” and he’ll be bored out of his mind.

2 Likes

lol “go do leetcode” is uh not where I’d start. There’s a million online courses that go through the basics of the languages that you have to understand before doing anything. I got my start like 12 years ago on codecademy and it still looks fine. Learn C# | Codecademy

i don’t think i would recommend c#, although i haven’t programmed in it in a while. for one, i would look for something with easy or forced syntax and none of the type hierarchy bs, and some idiomatic features with useful syntactic sugar. c is a bit tto low level, and i want to say js is too high complexity. maybe golang (:face_vomiting: can’t believe i’m writing this). maybe python.

ideally i would say the language should be useful and applicable to a project they want to do, have lots of available examples, lots of open source libraries they can read, learn from, and use, and help them learn the next language down the line. i just don’t see how c# wins in these considerations.

if the kid wants to nerd out, my first semester SICP was taught in a variant of Lisp, because the prof felt after such an intensive mindfuck, learning any other language down the line would be a cakewalk. i agree with that philosophy, but i wouldn’t recommend languages like lisp or caml to a middle schooler. too niche

As the resident C# enthusiast I totally disagree. C# has tons of available examples and open-source libraries. He’s already messing around with Unity, C# is the language to use Unity’s built in scripting API. It’s a C-style language, which is obviously a good language style to understand. It teaches you both object-oriented and functional paradigms. It has piles of syntactic sugar (much of which has probably come along since the last time you wrote in C#). It invented async/await, which is useful to learn if you’re going to move on to JavaScript. The IDE gives you tons of help when you write it. It’s widely used - I think among general purpose languages probably fourth after JS, Python, Java.

JavaScript I think is a bit too weird a language to be a good first choice and not well-suited for the types of projects he is looking to do. I don’t speak Python but I assume it would be an OK choice too. Anything much less popular than C# seems like it’s too obscure to be a good choice. And if @dlk9s tells us he’s decided to teach the kid Java, I am going to call the police.

3 Likes

See if you can find some way for him to audit a summer class at Georgia Tech or local community college on C# or Unity or game development. I’d guess that a camp situation is likely to either be really expensive or be too kidsy. Plenty of online choices, but I’d guess that he’s aware of them and that’s not what he’s looking for.

2 Likes

Thanks, I’ll look into local colleges. My wife found a coding camp where one of the learning “trees” has Unity, C#, etc, so I’m taking dlk9s jr. for a free one-hour session on Friday to check it out.

I’ve actually bought him some online lessons in a wide array of coding and game development disciplines the last few years, but yeah, he hasn’t done much with them. Stuff from Humble Bundle and what-not. But at least we have them if he wants them as reference.

He’s one of those kids who just wants to learn on his own terms and hates school (moreso because of stress nowadays), so he’s been very self-motivated to just teach himself when he gets something in his head that he wants to do. For instance, he plays percussion in band, but lately he’s been teaching himself how to play on a real drum kit (we bought him an electronic kit a few years ago that he barely touched until this year) by simply printing sheet music and plugging away. His favorites right now are a couple Weezer songs (Buddy Holly and The Sweater Song), Led Zeppelin (D’yer Maker), and this:

(no, he hasn’t figured out how to play the part when the drummer goes HAM)

But despite his loathing of school, as I mentioned before, he now thinks maybe a formal class might be the way to go for programming.

3 Likes

That drummer vid is brilliant :star_struck:

1 Like

update from corporate java land hell:

my driver is weeks late, because I found a ton of corner cases while building out unit tests that could catastrophically break the pipeline I’m helping build out. I caught a lot of shit from the principals for spending a day or two working on a way to gracefully handle an “impossible” corner case. I was like well, it technically could happen so I’m handling it.

Went live into production today, and that exception did happen, a single time out of 128 million rows. Got’em. Now i need to figure out how to go around and gloat about it without pissing people off too bad.

thanks for that advice chrisV that let me in the right direction

this is actually quite a big moment in my career I think, even though this has been stressful to the point I’ve been dry heaving throughout the days sometimes - I think this is the first actual “dev” work I’ve ever done that made it into production.

7 Likes

Generally, the major foot-gun (which I talk about more in a previous post on foot-guns) that got a lot of places in trouble was the premature move to microservices, architectures that relied on distributed computing, and messaging-heavy designs.

This was 100% true for that startup I worked for when I had two jobs for a year. They would have been so much better off just building a standard java, PHP or .NET back end and calling it a day.

The head engineer (who had known the guy funding the thing since childhood) had no clue how node, stateless architecture, or asynchronous code worked. He had somehow figured out how to get access to one particular worker of a node instance, through some internal ID or something, and used that to make stateful exchanges where one worker in some microservice was pinned to another. Which goes against everything node and microservices is about.

I tried to talk some sense into them but they didn’t want to hear it. So for the last six months I just did my part and drained the big guy’s money like everyone else. I hate doing that - way more stressful than working your ass off.

message heavy designs is pretty much kafka right?

kafka is super dominant in the space. not really sure if rabbit or else can handle the same throughput. they just had years of iterations and fixes to get where they are. used to be very finicky. still somewhat finicky to run yourself, but much better if using a service. i have a three year old 3 node kafka cluster that has experienced some server degradation, but is still basically working as expected.

redpanda (kafka performant clone) got hit with a researcher reproing and then reporting a very serious correctness bug on his blog. the kicker was that the bug should have been impossible if they implemented what they claimed wrt kafka compatibility.

we had so many issues with rabbit - I dont know the tech well yet, it just seemed a lot shittier than kafka solutions.

Does anyone know why this is good/better than 97% of js ones? When I did it I expected the opposite there’s like 3 full loops in there. I guess not a lot of people do the regexp or the break?

I would bet the regex is very uncommon and just works out to be faster on the test cases because it’s so heavily optimized. Most people are presumably just testing el[i] === lowestLengthStr[i], which theoretically should be faster than using a regex, but perhaps is not in the real world.

You might do even better if you don’t sort the array!

5 Likes

Is this a silly way to allow for multiple default settings?

class HeaderFooterText:
    
    def __init__(self, left='', center='', right=''):
        self.left = left
        self.center = center
        self.right = right

class HeaderText(HeaderFooterText):
    
    defaults = #TODO
    
    def __init__(self, setting=None, **kwargs):
        HeaderFooterText.__init__(
            self, **(self.defaults[setting] if setting else kwargs))

I think it’s better to have a class method that acts as an alternate constructor. Like:

class HeaderText(HeaderFooterText):
    @classmethod
    def from_default_setting(cls, setting):
         return cls(**cls.defaults[setting])
1 Like