More JavaScript vs C#/C++

I ranted before on JavaScript vs C#/C++ and for some reason I was in the mood to revisit that.

Basically the last 2 years I’ve been mostly in JavaScript land. Like most C++ programmers I hated it at first. But now I find it hard to have any desire to switch back. Of course I’ll program in whatever language I need to to do the job. C++ if I’m Unreal. C# if I’m in Unity.

But, kind of like J-Blow mentioned in his first few videos it’s frustrating every time there is busy work to do in C++ or C# that there is not when in JavaScript. To be clear he only mentioned his frustration with C++. AFAICT he has no serious experience with JavaScript. I expect he’s at stage #1 or stage #2 at best
Read more…


As fun as it is to make vertexshaderart I’m also tweaking the site

So for example, while this is probably a bad idea as it might end up costing me more money I cleaned things up a little so you embedding is nicer

This one uses the mouse. It’s based on art by paweĊ‚ which is linked to below.

Figuring out how to get a good response in the visuals so far as been just a guessing game. This one mostly seemed to work once the song really gets started.

This one too

And just trying new stuff

You can see a particular person’s creations for example P_Malin has made some pretty great pieces.

For a given piece you can also see the revisions

And you can mark pieces as private if you want to work on them before letting others see.

I’m trying to figure out how to get more variety on the main page. Originally I had “popular” which was just by likes but the same few things were always at the top. I might do something like aging things so the older they are the more likes or views they need to stay at the top but at the same time I don’t want to see the main page covered with uninteresting stuff like some of mine so I’m not sure what to do there. If you have ideas comment below.

Your challenge should you decide to accept it: Given only a count that goes from 0 to N generate vertices and colors

Read more…

Too Many Dependencies

I’m using meteor to get something done and I needed to implement “likes” as in something you can click to “like” something and then that thing can display a number of likes.

There’s a package that helps with this in meteor. It’s called “socialize likeable” and it seems fine. The code is not too big. I skimmed the code to see what it was doing. Before that I had thought about different ways to implement such a feature and from reading that code helped inform my own ideas about the what was probably the right way to do things. It was doing it that way so I go to install it

It installs 9 more dependencies
Read more…

Meteor's downsides

Meteor is a really cool framework for making websites. It runs on node.js and by default it uses mongo db (you can change that). It’s a “fullstack” framework meaning it handles both the server (backend) and the client (browser).

You can install it and have their samples up in minutes. They have publishing utilities to help you get it up live on the internet either through their hosted service or through other means.

It’s got some really nice features. Code is easily shared across backend and browser. You can access data on both sides with nearly the same code. It’s got live updating of data and code. It’s really awesome!

Except … AFAIK it’s EXPENSIVE to use. Another way of putting that is it’s not for hobbies, only for serious stuff. Let me explain
Read more…

My Love / Hate Relationship with Stack Overflow

I have a kind of love hate relationship with Stack Overflow (SO).

I love that I get answers. I hate that I spend so much time writing answers and then see SO make bank from my work.

I’ve probably spent over 1000 hours writing answers on SO. Most of that time is spent writing working samples for answers. In fact was started because of answers I wrote on SO where it they seemed too long for SO.
Read more…

Less Libraries more Code?

I saw this talk recently

which if I understand correctly and a very interesting point of view which in one way could be summed up as “write more code and less libraries”. Yea I know that sounds controversial. Watch the video and see what you think.

If I tried to summarize here’s what I took away:

It seems like writing libraries is a good thing. It makes your code smaller. It makes it easier to read. It makes it possible edit the library and affect lots stuff. The problem is, especially if you’re a company like Facebook with thousands of programmers working on the same code base is that there’s no way to organize all the libraries. Everyone is going to write their own libraries. That means someone using their code has to first go learn their libraries. Whereas, if you had just written the code instead of using a library and you had use common patterns to write your code then the code would be understandable by others quicker.

Now, he wasn’t saying write zero libraries. What he was saying though is make sure your library is solving a problem and not adding more problems. He gave some examples, one being AngluarJS which I haven’t used but it is/was all the rage for web dev for the last 2-3 years. He claims that while it solves some big issues and therefore solves lots of bugs it also is a very complex api with a very large number of functions and that complexity in his opinion outweighs the benefits. In other words it’s a net negative.

I have a feeling I’m not going a good job of summarizing his POV.

He is specifically talking about JavaScript so for example one idea/opinion he had is don’t make custom libraries when there is a standard that would solve it. Write a polyfill (in other words write a library that implements the standard for browsers that don’t yet support it). That way your code will follow the standard which eventually everyone will know vs custom library #749 that only you know.

Anyway I’m not sure how much I agree with this idea. I think it totally makes sense for Facebook and possibly for Google and other giant teams. But, I wonder if the same is true of a small team or a team of 1. Maybe it does. Or maybe at least thinking about “is this library going to add more problems than it solves in the long run” before writing one.

Well, something to consider at least.

Thoughts of a C/C++ programmer after years in JavaScript

If you haven’t read the 4 stages of a C/C++ programmer using JavaScript this is a follow up on that so you might want to read that first.

Not that anyone reads this website I only update 3 times a year now but before you get your stockings in a bunch I’m not saying JavaScript rocks. I’m only saying that after using it for many years there’s things I’ve come to love that I now can’t stand when I’m not in it. Example include

(*) no setup

Every device has a browser.

(*) useful apis that just work across platforms

including canvas, webgl, audio api, camera access, gps, etc

Think about what I’ve have to do in C++ to get a cross platform canvas2d like API. I’d probably have to build Skia which is like a gazillion lines of code. I’d have to figure out what bazillion options to pass it etc, watch it compile for 10-15-20 mins and hope no obscure errors pop out.
Read more…

The 4 stages of a C/C++ Programmer using JavaScript

Stage #1: Time T = -3 years:

What a stupid scripting language. I haven’t used it but it’s a scripting language and scripting languages suck. It’s not useful for anything other than form validation. Who cares. I’ll never use it except maybe to make a form not double submit on my personal website.

Stage #2: Time T = 0:

Ugh, I’ve got to do some stuff in JavaScript for this project. Fuck this language sucks. What the fuck is up with those global variables. What do you mean braces don’t define scope. Well at least I found some stupid way to make classes and inheritance work.

Stage #3: Time T = +3-5 years:

Wow, if I use closures creatively and everywhere JavaScript is pretty interesting. All this async stuff happening for free. And all these APIs that just work. I can put something on the screen without needing 14 libraries and spending a week trying to figure out how to get a window to appear. I don’t have to figure out how to render fonts on 7 different platforms in 17 languages. I can download images, draw stuff in canvas and WebGL, play audio, access the camera and mic and with very minor hiccups it just works. I get immediate feedback, just refresh. Stuff can be styled by my designers without my having to write tons of code and when I want to show someone I just send them a link. This is pretty awesome.

Stage #4: Time T = +5 years:

I’m going to do some C/C++ programming again. Ugh! WFT this stuff no longer compiles! Why doesn’t this project load in my IDE anymore. They must have changed the format. DAMMIT why doesn’t libglfobar link? Ugh! What? I’ve got to write 200 lines of meta-templating code just to make generic callbacks? Fuck! Why is this so tedious! Oh you want to check it out? Sorry I don’t have access to a Mac to compile it for you. Sorry. Fuck I hate C/C++!

followup here.


Tweening probably has many definitions. I heard one guy call it mapping as in mapping one
range to another range. I’ve always called that lerping. The simplest lerp is something like

     value = start + (end - start) * lerp

Then given lerp goes from 0 to 1 value will go from start to end.
Read more…

Page 1 of 2812345...1020...Last »