• Home
  • About
    • About The Coder
    • Language List
  • The Rules
    • Rule #1: Clarity Trumps Everything
    • Rule #2: Source Code is for Humans
    • Rule #3: Don’t Ignore Warnings
    • Rule #4: Comment As You Go!
    • Rule #5: Always Use Parentheses
  • CS-101
  • Python-101
  • Guestbook

The Hard-Core Coder

~ I can't stop writing code!

The Hard-Core Coder

Category Archives: CS101

Programming basics.

State Engines, part 3

25 Wednesday Nov 2015

Posted by Wyrd Smythe in CS101

≈ 2 Comments

Tags

computer, computer code, computer programming, computer science, Python code, state engine, state table

In the first two parts of this series I’ve introduced state engines and taken apart a specific instance of an engine. Now it’s time to tie together the design idea with approaches to building a variety of such engines.

Because the programming logic is in the state table, the engine can be fairly generic. That means it’s possible to create a state engine framework you can reuse for a variety of applications.

Continue reading →

State Engines, part 2

11 Wednesday Nov 2015

Posted by Wyrd Smythe in CS101

≈ 2 Comments

Tags

computer, computer code, computer programming, computer science, Python code, state engine, state table

Last time I introduced state engines and state tables. I showed parts of a simple implementation of one in Python. It parsed the language introduced in Little Programming Languages. This post continues that, so be sure you’ve read that first article.

I got as far as the state table implementing the process, and that’s where this post picks up. I’ll also get into the SourceReader class that does the heavy lifting.

Continue reading →

State Engines, part 1

08 Sunday Nov 2015

Posted by Wyrd Smythe in CS101

≈ 2 Comments

Tags

computer, computer code, computer programming, computer science, Python code, state engine, state table

At one point in my career, the state engine (SE) was one of my favorite AWK hammers. At the time much of the work involved text processing or, in some cases, serial byte processing (which is not quite the same thing). That sort of thing is right in the wheelhouse for a state engine.

They are a very useful tool and an important part of any programmer’s toolkit.

Continue reading →

Rule #4: Comment As You Go!

05 Monday Oct 2015

Posted by Wyrd Smythe in CS101

≈ 7 Comments

Tags

computer code, computer programmers, computer programming, programming language, real programmers, software development

There is a common tendency, as we crank out code, to think that we’ll come back later and write some really good comments — comments that future reviewers will view with admiration for their clarity, completeness, and humor. But if we’re honest we have to admit: Later never comes. We never go back and write those great comments. Often we don’t write any comments at all other than some placeholder we might dash off at the time.

Which is why Rule #4: Comment As You Go!

Continue reading →

Search & Replace Trick

16 Friday Jan 2015

Posted by Wyrd Smythe in CS101

≈ Leave a comment

Tags

input string, output string, search-replace, thoughts

I just thought of a way to avoid recursion or unintended replacement when doing a search & replace routine over a set of strings (or even one big string).

I thought I’d write it down here in case I ever want to come back to it. (Also as a potential point of conversation.)

Continue reading →

HTML is not a programming language!

22 Monday Dec 2014

Posted by Wyrd Smythe in CS101

≈ 5 Comments

Tags

computer code, computer language, computer languages, CSS, data, data type, HTML, Java, JavaScript, programming language, variables

A webpage is a text document written in HTML. This document may also contain CSS and/or JavaScript, but it’s basically an HTML text document. You could write one — including the CSS and JavaScript — using just a pencil and paper.

Despite not needing a computer to write, all three are computer languages — they are languages used by, understood by, computers (and trained humans). However only one of those (JavaScript) is a programming language.

This is a brief explanation of which is which and why.

Continue reading →

Getting to the Next Hill

23 Monday Jun 2014

Posted by Wyrd Smythe in CS101

≈ 1 Comment

Tags

computer programmers, computer programming, project estimation, project management, software design, software development

Last week I took my car in for scheduled service, and when I asked how long it might take, the guy said it was specified as one-and-a-half hours of labor. He could do that because there are thousands upon thousands of data points where a competent mechanic has performed that exact service, so there is a very clear idea how long it takes.

But ask a researcher how long it will take to find what they’re looking for, and the answer is usually, “I have no idea. I’ll know after I find it.” The path a researcher follows is usually new and unexplored, so it’s impossible to predict how long the path actually is.

Creating new software is much more like research than auto service, because it involves traveling unknown ground. Despite this, software development managers often act as if new development is predictable.

It often isn’t!

Continue reading →

Computer programming is hard!

16 Monday Jun 2014

Posted by Wyrd Smythe in CS101, Opinion

≈ 4 Comments

Tags

computer programmer, computer programming, computer science, software, software design, software development

Computer Programming is hard! It’s at least as hard as what commercial architects do, and I will argue that it’s as intellectually difficult as what doctors and lawyers do.

Many people think it’s easy, because they know some nine-year-old who “programs,” but there’s a difference between fooling around with the computer and building good software applications.

Continue reading →

Write a Formal Letter

10 Tuesday Jun 2014

Posted by Wyrd Smythe in CS101

≈ 1 Comment

Tags

code clarity, computer programmers, computer programming, readable code

Think of writing code as you think of writing a formal letter.

When you write a formal letter, you have two goals: you have a message to communicate, and you must follow the protocol of a formal letter. Your message comes through when your writing is clear and good. Following the protocol is a matter of knowing and following some syntax rules.

A message + formal syntax. The result is a document with a context.

Continue reading →

Rule #3: Don’t Ignore Warnings

13 Tuesday May 2014

Posted by Wyrd Smythe in CS101

≈ Leave a comment

Tags

compiling code, computer programmer, computer programmers, computer programming, errors, Java, software development, warnings

There have been times when, working on other people’s code, one of the first things that pops up is that their code generates thousands of warnings. I’m not exaggerating the number; there have been at least two times I can recall where someone’s code set generated that many warnings. And both times, the code set wasn’t all that large (only tens of thousands of lines).

Which leads us to Rule #3: Don’t ignore warnings!

Continue reading →

← Older posts
Newer posts →
Follow The Hard-Core Coder on WordPress.com

The Posts

  • Python String Translate
  • The Last Bug
  • Regular Expressions
  • Bits Bytes Chips Clocks
  • Loving the Lambda
  • Failure Tales
  • Naming Things (redux)
  • Calculating Entropy (in Python)
  • Building a Turing Machine
  • Python Tokenize

The Topics

  • Blog (4)
  • CS101 (35)
  • Fun (27)
  • Interesting (1)
  • Opinion (12)
  • Python (24)
  • Stories (15)

The Month

May 2023
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
293031  
« Oct    

The Past

Posts

RSS Feed

Comments

RSS Feed

Enter your email address to follow The Hard-Core Coder and get email when there is a new post.

The Main Blog

Visit Logos con carne

Lots of wyrds... with meat!

The Author

Wyrd Smythe

Wyrd Smythe

The canonical fool on the hill watching the sunset and the rotation of the planet and thinking what he imagines are large thoughts.

View Full Profile →

Create a website or blog at WordPress.com

  • Follow Following
    • The Hard-Core Coder
    • Already have a WordPress.com account? Log in now.
    • The Hard-Core Coder
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar