What's the programming language for you?

This kind of thing is what I had always associated with JavaScript. But reading about it more online over the past year, I have decided that it seems like an interesting language. But I’d prefer if people don’t use it for naff web stuff.

1 Like

It’s an interesting language that keeps the chocolate bars in the same toolcase as the poop.

As long as you consciously ignore the poop, the language is fun and light and moderately powerful. Accidentally start using the darker elements of javascript, and you’re suddenly having a bad time.

My problem with Javascript is that while it’s perfectly fine for simple and clear projects, as soon as your project gets complex (no I don’t know the exact amount of complexity) then promises/async become a lot harder to read/follow/debug. It’s not an easy paradigm to wrap your brain around at that point. In fact, a lot of the things you can do to make things simpler begin to point towards using a fully functional language instead.

I also object to the fact that it’s MUCH easier to write Javascript if something else is writing it for you… CoffeeScript and ClojureScript, I’m looking at you…

1 Like

Any advice on what these darker elements are that should be avoided?

1 Like

Read Crockford’s book Javascript, the Good Parts.

You should avoid sync, with, missing semicolons, leaking scope, closures for the sake of closures… and the list goes on.

1 Like

Our main clear case guru uses it. Probably because that is what rational provides for scripting things. I spend too much time with the OS level of things still.

Now that I’ve got your attention:

Hello,

I am a recruiter for LogicSys Technologies. We have exciting job opportunities and are currently looking for C and assembly language embedded system developers in the Raleigh, NC area…

…I think I figured out the best way to find you people… :wink:

1 Like

I had a co-worker and good friend who wrote his own OS for small micro-controllers, long before Arduino or Raspberry Pie, or even system-on-a-chip.

He called it Directly Integrated Layered Device Operating System, or DILDOS for short. I think the whole reason he worked in embedded was just so all his projects could feature a startup scroll that read “Booting DILDOS…” during product review meetings.

3 Likes

Are there good assembly programmers looking for work? I would think that this skill would be in pretty high demand, especially people who understand the hardware/software interface.

1 Like

I’m not a C developer, but here’s a cool puzzler to ask people who identify as 8+/10 on the “Knowledge of C” scale: write code that prints all possible values of an int. Hooray for undefined behavior!

It only has a few possible behaviors, depending on the word size of the machine. I can’t afford the teleprinter paper to run it on this here 64 bit Windows box.

void main() {int i; do (i=0; i!=0; i++) printf(%i, i);}

1 Like

Oh it’s absolutely in demand.

For years I would have recruiters contacting me and they’d send me job lists to look over and then they’d all ask the same question: Do you have any friends who do embedded/firmware/microcontroller work?

Undefined behaviour is such a minefield, significantly exacerbated by the fact that there are many cases where behaviour is officially undefined, but is nevertheless handled consistently by most of the compilers you’re likely to run across

running with a sanitizer every once in a while can catch a lot of silly code bugs

2 Likes

Yeah, I should actually be putting out the same call - my company, Universal Avionics, is looking for some more embedded systems guys with experience for the Atlanta area. :slightly_smiling:

If anyone plans to do something bigger than just “be a programmer” then think bigger in the first place. Learn ETL and statistical programming if you want to do anything in the data sciences. Yes, be able to write code for the web and create apps, and dabble in machine language. To take it to the next level, you’ve got to learn some theory and how to put that theory into action. Few jobs these days are pure CS as in coming up with algorithms for the sake of math. Most jobs are applied, and in order to get those jobs, you have to specialize.

2 Likes

& what about Logo? Jeez what a n00b.

3 Likes

The only logo feature I ever used (the turtle) feels like the spiritual antecedent to the basic Hour Of Code tutorials.

1 Like

Excuse my C ignorance as a Java and JS programmer, but wouldn’t that print only the positive ints?

1 Like

Probably counting on an integer overflow there, though the existing code won’t compile of course. :wink:

1 Like

for (int i=0; i!=0; i++) printf("%i", i); - this will exit without ever running the loop, because it evaluates the condition before entering the first time

for (int i=1; i!=0; i++) printf("%i", i); - this will print all ints except 0, including the negatives, because when you overflow, it wraps around from MAX_INT (0x7FFFFFFF) to MIN_INT (0x800000000). This is technically undefined behaviour, but every compiler will handle it nicely the way you’d expect.

(hex values provided assume 32 bit int, which is standard in the contexts I work in)

ETA: apparently not all compilers! GCC can handle this case differently depending on the settings you compile with (-fwrapv)

4 Likes

I always wanted to learn C, but then I discovered that operating systems were written in C, and the only thing people do with Operating Systems is write even crappier programming languages and programs, so I figured why bother.

3 Likes