mtbc: maze I (white-red)
[personal profile] mtbc
At work, I fell short of my usual high standards a couple of times lately, and found both interesting in that they relate to switching between languages.

I have a lot of experience in Java. I haven't used C++ much since twenty-five years ago and, even back then, I was not an advanced user, more a C plus objects plus streams, maybe, though I had already seen compile-time parameterized templates in Modula-3. The whole business of if I want a shared pointer or unique pointer or whatever, I never knew. I currently have a couple of C++ projects at work and, in one of them, when adding some code, I naively declared MyClass foo then assumed that foo is a pointer to an instance. Uh, no, this isn't Java.

I've used Python rather more recently but it makes for an unusual case in that I never had chance to take a week or two to simply sit down and study it systematically. For instance, when I started with Perl, my employer was happy for me to take a fortnight with the Camel Book and study it. So far, I've learned Python only by analogy and code snippets, until somebody gives me the time for a more organized approach. Anyhow, of course, I am used to seeing people initialize instance variables in __init__, like self.foo = "bar", I do it myself. However, in writing a new class, I absent-mindedly initialized the field before declaring the first method, as one may in Java. Thus did I receive a painful lesson in how to emulate Java's static.

Date: 2022-04-15 05:33 pm (UTC)
thewayne: (Default)
From: [personal profile] thewayne
My old method for teaching myself a programming language was to write a binary clock that displayed in the middle of a screen. It taught me a bunch of aspects of the language. It was in the days before OOP. But that was a long time ago, Python is the only language I've learned recently.

I'm divided about getting back into either server admin or data analysis, so R and OLAP might figure prominently in my future. We shall see.

Date: 2022-04-15 08:06 pm (UTC)
mindstalk: (Default)
From: [personal profile] mindstalk
What do you mean by binary clock? Digital like LCD?

Date: 2022-04-15 10:26 pm (UTC)
thewayne: (Default)
From: [personal profile] thewayne

It had three rows of eight binary digits, zeroes and ones, showing hours, minutes, seconds.  Centered on the screen.  Kinda fun.  Taught me string manipulation, screen addressing, looping, a few other things.  It was interesting, implementing it in different languages.  But it only used the five digits on the right.

Profile

mtbc: photograph of me (Default)
Mark T. B. Carroll

June 2025

S M T W T F S
1 2 34567
8 9101112 1314
15161718192021
22232425262728
2930     

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 13th, 2025 05:57 pm
Powered by Dreamwidth Studios
OSZAR »