Skip to main content

Ralsina.Me — Roberto Alsina's website

Programming is not a goal.

I did a Q&A a few days ago, and one of the ques­tions was "How does one break the toy project / codecade­my cy­cle?" ... I am not sure what that mean­s, but I will take this as an op­por­tu­ni­ty to rant about some­thing I care about that seems (to me) vague­ly re­lat­ed.

You may be feel­ing like you are trapped in a cy­cle of just learn­ing things, us­ing them in a toy project and then... what? You learn some­thing else? And do an­oth­er toy pro­jec­t? And so on?

And you feel like that is to­tal­ly mean­ing­less and gives you no feel­ing of achieve­men­t, no mo­ti­va­tion, and end up feel­ing like you are go­ing to be a new­bie forever?

Well, if that's the case ... lis­ten to me.

Your toy projects feel mean­ing­less be­cause they are not re­al.

That feel­ing you have? It's just your in­ner pro­gram­mer telling you to stop play­ing around and start proogram­ming for re­al. And I am here to tell you how to do that.

STEP 1: Find something you need your computer to do that it doesn't do

You want your Youtube videos to ap­pear in your blog?

You want to be know how many peo­ple called Rober­to were born in 1934 in Ar­genti­na?

Well, imag­i­nary per­son, af­ter you found some­thing like that, you can move to step 2.

Let's say you have de­cid­ed to im­ple­ment a gad­get that drives away the birds that wake you up ev­ery morn­ing in this end­less night­mare we cur­rent­ly live in.

STEP 2: Decide some basic details about your goal

This is what is called a projec­t. Im­ple­ment­ing sort­ing al­go­rithms is not a pro­jec­t, that's an ex­er­cise. Im­ple­ment­ing the 200th ver­sion of a chat us­ing web­sock­ets for your "port­fo­lio" is not a pro­jec­t, it's, I don't know, a bor­ing ad­den­dum to your re­sumé or some­thing.

A project is a goal. A project is "I want my com­put­er to do THIS and in the holy name of Bil­ly Wilder, I in­tend to spend the ef­fort to make it do it!"

So: I want some­thing that when it de­tects bird sound­s, makes noise to drive them away.

  1. Lis­tens for nois­es
  2. De­cides whether they are bird nois­es
  3. An­swers with a noise that is un­pleas­ant to birds

STEP 3: Convince yourself that's a possible thing computers can do

Be­cause, you know, com­put­ers can do a lot of things, but com­put­ers can't do ev­ery­thing. So, you need a quick re­al­i­ty check. Make it very quick, you don't want to spend more than, like, half an hour on it.

  • Can com­put­ers lis­ten for sound­s? Yeah.
  • Can com­put­ers make sound­s? Yep.
  • Can sounds drive away bird­s? Yes sir!
  • Can a com­put­er de­cide whether the noise it hears is a bird or not? Well, may­be? I have seen stranger things!

STEP 4: Come up with a semi-rational mechanism to implement it

This has to be very vague. Like "yeah, I can do that us­ing this Google API and this piece of lint I found in my so­fa". A vague idea.

  • Im­ple­ment some­thing that lis­tens for noise.
  • Add some­thing in the mid­dle that de­cides if noise is bird-­like
  • Make noise de­tec­tion trig­ger code
  • Im­ple­ment some­thing that makes noise

STEP 5: Come up with the most stupid version of the goal you can imagine

So, you want to write a bird-de­tec­tor? Try writ­ing a noise-de­tec­tor, first. Or rather, try to find some­thing that can re­act when your mi­cro­phone de­tects noise. Or even, find a li­brary that gives you ac­cess to your mi­cro­phone.

So:

  • Find a li­brary to read sound from mi­cro­phone
  • De­tect noise
  • Find li­brary to make noise
  • Make noise
  • Con­nect both pieces

STEP 6: sit the fuck down and implement the stupid version

This should be done FAST. If you plan too much you are not go­ing to do any­thing oth­er than plan a lot. You want to be­come a pro­gram­mer, not a PM. I won­der what the PM ver­sion of this rant would look like.

STEP 7: Show the stupid version to someone you respect, and listen

Yes, this part is scary, but pro­gram­ming is, in large part, about peo­ple. Show­ing things to peo­ple, lis­ten­ing to peo­ple, find­ing out what peo­ple re­al­ly mean, and so on.

So: show it to some­one. Lis­ten. Make de­ci­sions about whether you were right in steps 3 and 4. Maybe ad­just a lit­tle what yoour goal is.

STEP 8: repeat step 5 to 7 with a slightly less stupid version

Do this un­til you run in­to some­thing you have no idea how to do. In this case that's prob­a­bly go­ing to be "de­cide if that's a bird's sound"

STEP 9: get help

Ask around. Again, pro­gram­ming is most­ly about peo­ple. In this case, you will prac­tice "get­ting help". You don't want some­one to just tell you how (or maybe yes?) but this is the crit­i­cal point.

You can run in­to a few sce­nar­ios.

  1. You fig­ure it out.
  2. You fig­ure out that it can't be done.
  3. You find out that it's doable but you just have no idea how.

If you fig­ure it out, then there is no prob­lem! Go back to step 5 and con­tin­ue un­til you are hap­py with the pro­jec­t, and you have learned some­thing new! Con­grat­u­la­tion­s!

The oth­er two out­comes lead to ...

STEP 10: get stuck

If you fig­ured out that it can't be done, then you have learned about one type of prob­lem that is cur­rent­ly in­tractable. Con­sid­er­ing you are new to this sort of thing, that is prob­a­bly not some­thing you are go­ing to solve, but ... if you re­al­ly were in­ter­est­ed in this pro­jec­t, it may point you to a whole kind of thing you want to learn about.

So, you can't de­cide if a giv­en noise is a bird ... why? Is there re­search be­ing done in that area? Would that in­volve ma­chine learn­ing? Hey, that sounds in­ter­est­ing. Usu­al­ly the ex­am­ples are about im­ages... is there any in­ter­est­ing work be­ing done about ap­ply­ing it to au­dio? Are there li­braries? Are there dataset­s? Are there tu­to­ri­al­s? Hm­mm ... and now you know some­thing you want to learn about. Have fun.

The third out­come is the com­pli­cat­ed one. Let's say it can be done by cre­at­ing a mod­el with ML and a dataset of ur­ban nois­es and a dataset of bird nois­es and both things ex­ist, and it has been done, and you know about it (a lit­tle) but you have no idea how to do it.

Well, in that case ... con­grat­u­la­tion­s, you have found the cur­rent lim­it of your com­pe­tence. You just need to ex­pand it. And that's what pro­gram­ming is like.

So, how does this whole convoluted process help you?

You are learn­ing dif­fer­ent things you won't learn do­ing ex­er­cis­es.

  • You learn to de­cide what to do.
  • You learn to ask for help.
  • You learn to present your work to oth­er­s.
  • You learn to process feed­back.
  • You learn to re­search your prob­lem space.
  • You learn to break down tasks.
  • You learn to make de­ci­sion­s.

And yes, you may learn a pro­gram­ming skill or two.

And, maybe (but it's un­like­ly) you will get rid of those pesky morn­ing bird­s.

PS: http­s://github.­com/karolpicza­k/BAD­C-2017


If you are in­ter­est­ed in a long com­ment thread about this, of which rough­ly 30% missed the point of this not be­ing some sort of uni­ver­sal ad­vice and there­fore tak­ing per­son­al of­fense at it, and 50% is me re­spond­ing to each and ev­ery com­men­t, see red­dit.

¿Es todo muy difícil, no?

Es difí­cil lev­an­tarse, es difí­cil labu­rar, es difí­cil parar de labu­rar, es difí­cil des­cansar, es difí­cil dormir, es difí­cil coci­nar, es difí­cil pedirle al otro que cocine, es difí­cil no coci­nar y pedir de­liv­ery, es difí­cil salir a hac­er las com­pras, es difí­cil no salir, es difí­cil ir a la ter­raza, es difí­cil la re­unión por zoom, es difí­cil con­cen­trarse, es difí­cil pro­gra­mar, es difí­cil hac­er videos, es difí­cil leer, es difí­cil es­cuchar músi­ca, es difí­cil dis­traerse, es difí­cil el chat del laburo, es difí­cil el chat de amigos, es difí­cil twit­ter, es difí­cil el noticiero, es difí­cil es­cribir, es difí­cil.

A week using tiling windows.

It has been a lit­tle over a week since I com­mit­ted to us­ing a tiling win­dow man­ag­er.

Sure, I am cheat­ing be­cause I am ac­tu­al­ly still us­ing KDE plus Kröhnkite but my win­dows are tiled and I am lik­ing it a lot.

Why this and not i3 or what­ev­er? Be­cause I don't want to change my lifestyle, I just want my win­dows to not over­lap gen­er­al­ly.

Kröhnkite pro­vides enough tiling func­tion­al­i­ty that I get (I think) the ben­e­fits with­out the mas­sive up­heaval of giv­ing up ev­ery­thing I am used to in my desk­top. I still use the Win­dows Key (ok, ok, the "Meta" key) to launch app­s. I still have a plas­ma pan­el with plas­moids at the bot­tom of my mon­i­tor, I can still float the win­dows if I want to! I can still use most of the short­cuts from my past 24 years us­ing KDE (yes, re­al­ly) and so on.

What are some things I had to change to adap­t?

  • I had to change to fo­­cus-­­fol­lows-­­mouse. BUT for the first time since I start­ed us­ing FVWM in 1993 I am lik­ing fo­­cus-­­fol­lows-­­mouse bet­ter than click­­-­­to-­­fo­­cus. It turns out KDE's im­­ple­­men­­ta­­tion of it is quite nice and al­­most "does what I mean". As it says in the doc­s, "like click to fo­­cus, but just don't click­­".

  • I re­­moved win­­dow dec­o­ra­­tion­s. Yes, you can keep them, but they feel out of place.

  • I set thick­­er win­­dow bor­der­s. Re­­siz­ing win­­dows via short­­­cuts is just not nice in gen­er­al, so thick­­er bor­ders help.

What are some things I have liked?

  • Fixed tiling lay­out in one mon­i­­tor and float­ing in the oth­­er is awe­­some when need­ed. And I can get it in place with one key­­press! So, in gen­er­al, dy­­nam­ic, sep­a­rate lay­outs for each screen is very, very use­­ful.

  • Hav­ing a "til­ing" wm that still re­spects most WM con­ven­­tions is good. So, pop­ups float. Yay.

  • The Al­t+En­ter short­cut to make a win­dow the "im­por­tan­t" one is neat.

  • Love how max­i­miza­­­tion/min­i­miza­­­tion work­s.

What are some things I have not liked?

  • The "tiled" lay­out has mul­ti­­ple ver­­sions you can switch be­tween with Ctr­l+I/D ... and well, some­­times none of them is ex­ac­t­­ly what I wan­t? Al­­so, the high­­er num­bered ones on­­ly are use­­ful when you have many win­­dows tiling, and if you don't they don't do any­thing.

  • Since I have no win­dow dec­o­ra­tions, the bru­tal in­con­sis­ten­cy on ap­p-quit­ting short­cuts is an­noy­ing. It can be ctr­l+q or ctr­l+x or esc or what­ev­er. I end up do­ing al­t+f4 which feels like win­dows 3.11.

  • The UX of KWin scripts is a bit lack­­ing. I in­­stalled an­oth­er one a while ago, called Quar­ter-Til­ing, and I have re­­moved ev­ery trace of it from my sys­tem... ex­­cept for its short­­­cut­s, which will ap­­par­en­t­­ly pol­­lute my con­­fig di­alogs for­ev­er.

So, ex­per­i­ment will con­tin­ue!

(Sor­ry, the video is in span­ish)


Contents © 2000-2020 Roberto Alsina