Showing posts with label coding. Show all posts
Showing posts with label coding. Show all posts

Monday, 29 January 2018

In which I contemplate an old project

I have been attempting to learn Java, in some vague and undefined way, because the company is looking to the possibility of moving to more modern technologies, because it would be useful to have some broader professional skills, and because learning things is always cool. Like many things that are done in a vague and undefined way, I did a whole bunch in a great rush of enthusiasm and then other things got in the way and I ceased having the time to work on it.

But while I was in that rush of enthusiasm, I set myself a project. Nothing too fancy, just reading an input file and choosing a line at random to output. Like so:

If you can't read it, it says: You totally know how to code in Java!
A little silly, perhaps, but it was a good way of practising working with files, building array lists, working with individual rows in the array list, and even messing around with interfaces using Swing. It was cute, and I was pleased with it.

I had vague thoughts of turning it into an Android app, just to play with making an app rather than because I thought it was something the world needed. Though it would have been fun to have it on my own phone. But instead I got distracted by a friend challenging me to have it generate the encouraging phrases at random, using separate files of different sentence components.

I achieved that, but not in a way that felt satisfying. The encouraging phrases were all too similar, restricted by the need to start from pieces that could work with any other piece. It felt flat, and less encouraging than the original. Maybe that's a failure on my part, either failing to feed it sufficiently interesting components or failing to code it in a sufficiently flexible way. The possibility certainly niggles at me.

So, as and when I finally come back to this instead of putting it off in favour of editing (Words of Power is officially into its second draft now!) or crocheting or Pokemon (Ultra Moon, right now), do I go back to the app idea or do I work on trying to improve the text generator? My feeling is that the app is closer to the idea that got me excited in the first place, but maybe the text generator would be more of a challenge. And I do love me a good challenge...

Tuesday, 12 May 2015

In which strange things are afoot at the Circle K...

Things are happening at the moment.  Some of them I can't talk about, not least because those are the ones where I don't actually know what's going on myself.  I have my suspicions, but they're so wildly implausible that I'm sure I must be wrong.

But I didn't just come here to be intentionally mysterious.  There are things that I can talk about, like the fact that I'm about to start learning to support some new stuff at work.  We're being given stuff to do with Enterprise Service Bus, TIBCO and XMLM messaging.  It all seems a bit daunting at the moment, but then it's not been that long since I was having to learn COBOL from scratch, so I'm sure I can handle it.  And it all ties in nicely to my team's general conviction that we're the only ones who actually get stuff done.

Also new is the cat that's currently curled up asleep on the sofa next to me.  I'd take a picture, but he's solid black so photographs don't come out well, especially when his eyes are closed.  His name is Garrus, he's about three and a half, and he is the Softest Cat Ever.  Soft as in his fur, but he's also extremely placid and fond of company.  We acquired him from a friend who's about to move to Sweden and can't take him along.

Last but not least, I have multiple stories out acquiring rejections these days.  I've got quite a fine collection that I'm lovingly curating.  So far, only one story has been a disappointment and actually got itself accepted somewhere...

Yes, that's right, I'm having a story properly published.  It will be appearing in the very first issue of Shoreline of Infinity, which is due out next month.  Clearly fame and fortune beckon from here on in.  I'd be up for a Hugo next year if I hadn't foolishly made the protagonist a Japanese woman...

Thursday, 2 October 2014

Coding and Poetry

It's National Poetry Day, apparently, so I thought I should finally tie up the loose ends from the COBOL poem I posted the other week.  Loose ends like what on earth possessed me to write a poem in COBOL...

It all started with a blog post from Girl on the Net, detailing the filthy things she'd like to do to programmers (link probably NSFW, needless to say).  More power to her elbow, I say, though since I work in an open plan office none of the things she's thinking of would be even remotely feasible.

Anyway, that was where it started.  Following on from that, via the magic of Twitter, I found myself reading an elderly article about poetry in Perl.  And this is where the trouble started.  That article makes a couple of snarky comments about COBOL, like "getting a volunteer to write poetry in COBOL is likely to be impossible."  So what was I supposed to do?  Just let it pass?  No, I couldn't really ignore the gauntlet that had been thrown down, even if it was a gauntlet that only I could see.  So I sat down, and I wrote a COBOL poem, and I posted it on here.  And then I sent it to Girl on the Net and the individual who'd linked to the Perl article, just because.

Don't worry, I'm not about to announce that I've now compiled an entire anthology of poems in COBOL, or in other obscure programming languages.  Though I did write a haiku in Spectrum BASIC while messing around on Twitter:

10 PRINT "Forever"
20 PRINT "I will love you"
30 GOTO 10

Anyone who bothered to look at the comments on the COBOL poem, however, will have seen that I was challenged to write something using Inform 7.  Something that would work as a code poem and as a piece of interactive fiction.  In the end, I wrote two.  Sort of.

See, although Inform 7 is practically English anyway, it's still code.  And it's code designed for a very specific job.  The closest I got to actual poetry in the code wasn't a very good piece of IF; you can examine a couple of things and there's a single command that allows you to win, and that's it.  Otherwise you just expire after about five turns.  It's very poetic and lovely, but it's a bit rubbish to actually play.  The other one managed to be slightly (but only slightly) more engaging as IF, but wasn't much cop as poetry as a result.  To make good IF you need to build a rich environment and then nail down absolutely everything the player might consider doing; poetry works better when you skirt around the edges and hint at things.

So I shan't be posting the results, as interesting a challenge as it was.  They were sent to my challenger, as proof that the challenge had been completed (and since he didn't write anything I win by default!), but they won't be seeing the light of day as poems.  Maybe as IF, if I work on them a little more someday.  Or maybe I'll write something else instead.

You are in a maze of twisty little passages, all alike...

Thursday, 11 September 2014

COBOL Poetry

 IDENTIFICATION DIVISION.
 PROGRAM-ID. POETRY.
*
***********************************************************************
* THIS IS WHAT HAPPENS WHEN I READ ABOUT PEOPLE WRITING POEMS IN PERL *
* AND THE ARTICLE SUGGESTS NO ONE WOULD EVER WRITE ONE IN COBOL       *
*            CHALLENGE ACCEPTED!                                      *
***********************************************************************
*
 ENVIRONMENT DIVISION.
*
 DATA DIVISION.
 WORKING-STORAGE SECTION.
*
 01 WONDER-IF-YOU-LOVE-ME  PIC X(1).
      88 YOU-LOVE-ME         VALUE 'Y'.
      88 YOU-LOVE-ME-NOT     VALUE 'N'.
*
 01 MY-BEST-SIDE  PIC X(40) 
                  VALUE 'ALL NEUROSES HIDDEN SO YOU WILL LOVE ME.'.
*
 PROCEDURE DIVISION.
*
 HOW-TO-MAKE-YOU-LOVE-ME.
*
     IF YOU-LOVE-ME
        CONTINUE
     ELSE
        PERFORM TO-WIN-YOUR-LOVE
     END-IF
*
     GOBACK.
*
 TO-WIN-YOUR-LOVE.
*
     PERFORM UNTIL YOU-LOVE-ME
        DISPLAY MY-BEST-SIDE
     END-PERFORM
*
     EXIT.
*

Tuesday, 11 March 2014

A Permanent Fixture

Today I got the official confirmation that I have passed probation and am now employed in a permanent capacity at the COBOL factory. Needless to say, this pleases me immensely.

The odd thing is, a year ago I'd sworn I wouldn't go after a job like this. After hopping around through various temporary and retail jobs, I'd finally settled into something I thought I could see myself pursuing as a career (online marketing and SEO, if you must know). And so I'd told myself that I was going to do exactly that. The job I was in wasn't exactly brilliant in terms of pay and conditions, but I thought I could take the experience and use it to get a better job doing the same sort of thing somewhere else.

But life's a funny thing, ain't it? As soon as I decided to focus on looking for marketing jobs, an advert in the local paper for this position caught my eye. I was done with trainee positions, I thought, but as previously discussed I've always had a hankering to code. So I took the plunge.

There were certain provisos. I wouldn't have taken the job if there had been any suggestion that a job wasn't guaranteed at the end of the six months. If the four of us who were taken on had been competing for a single position when it was over, I'd have stayed in my old job. I'm too old to take that kind of risk these days, especially with a mortgage and Small Girl to consider. Fortunately it was made clear that if we were all up to scratch then we'd all be kept on (and indeed that's exactly what has happened).

The time between accepting the job offer and actually starting was tense, to say the least. First there were the hurdles to jump; a ten-year background check that had to be completed before the job offer would be absolutely concrete. Then there was the general fear of the unknown, the panic that making this leap would turn out to be a bad idea. That disappeared as soon as I got here and started learning. The phrase 'duck to water' has seemed fairly apt over the last six months.

I got some very nice comments on my final probation paperwork today. In particular, it was nice to see an acknowledgement that, although I may make it look easy, I'm actually working damn hard. I'm blessed with a good memory (for things I actually want to remember, anyway) and the right sort of mindset to approach a coding problem in a reasonably structured manner, but those things alone don't get you through. I have a folder packed with notes that I refer to regularly, links to useful sites for researching commands and syntax, and a certain amount of dogged perseverance that often leads me to spend time looking for elegant solutions rather than just taking the easiest route. I've been less likely than the others to ask for help from others in the office, but that's not because I don't have the same problems as them. It's just because I prefer to try to solve the problems myself and hopefully learn something in the process.


In some ways, I can relax now. I've passed, I've got the job, panic over. In other ways, the hard work is only just starting. Now is the point where I really need to prove myself, to get myself established as 'programmer' and not just 'trainee'. I can see a lot of rungs on the career ladder above me, and I'm ready to start climbing.

Tuesday, 18 February 2014

Why I Didn't Become a Programmer Until Now

Prepare yourself for a tragic tale of wasted potential...

As a child, I loved computers. We were a ZX Spectrum family, and my parents both took the time to learn BASIC and write programs for it. They even had listings published in magazines (and my mother these days is referenced on World of Spectrum, thanks to one of her programs being in an issue of 16/48's tape-based magazine). So the groundwork, the opportunity, was there. I dabbled in learning BASIC myself, thanks to an Usborne book or two, though at that age I was mostly content to just type in listings or play commercial games. By the time I was old enough to really consider coding, the Spectrum was already obsolete (sob).

That's not to say I didn't still dabble. I recall, in my first year of secondary school, writing some code on an ancient BBC Micro for a technology project. Something about helping new students to find their way around, if I remember correctly. Coding was an option, so while other people were cutting up wood to make signs I was joining forces with another kid to write a program that would give you directions based on the room number you entered. Fairly simple stuff, though it would have been truly unwieldy if we'd ever tried to write it to handle more than about four rooms.

And then we got to GCSE, and the ill-fated Information Systems course. We were told in advance that this was a hard course; that we needn't think it would just be two years of 'messing about on computers'. It wasn't a course for lazy students looking to muck around. That's what they told us and so, being a diligent, bright student who liked computers, of course I signed up for it.

What I got, sadly, was two years of messing about on computers. The school didn't have any dedicated IT teachers, so the course was taught by Maths and Chemistry teachers in their spare time. That didn't help, but I'm not sure having a proper IT teacher would have made much difference. There wasn't a single piece of coding in the course. We learned instead about how to use ClipArt and snazzy fonts to jazz up a poster for a school fĂȘte. We learned about how a computer system could help a supermarket with sales and stock control, but might not be so helpful for a small corner shop because of the costs involved. We possibly learned about the SUM formula in Excel, but no macros or pivot tables or even any of the more interesting formulae.

Looking back, I can see that this wasn't the sort of course I was expecting or even a very useful one to have been taught. At the age of fifteen, though, I lacked that sort of awareness. All I really knew back then was that I'd signed up for a computer course and spent two years utterly bored stiff. I blamed computers for that boredom, rather than the course, and turned my attention to other things at A-Level and at university. Computing was not for me, I decided.

By the time I realised my mistake, while hanging out with CompSci students at university, it was too late. I was already deep into a Philosophy degree, with a minor in Creative Writing, and there was simply no way of altering things. I took a unit in Formal Logic as part of Philosophy, the one unit I received a First for, but that was as close as I got. The door was closed and there was no reopening it.

It didn't entirely stop me trying. I applied for a couple of 'trainee programmer' roles after university, but without success. I dabbled in the odd bit of programming at home, but the trouble with trying to learn code by yourself is that you need an idea of what you want to achieve. I picked up HTML because I could use it to make silly websites with Lego minifigs doing ridiculous things, but I never had the same options available in other languages. There are only so many business reporting exercises you can do out of a textbook before getting bored and going to do something else, if you don't have a teacher standing over you waiting for your results.

And then this opportunity at the COBOL factory came up. And somehow this time I was successful in my application (twelve years of real work experience and a better interview technique may have had something to do with that). So now I've finally been taught to code, in the way I never was before, and I love it. It comes easily to me, somehow, and as happy as that makes me it also makes me sad for what might have been. What might have happened if I'd been given a proper course at GCSE, or if I'd recognised the weaknesses in the course I did do and looked at doing something coding-related at A-Level or with my degree? Have those twelve years of working, frequently in retail jobs for various reasons, been a complete waste of my potential?

Somewhere, there's a parallel universe where I went a different way. And maybe in that universe I minored in CompSci at university and got put off by the mouthbreathing geeks who didn't know how to react to an actual female person in their midst (unlikely, given that I dated a few in my time as it was). Maybe I still failed to get a job in programming and ended up on the same career path anyway. Maybe by now I'd be earning a comparative fortune writing ground-breaking software (something that will never happen while I'm working in COBOL, I know). Sadly, it's the nature of the world that I'll never know what might have happened. But I can be happy to be here at last, and I can certainly learn from my mistakes. I'll be watching Small Girl's interests and potential closely, whatever they may be, to make sure she doesn't get put off from something for the wrong reasons.


And in the mean time, I've got code to write.