tag:blogger.com,1999:blog-24593660603011846022024-03-08T10:21:52.321-06:00Randomly CraigRandom thoughts from Craig Treptow.Craig Treptowhttp://www.blogger.com/profile/12090900006288638519noreply@blogger.comBlogger31125tag:blogger.com,1999:blog-2459366060301184602.post-7726455153436494962023-08-16T12:38:00.003-05:002023-08-16T12:38:16.932-05:00It's been a while<p> I don't put the effort into this that I thought I would. Regardless, I thought I would just say "out loud" that I think Elixir is going to be the language for me. After having gone through looking at Elixir, a tiny bit of Elm, Scala, and Haskell, Elixir is the one that sparked joy. Scala had its moments, as well.<br /></p><p>So, to get back into the Elixir mindset, I decided to go through <a href="https://leanpub.com/elixir-toyrobot/" target="_blank">The Toy Robot</a>. Once I get through that, well, I will likely work on a ray tracer, but may also do something with the mandelbrot set. We shall see.</p>Craig Treptowhttp://www.blogger.com/profile/12090900006288638519noreply@blogger.com0tag:blogger.com,1999:blog-2459366060301184602.post-62984995299495714982021-08-22T18:00:00.036-05:002021-08-22T18:00:00.176-05:00Perils of a newbie player<p> I first encountered disc golf back in 2017. I played a little bit and then for reasons I don't remember, I kind of walked away. Skipping ahead to the Spring of this year (2021), I decided to try it again. I'm glad I did. I love it.</p><p>Living in a state with <a href="https://www.reddit.com/r/discgolf/comments/hjat3n/most_disc_golf_courses_per_capita_us_states/" target="_blank">so many courses</a>, there is no shortage of choices. In my case, I have spent the most time playing <a href="https://www.dgcoursereview.com/course.php?id=2023" target="_blank">in Norwalk</a>. It is enjoyable, but I have been paying to play in the form of lost discs.</p><p>Now that the plants have grown up (mid to late Summer), anything that goes into the weeds over the small creek is pretty much lost for now. I keep playing and hoping I'll find some of mine, but all I've found is somebody else's. :(</p><p>I have had a few people find my discs. I was able to meet one and get it back. Another is supposedly going to drop it off at <a href="https://titandiscgolf.com/pages/titan-disc-golf-des-moines" target="_blank">Titan Disc Golf store</a> for me to retrieve, but I've yet to check and they have not told me they dropped it off. In another case, after a week of messing around playing phone tag, the person finally "stashed" it under the skateboard ramps in Norwalk. Oddly, hours later a disc of mine was found "in the ditch". </p><p>So, even though the community seems friendly and is quick to let you know they found a disc, the remaining 90% of effort to actually get it back in your hands is proving to be very tough.</p><p>I'm not sure of the answer, but dropping them off at Titan might be the smart play going forward. Any answer I've thought of is basically a variation at dropping it off there. It's a little inconvenient for me, but still better than the methods I've tried so far.</p>Craig Treptowhttp://www.blogger.com/profile/12090900006288638519noreply@blogger.com0Des Moines, IA 50320, USA41.5359175 -93.57114659999999213.225683663821151 -128.7273966 69.846151336178849 -58.414896599999992tag:blogger.com,1999:blog-2459366060301184602.post-3625353708544620732021-05-10T12:49:00.002-05:002021-05-10T12:49:37.888-05:00<p> I have recently waffled between Haskell and Scala in terms of learning. Well, I'm back on Scala. :)<br /><br />I've found that working with OOP and trying to completely change how I think to do FP in Haskell was really tough. I wanted to make things a little easier on myself, so I'm back with Scala, but 80% OOP and 20% FP.</p><p>The real thing I'm looking to dig deeper is the type system, but in a little bit more familiar territory.</p><p>So, to that end, I've tried taking a little more practical approach. I have started <a href="https://www.learningscala.dev/">my learning scala site.</a><br /><br />The purpose of that is to build a site, while I learn. It combines Scala and the Play framework.</p><p>I was turned onto <a href="https://underscore.io/books/essential-play/"><i>Essential Play</i></a> book by somebody on the <a href="https://corecursive.com/">Corecursive podcast</a>, and it's been very useful. I was figuring some basic things out, and go stuck on how to connect to a DB and manage the schema and migrations. Hopefully this book will help with that as well.</p><p>As I make some progress I hope to write these sort of posts there as well. I'm hoping it can prove useful to others trying to learn the same material.</p>Craig Treptowhttp://www.blogger.com/profile/12090900006288638519noreply@blogger.com1tag:blogger.com,1999:blog-2459366060301184602.post-89520545629364048262020-09-13T18:00:00.023-05:002020-09-13T18:00:12.397-05:00For my listening pleasure<p>Listening to podcasts has really grown on me over the last few years. Now that I'm working from home full time due to the Covid-19 pandemic, I thought I would share what I've been listening to:<br /></p><ul style="text-align: left;"><li> Regular listens</li><ul><li>Command Line Heroes</li><li>CoRecursive <br /></li><li>Dev Discuss</li><li>Factually</li><li>Freakonomics Radio</li><li>got science?</li><li>How to save a planet?</li><li>Lambda Cast <br /></li><li>Levar Burton Reads</li><li>No Stupid Questions <br /></li><li>NPR Life Kit (Money, Health, Parenting)</li><li>NPR Up First</li><li>NPR Throughline</li><li>People I (mostly) Admire <br /></li><li>Short Wave</li><li>Software Sessions</li><li>Stuff You Should Know</li><li>Species <br /></li><li>Scala Logs</li><li>Scala Love</li><li>Software Engineering Radio</li><li>The Bike Shed</li><li>The Way I Heard It</li><li>Thoughts on Functional Programming (Lisp Cast) <br /></li><li>Who Is?</li></ul><li>Occasional Listens (depends on the episode)<br /></li><ul><li>The Joe Rogan Experience</li><li>The Changelog</li><li>Full Stack Radio</li></ul></ul><p>Some standouts include:</p><ul style="text-align: left;"><li>Stuff You Should Know - Informative and funny</li><li>NPR Throughline - History...made interesting</li><li>Freakonomics - Super interesting almost every time</li><li>Levar Burton Reads - Short stories read by Commander LaForge. Very good production. <br /></li></ul>I wish I could find active Haskell related podcasts, but I know of none. Some have tried to make them, but couldn't sustain the energy to keep them going, I guess. <br /><div><p> </p></div>Craig Treptowhttp://www.blogger.com/profile/12090900006288638519noreply@blogger.com0tag:blogger.com,1999:blog-2459366060301184602.post-51485056611183342020-07-22T11:00:00.000-05:002020-07-22T11:00:03.070-05:00Scala to Haskell<div>I previously <a href="http://blog.craigtreptow.com/2020/01/haskell-to-scala.html" target="_blank">wrote about</a> switching my learning efforts from Haskell to Scala. I've switched back. ;)</div><div><br /></div><div>It was a combination of things. I was enjoying Scala, but had this nagging feeling about being able to fall back to OOP concepts if I couldn't figure out how to do things in FP style. This was nagging me as I was working on my ray tracer. I was enjoying the book <a href="https://fpsimplified.com/" target="_blank">"Functional Programming Simplified"</a> though. I'll go back an finish that at some point.</div><div><br /></div><div>A few weeks ago, a coworker asked me to do a lunch and learn presentation that I had once said I'd do. Well, that was around a year ago that I said I'd do something on Haskell. Then, holidays happened, there were scheduling difficulties and the whole pandemic started. In the intervening months, I had switched to Scala. So, I said "yes" anyway.</div><div><br /></div><div>I started trying to prepare a L&L presentation on Haskell and realized that I remembered some things and that I had not given Haskell enough energy to learn. This started me back on Haskell with fresh eyes.</div><div><br /></div><div>I've started <a href="https://gitlab.com/CraigTreptow/hayz" target="_blank">a ray tracer</a>, of course. I'm liking it more this time. I'm forced to think harder and dive into Haskell libraries and pure FP techniques.<br /><br />So, I now to finish the book and ray tracer this time, no matter what. Then I can move on to another project. Maybe a bowling kata? We'll see.<br /></div>Craig Treptowhttp://www.blogger.com/profile/12090900006288638519noreply@blogger.com1tag:blogger.com,1999:blog-2459366060301184602.post-76054937618014358132020-03-09T19:44:00.004-05:002020-03-09T19:44:59.226-05:00ScrayzWork has finally slowed down enough that I have inched my Scala based ray tracer along, just a tiny bit.<br />
<br />
I'm keeping the code on <a href="https://gitlab.com/CraigTreptow/scrayz">gitlab</a> this time, and so far it has been different, but problem free. CI is built in on GitLab, but it did take a bunch of fiddling due to me not understanding a bunch of stuff, and out of date docs (of course). So, on the CI side of things, I think it will run my tests on push now. Next up will be to enable Coveralls, "just because". <br />
<br />
<br />
Now that I have that going, I started flipping through <a href="http://raytracerchallenge.com/">the book</a> a little bit again.<br />
<br />
The first step (after reading) is to get the tests written. Luckily there are files full of features to start with. So, that's exactly what I'm going to do using <a href="http://www.scalatest.org/" target="_blank">ScalaTest</a>. It supports multiple styles, but to stay with the style in the book, I'm going to use <a href="http://www.scalatest.org/user_guide/selecting_a_style">FeatureSpec</a>.<br />
<br />
Itt is fairly straightforward at the top-most level to get the tests in a format ScalaTest likes:<br />
<br />
<pre style="background: #000000; color: #d1d1d1;"><span style="color: #e66170; font-weight: bold;">import</span> org<span style="color: #d2cd86;">.</span>scalatest<span style="color: #d2cd86;">.</span>FeatureSpec
<span style="color: #e66170; font-weight: bold;">import</span> org<span style="color: #d2cd86;">.</span>scalatest<span style="color: #d2cd86;">.</span>GivenWhenThen
<span style="color: #e66170; font-weight: bold;">class</span> TupleFeatures extends FeatureSpec <span style="color: #e66170; font-weight: bold;">with</span> GivenWhenThen <span style="color: #b060b0;">{</span>
feature<span style="color: #d2cd86;">(</span><span style="color: #00c4c4;">"Tuples, Vectors, and Points"</span><span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span>
scenario<span style="color: #d2cd86;">(</span><span style="color: #00c4c4;">"A tuple with w=1.0 is a point"</span><span style="color: #d2cd86;">)</span> <span style="color: #b060b0;">{</span>
Given<span style="color: #d2cd86;">(</span><span style="color: #00c4c4;">"a ← tuple(4.3, -4.2, 3.1, 1.0)"</span><span style="color: #d2cd86;">)</span>
Then<span style="color: #d2cd86;">(</span><span style="color: #00c4c4;">"a.x = 4.3"</span><span style="color: #d2cd86;">)</span>
<span style="color: #e66170; font-weight: bold;">And</span><span style="color: #d2cd86;">(</span><span style="color: #00c4c4;">" a.y = -4.2"</span><span style="color: #d2cd86;">)</span>
<span style="color: #e66170; font-weight: bold;">And</span><span style="color: #d2cd86;">(</span><span style="color: #00c4c4;">" a.z = 3.1"</span><span style="color: #d2cd86;">)</span>
<span style="color: #e66170; font-weight: bold;">And</span><span style="color: #d2cd86;">(</span><span style="color: #00c4c4;">" a.w = 1.0"</span><span style="color: #d2cd86;">)</span>
<span style="color: #e66170; font-weight: bold;">And</span><span style="color: #d2cd86;">(</span><span style="color: #00c4c4;">" a is a point"</span><span style="color: #d2cd86;">)</span>
<span style="color: #e66170; font-weight: bold;">And</span><span style="color: #d2cd86;">(</span><span style="color: #00c4c4;">" a is not a vector"</span><span style="color: #d2cd86;">)</span>
<span style="color: #b060b0;">}</span>
<span style="color: #b060b0;">}</span>
<span style="color: #b060b0;">}</span>
</pre>
<!--Created using ToHtml.com on 2020-03-10 00:35:40 UTC --><br />
<br />
<br />
So, the next step there is to figure out where and how you write the background steps that set things up for you.<br />
<br />
<br />
While flipping through the book again, it started off with Tuples. I thought I knew what to do but there is a slight rub. The book uses four values (x, y, z, w) where the "thing" is a point of w = 1.0 and a vector if w = 0.0. I may be able to do something with the type system to handle this, I'm not sure.<br />
<br />
My first thought was to not try to combine them at all, so after some failed attempts and a <a href="https://stackoverflow.com/questions/60609537/how-to-model-a-point" target="_blank">StackOverflow question</a>, I ended up going down this road:<br />
<br />
<pre style="background: #000000; color: #d1d1d1;"><span style="color: #e66170; font-weight: bold;">package</span> com<span style="color: #d2cd86;">.</span>craigtreptow<span style="color: #d2cd86;">.</span>scrayz
<span style="color: #e66170; font-weight: bold;">package</span> <span style="color: #e66170; font-weight: bold;">object</span> types <span style="color: #9999a9;">{</span>
<span style="color: #9999a9;"> final case class X(v: Double) extends AnyVal</span>
<span style="color: #9999a9;"> final case class Y(v: Double) extends AnyVal</span>
<span style="color: #9999a9;"> final case class Z(v: Double) extends AnyVal</span>
<span style="color: #9999a9;"> final case class Point(x: X, y: Y, z: Z)</span>
<span style="color: #9999a9;">}</span>
</pre>
<!--Created using ToHtml.com on 2020-03-10 00:34:38 UTC --><br />
<br />
<pre style="background: #000000; color: #d1d1d1;"><span style="color: #e66170; font-weight: bold;">package</span> com<span style="color: #d2cd86;">.</span>craigtreptow<span style="color: #d2cd86;">.</span>scrayz<span style="color: #d2cd86;">.</span>types
<span style="color: #e66170; font-weight: bold;">object</span> Main extends App <span style="color: #9999a9;">{</span>
<span style="color: #9999a9;"> val x: X = X(1.1)</span>
<span style="color: #9999a9;"> val y: Y = Y(2.2)</span>
<span style="color: #9999a9;"> val z: Z = Z(3.3)</span>
<span style="color: #9999a9;"> val p: Point = Point(x, z, z)</span>
<span style="color: #9999a9;"></span>
<span style="color: #9999a9;"> println(p)</span>
<span style="color: #9999a9;"> println(p.x)</span>
<span style="color: #9999a9;"> println(p.y)</span>
<span style="color: #9999a9;"> println(p.z)</span>
<span style="color: #9999a9;">}</span>
</pre>
<br />
<br />
We'll see if this works out, but, hey, it's a place to start.Craig Treptowhttp://www.blogger.com/profile/12090900006288638519noreply@blogger.com0tag:blogger.com,1999:blog-2459366060301184602.post-91951340559518668692020-01-27T20:23:00.000-06:002020-01-27T20:24:57.159-06:00My First Taste of Pattern Matching in ScalaI just got a taste of some pattern matching in Scala. It was not really like what I had scene in Elixir or Haskell, but seems straight forward enough. In this case we match on some String attributes:<br />
<br />
<script src="https://gitlab.com/craig.treptow/essential_scala/snippets/1933838.js"></script><br />
<br />
What made it slightly awkward, I guess, was the have to explicitly use the "match" keyword to say "I'm going to match here", but use the full class name and attributes. I guess it is just a bit "weird" to my eyes. There very well may be slicker ways to do this when I get into the more "hard core" FP techniques that I assume I will see in this book (or another).<br />
<br />
All in all, I'm still enjoying Scala and this is just another thing to file away in the Scala portion of my brain.Craig Treptowhttp://www.blogger.com/profile/12090900006288638519noreply@blogger.com0tag:blogger.com,1999:blog-2459366060301184602.post-21849736428121324672020-01-22T19:43:00.000-06:002020-01-27T20:24:44.923-06:00A real quick Scala tipFor my purposes of learning Scala, I generally want to follow the compile, then run model. I didn't want to get into a whole IDE, so I'm still using vim and doing this from the command line. For this to work, however, I needed to extend App, like this:<br />
<br />
<script src="https://gitlab.com/craig.treptow/essential_scala/snippets/1932612.js"></script><br />
<br />
The key bits are to extend App, and the name you use for the object must be used when running it. So you could name it calc, but then you must also run it with "scala calc", not "scala Calc".<br />
<br />
This allows you to catch typos with the compiler and do some simple testing with the asserts. Later, I'll figure out how to integrate a test suite, but not today.<br />
Craig Treptowhttp://www.blogger.com/profile/12090900006288638519noreply@blogger.com0tag:blogger.com,1999:blog-2459366060301184602.post-30871986551249179312020-01-20T20:03:00.000-06:002020-01-20T20:04:45.903-06:00More Scala, More QuestionsI've started on the <a href="https://www.scala-exercises.org/" target="_blank">Scala Exercises</a> and have learned some tiny tidbits, which lead to more questions.<br />
<br />
One thing that was stated in a section titled "Functional Loops", is that you may use '@tailrec' to enforce using a tail call. I had never seen this, or quite honestly, thought of such a thing myself. I find this pretty interesting. The page says "In Scala, only directly recursive calls to the current function are optimized." So, it is mostly (only) about optimizations, which is more to say memory requirements will stay constant since the stack won't grow out of control. I suspect I mostly won't notice any issues surrounding this, but ya never know.<br />
<br />
Here's an example of the above:<br />
<br />
<script src="https://gist.github.com/CraigTreptow/480dd0387c14293d0c01ce61b90ef11f.js"></script><br />
<br />
I'm ready to start muddling through a project so I can learn more about how things are tested, and how to start working with Scala in something slightly bigger than tiny little trivial functions. In a section titled "Lexical Scoping" I learned that you can add a 'package' declaration to control which definitions are seen where. So, you might add a 'package foo' to a file forcing all definitions in that file under the 'foo' package and thereby limiting the scope so other packages cannot accidentally see definitions they shouldn't. The example indicated that you might have a function "Bar" in a file "foo/Bar.scala", with a 'package foo' declaration. Ok, but is that file structure enforced? My suspicion is that it is enforced, because this ends up on the JVM.<br />
<br />
This brings up another question. Is there a utility to generate a "correct" project structure? Elixir has the 'mix' tool for this (and many other) uses. I'm only aware of the 'sbt' (Scala Build Tool) at the moment. Judging from <a href="https://stackoverflow.com/questions/22401739/creating-new-scala-project-using-sbt">this old SO question</a> it isn't the solved problem I was hoping for, but I don't know much so it might be once I learn what G8 is, I guess.<br />
<br />
Time for some more Scala.Craig Treptowhttp://www.blogger.com/profile/12090900006288638519noreply@blogger.com0tag:blogger.com,1999:blog-2459366060301184602.post-13787577562549288812020-01-18T09:28:00.001-06:002020-01-18T09:28:51.085-06:00Haskell to ScalaI had no real expectations for Haskell when I started to learn it. Now, after going through a few books on it, I've been unable to get to the point where I want to really dive in and attempt my "go to" project of building a ray tracer with it. It's been very good to see other ideas about building software, but I haven't gotten over that "hump".<br />
<br />
There is a language that I feel differently about after only a few days: <a href="https://www.scala-lang.org/">Scala</a>. I've known of it's existence for a long time, but never really looked at it. Then I started listening to the <a href="https://corecursive.com/" target="_blank">CoRecursive podcast</a>, and the host, Adam, works in Scala. Around that same time, I saw some Haskell people posting about people attempting to "de-platform" a Scala person. Well, that person was <a href="https://twitter.com/jdegoes" target="_blank">John De Goes</a>. I've found him to be nothing but helpful and pretty nice online. He's also contributed a concurrent library called <a href="https://github.com/zio/zio" target="_blank">ZIO</a> to the Scala world.<br />
<br />
So, with all that, and my slight dissatisfaction with the Haskell language (and community) I finally "committed" in my head to learning Scala.<br />
<br />
I haven't found "the right book" yet, but I did discover the <a href="https://www.scala-exercises.org/" target="_blank">Scala exercises</a> site. So far, I like the way they combined reading with answering questions via fields that are checked with Scala. I started with the track called "Scala Tutorial". It is providing a little background and "big picture" as well as the more straight forward facts about language features. I'll need to read a little more before I learn how to organize a project and can begin muddling through <a href="http://raytracerchallenge.com/" target="_blank">The Ray Tracer Challenge</a>, though.<br />
<br />
Scala seems to tick all my boxes: it is FP (and OOP FWIW), has a compiler(I just like that step), is probably pretty fast (being on the JVM), but also allows for native binaries, and has browser/Web Assembly targets. I think the "big ideas" from Haskell are in there, so I'm hopeful and excited about it.Craig Treptowhttp://www.blogger.com/profile/12090900006288638519noreply@blogger.com0tag:blogger.com,1999:blog-2459366060301184602.post-633828829289070802019-09-30T18:00:00.000-05:002019-12-08T11:30:38.270-06:00Haskell Continued...<div class="post-body entry-content float-container">My meetup to learn Haskell was a success in the sense of meeting new people. There have been a core 5-6 that have shown up with varying levels of Haskell knowledge. I think we gave it an earnest effort with our <a href="http://haskellbook.com/">original book choice</a>.<br />
<br />
At this point, some people were looking for a project, and some showed interest in related languages. I have chosen to continue down the Haskell path, but this time with <a href="https://www.manning.com/books/get-programming-with-haskell" target="_blank">another book.</a> I like the approach of this book much better and am able to follow along much more than before.<br />
<br />
Now I <i>still</i> don’t understand all of it but these things take time. ;) The code related to this book is available <a href="https://github.com/CraigTreptow/get_programming_with_haskell" target="_blank">here.</a> So, that is what I’m doing with Haskell for the foreseeable future.<br />
<br />
Since there were other interests, and we weren’t really going through the book anymore, we did decide to move the group in a more generic direction. It is now called <a href="https://www.meetup.com/Des-Moines-Functional-Programming/">Des Moines Functional Programming</a>.<br />
<br />
I’m happy that I have found others with similar interests and am hopeful that more will be able to make it out in the future.<br />
</div>Craig Treptowhttp://www.blogger.com/profile/12090900006288638519noreply@blogger.com0tag:blogger.com,1999:blog-2459366060301184602.post-15332590209680084322019-06-23T10:24:00.000-05:002019-12-08T10:47:14.696-06:00Haskell MeetupHaskell?<br />
<br />
Yes, <a href="https://www.haskell.org/" target="_blank">Haskell!</a> ;)<br />
<h4 id="super-simple-haskell">
Super simple Haskell </h4>
<!-- HTML generated using hilite.me --><br />
<div style="background: #000000; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #cdcd00;">module</span> <span style="color: #cccccc;">Stuff</span> <span style="color: #cdcd00;">where</span>
<span style="color: #cccccc;">f</span> <span style="color: #cccccc;">n</span> <span style="color: #cdcd00;">::</span> <span style="color: #00cd00;">Integer</span> <span style="color: #cdcd00;">-></span> <span style="color: #00cd00;">Integer</span>
<span style="color: #cccccc;">f</span> <span style="color: #cccccc;">n</span> <span style="color: #cdcd00;">=</span> <span style="color: #cccccc;">n</span> <span style="color: #3399cc;">+</span> <span style="color: #cd00cd;">1</span>
</pre>
</div>
<br />
<br />
I’m attracted to technology of all sorts. Recently my interests have skewed towards Functional Programming and related programming languages. I get frustrated with the mundane day-to-day and look for drastically different things to help solve issues.<br />
<br />
FP and static typing are two of those things.<br />
<br />
I think that was the driver in the back of my head when I decided to learn Haskell. I’m not that social, generally, so I forced myself to seek out other people by announcing my intentions <a href="https://twitter.com/CraigTreptow/status/1125750753556094978" target="_blank">on Twitter</a>.<br />
It took over a week, but I was quite tickled to see how many other people showed interest. Not all have been able to show up, but there is a core group of about 6 others who have been able to make it consistently.<br />
<br />
After the first 7 chapters, Haskell has been “weird”, “offputting”, and “interesting”. It has definitely a bit hard to learn. This was the most suprising part to me, I think, because I chose <a href="http://haskellbook.com/">this book</a>.<br />
<br />
I’m committed to finishing this book, but I may also seek out some other resources afterwards (possibly during) to see how other people approach it.<br />
<br />
I’m going to continue. Notes answers, and other code is available via the GitHub link below:<br />
<br />
<a class="btn btn-success" href="https://github.com/CraigTreptow/haskell-programming" target="_blank"><i class="fa fa-github fa-lg"></i> View on GitHub</a>Craig Treptowhttp://www.blogger.com/profile/12090900006288638519noreply@blogger.com0tag:blogger.com,1999:blog-2459366060301184602.post-62784044138343622212019-05-10T13:10:00.000-05:002019-05-10T13:10:06.755-05:00Next UpSince I started reading articles about Functional Programming, more and more Haskell articles show up in my feeds. Since this is a language that has been on my list for a very long time, I decided now was a great time to try and learn it. <br />
<br />
The difference is that I put out some feelers for somebody else in my area who would want to learn with me.<br />
<br />
I found a <a href="https://github.com/CraigTreptow/haskell-study-startup/blob/master/README.md" target="_blank">repo that I forked</a> about how to start a study group. So, I started reading and also posted a couple of places and <a href="https://www.meetup.com/Des-Moines-Haskell-Study-Group/" target="_blank">created a meetup</a>.<br />
<br />
So far I only have one taker, but it's only been a few days. ;)Craig Treptowhttp://www.blogger.com/profile/12090900006288638519noreply@blogger.com0tag:blogger.com,1999:blog-2459366060301184602.post-63288753226326386522019-05-07T13:04:00.001-05:002019-05-07T13:05:33.764-05:00Not much to showSince my last post, I have spent a fair amount of time getting familiar with Elixir. I did a little work through <a href="https://www.dailydrip.com/" target="_blank">The Daily Drip</a>. That didn't last long, though. I didn't feel like I could work at it at a decent pace to justify the monthly cost.<br />
<br />
Next I moved on to a book that I bought on a whim: <a href="https://pragprog.com/book/jbtracer/the-ray-tracer-challenge" target="_blank">The Ray Tracer Challenge</a>. This is a great book for learning about a new language. I have two false starts under my belt. (Both ended with bugs that I have yet to figure out).<br />
<br />
That's OK with me because I did learn a lot about working with Elixir. Since the early part of the year, life sort of got in the way and I lost my drive to try it again. I dabbled with Elm a bit, can't quite get in the headspace to really give it a go. Also, I'm waiting for <a href="https://pragprog.com/book/jfelm/programming-elm" target="_blank">the Elm book I'm reading</a> to be more complete.<br />
<br />
So, long story short, I have learned more Elixir (and a little Elm), but I don't have much to show for it.Craig Treptowhttp://www.blogger.com/profile/12090900006288638519noreply@blogger.com0tag:blogger.com,1999:blog-2459366060301184602.post-24649662456056875352018-09-30T18:03:00.000-05:002019-12-08T08:34:34.521-06:00Functional ProgrammingWhen I went to college, I was a Computer Science major. We worked in Pascal 99% of the time. I remember how we distinguished the two ways of modularizing your Pascal: functions and procedures. Functions always return something, procedures didn't. <br />
<br />
I don't remember Functional Programming mentioned specifically, but it certainly must have come up in the context of Lisp since we touched on that in a programming languages overview class. In any case, there has always been this lingering desire to learn more about Functional Programming.<br />
<br />
Skipping ahead, life sort of happened, and I never quite got around to it. Sadly, so many things I wanted could be described like that. Well, it's time that changed. I'm making a concerted effort to level up my skills and learn by doing.<br />
<br />
Sometime in the last few years, I became aware of <a href="https://elixir-lang.org/" target="_blank">the Elixir programming language</a>. Since I work in Ruby daily, Elixir is a good choice in terms of cognitive overload. The syntax is approachable and similar enough to Ruby, that I should hopefully think more about the concepts and less about the syntax.<br />
<br />
So, that's where I'll be starting. Truth be told, I've already completed the Koans a couple of times, and have dabbled with a couple of books and video series. My hope is that writing while I'm learning will help solidify things in my brain. Daily practice is ideal, but realistically, that sounds very tough to pull off. I think every other day or so is more likely. Let's see how this goes!<br />
<style type="text/css"> p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Menlo; color: #9cc2c3; background-color: #001e27} span.s1 {font-variant-ligatures: no-common-ligatures; color: #d9832e} span.s2 {font-variant-ligatures: no-common-ligatures} span.s3 {font-variant-ligatures: no-common-ligatures; color: #569bf0} span.s4 {font-variant-ligatures: no-common-ligatures; color: #4dafeb} span.s5 {font-variant-ligatures: no-common-ligatures; background-color: #ffd7d7} span.s6 {font-variant-ligatures: no-common-ligatures; color: #f55296} span.s7 {text-decoration: underline ; font-variant-ligatures: no-common-ligatures; color: #f55296} span.s8 {font-variant-ligatures: no-common-ligatures; color: #ff5146} </style>Craig Treptowhttp://www.blogger.com/profile/12090900006288638519noreply@blogger.com0tag:blogger.com,1999:blog-2459366060301184602.post-62346225146104246232014-09-28T08:49:00.001-05:002014-09-28T08:49:35.148-05:00INT JSo, I recently <a href="https://twitter.com/CraigTreptow/status/512300694389686272" target="_blank">tweeted</a> about my <a href="http://www.quistic.com/personality-type/intj" target="_blank">personality type</a>. I'm not exactly sure what lead me down this "personality test" road again. I think it was linked in some article from LinkedIn. What I found more interesting this time is the result: 'INT J'. Huh?<br />
<br />
I had never heard of this 'INT J' before. What was this? Well, I read the whole description..and I keep reading it. I cannot believe how this fits me...perfectly.<br />
<br />
Just check out some of the quotes:<br />
<br />
<i>"<span style="background-color: white; color: #404041; font-family: ProximaNovaRegular; font-size: 14px; line-height: 17.5px;">INTJs need and want to know why things are the way the are.</span>"</i><br />
<br />
<i>"<span style="background-color: white; color: #404041; font-family: ProximaNovaRegular; font-size: 14px; line-height: 17.5px;">Although quietness pervades, INTs are capable of being real chatterboxes, but not in general or small talk—only on issues which are important to them or which stimulate them.</span>"</i><br />
<br />
<i>"<span style="background-color: white; color: #404041; font-family: ProximaNovaRegular; font-size: 14px; line-height: 17.5px;">INTJs love the intellectual challenge and will come to the fore when there are difficult problems to solve</span>"</i><br />
<br />
<i>"<span style="background-color: white; color: #404041; font-family: ProximaNovaRegular; font-size: 14px; line-height: 17.5px;">INTJs will overturn established practice by being forward-thinking and truly radical.</span>"</i><br />
<br />
<i>"<span style="background-color: white; color: #404041; font-family: ProximaNovaRegular; font-size: 14px; line-height: 17.5px;">They excel at deep diving and working on the unique, interesting, and complex.</span>"</i><br />
<br />
<i>"<span style="background-color: white; color: #404041; font-family: ProximaNovaRegular; font-size: 14px; line-height: 17.5px;">INTJs love developing unique solutions to complex problems</span>"</i><br />
<br />
I'm just shocked. It's like someone finally understands me. Looking back, when I've done the best, a lot, if not all, of these things were happening. Conversely, when I get frustrated, very few, if any of these are happening.<br />
<br />
So, how do I capitalize on this information? My first thought was to search for "what careers fit INT j".<br />
<br />
The <a href="http://www.personality-central.com/INTJ-careers.html" target="_blank">fourth result</a> gives ideas about attributes to pursue or avoid. Go read them, they fit me perfectly...again.<br />
<br />
The <a href="http://www.personalitypage.com/INTJ_car.html" target="_blank">first result</a> suggests the following:<br />
<br />
<table class="ieh-fl" style="background-color: #efefef; border: 0px solid; display: inline-table; font-family: geneva, arial, helvetica; vertical-align: top; width: 60%px;"><tbody>
<tr><td style="color: #0000a0;"><b><i>Possible Career Path for the INTJ:</i></b></td></tr>
<tr><td style="color: #0000a0;"> </td></tr>
<tr><td style="color: #0000a0;"> Scientists</td></tr>
<tr><td style="color: #0000a0;"> Engineers</td></tr>
<tr><td style="color: #0000a0;"> Professors and Teachers</td></tr>
<tr><td style="color: #0000a0;"> Medical Doctors / Dentists</td></tr>
<tr><td style="color: #0000a0;"> Corporate Strategists and Organization Builders</td></tr>
<tr><td style="color: #0000a0;"> Business Administrators / Managers</td></tr>
<tr><td style="color: #0000a0;"> Military Leaders</td></tr>
<tr><td style="color: #0000a0;"> Lawyers / Attorneys</td></tr>
<tr><td style="color: #0000a0;"> Judges</td></tr>
<tr><td style="color: #0000a0;"> Computer Programmers or Systems Analysts</td></tr>
</tbody></table>
<br />
<br />
None of this is much of a surprise, I guess. I'm already doing that last one, and I generally like IT stuff (but I also like science and engineering. Perhaps this means I should finally pursue that masters degree? I pursued this for a bit in the last 90's, but never really got started.<br />
<br />
The idea of pursuing a masters is intriguing, but I feel like I should repeat my bachelors in Computer Science because so much time has passed and many things have changed.<br />
<br />
I don't know what I'm going to do, but I know that any change will require work and time that is at a premium right now.<br />
<br />
Let's see where this goes.Craig Treptowhttp://www.blogger.com/profile/12090900006288638519noreply@blogger.com0tag:blogger.com,1999:blog-2459366060301184602.post-88317413447528433512014-05-20T10:01:00.001-05:002014-05-20T10:01:57.286-05:00Will you be my friend?I received this email yesterday:<br />
<br />
<blockquote class="tr_bq">
Hello,<br /><o:p> </o:p>I am Hanna Yapo,I saw your email address when i was
searching Google today, I am interested to know more about you and also willing
to have you as my friend. Let me know your interest on me.<br /><o:p> </o:p>Thanks<br />Hanna Yapo</blockquote>
<div class="MsoNormal">
<o:p></o:p></div>
<div class="MsoNormal">
<o:p></o:p></div>
<div class="MsoNormal">
<o:p></o:p></div>
<br />
<div class="MsoNormal">
<o:p></o:p></div>
<br />
I really do not know how to take this.<br />
<br />
Is this the weirdest spam I've every received?<br />
<br />
Is this some sort of phishing attempt?<br />
<br />
Is it sincere?<br />
<br />
Currently, I'm choosing to not reply.Craig Treptowhttp://www.blogger.com/profile/12090900006288638519noreply@blogger.com0tag:blogger.com,1999:blog-2459366060301184602.post-50289425155356807422014-04-25T13:15:00.000-05:002014-04-25T13:15:47.577-05:00Casting DoubtSo, I'm going about my day when I see <a href="https://twitter.com/iinteractive/statuses/459711559237763075" target="_blank">this</a> come across Twitter. So I go and read <a href="http://iinteractive.com/notebook/2014/04/25/modernize-your-legacy.html" target="_blank">it</a>.<br />
<br />
Wow. Let's go through it.<br />
<br />
It opens with:<br />
<blockquote class="tr_bq">
<span style="background-color: white; font-family: Helvetica, Arial, sans-serif; font-size: 18px; line-height: 28.799999237060547px;">Are you trying to bring modern development practices to a… less-than-modern software development environment?</span></blockquote>
Uh, yeah, I have been for over 2 years.<br />
<br />
Then he lists the warning signs:<br />
<br />
<ul>
<li>Silos</li>
<ul>
<li>Yup, this kind of "bigger picture" stuff is rarely shared, and only after there's been an issue.</li>
</ul>
<li>Visibility</li>
<ul>
<li>Surprisingly no. Most everything we have is at least in SVN.</li>
</ul>
<li>"We're too busy for maintenance"</li>
<ul>
<li>That's a definite "yes".</li>
</ul>
</ul>
<div>
<br /></div>
<div>
Does my current employer have a problem? Yup.</div>
<div>
<br /></div>
<div>
I've been trying to just get simple things accomplished for over two years now. We're talking little things, like upgrading Perl to something in the last decade and writing unit tests.</div>
<div>
<br /></div>
<div>
Of those two, only the Perl upgrade has any traction (also strangely with a move from Windows to Linux). However, we are on year two of the upgrade and are in exactly the same place with it as last year. This time, I"ll work harder to not let it drop. Of course there are still outstanding items, like integration testing, using web frameworks, using an ORM, PSGI, etc.</div>
<div>
<br /></div>
<div>
So, moving on to strategies. Well let's see, top down? Nope, that has gone no where. Management poo poos any and all new ideas, with the exception of the upgrade.</div>
<br />
<br />
Working bottom up, certainly seems like the ticket. Oh, he starts with testing. Well, having spent time teaching Perl classes and showing a few coworkers how Perl tests work, you'd think this would be a no brainer. Nope, the few that would listen to me went "uh huh", and moved on. I still write them of course, but it's lonely being the only one. Instead we spend WAY TOO MUCH TIME, clicking on our web app to test stuff.<br />
<br />
Well then Jay talks about CI a bit. Um, yeah. I guess I should focus on his last sentence: "Small and simple is infinitely superior to nothing". Of course that's easier said than done in an environment of hostile sysadmins, but I suppose those are stories for another day.<br />
<br />
Jay ends with the investment angle. That's how I've tried to see these things...investing in our future.<br />
<br />
As you can probably tell, I work in a very backwards development environment with closed minded "we've always done it this" way people. It is super frustrating and I'm at my wits end.<br />
<br />
I could give all of this another shot, but that means time and patience. I don't think I have the patience, and my time is likely better spent learning stuff I can use somewhere else.<br />
<br />
That's where my head is at. Perhaps yours is in a different place.Craig Treptowhttp://www.blogger.com/profile/12090900006288638519noreply@blogger.com0tag:blogger.com,1999:blog-2459366060301184602.post-70672564495278579672014-04-10T15:25:00.000-05:002014-04-10T15:25:09.884-05:00...and it beginsOk, let's let the cat out of the bag, today I ran the following in my Cloud 9 workspace:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">rails new name-that-book</span><br />
<br />
Exciting isn't it?<br />
<br />
One idea I had was to recreate something like the old "Name That Tune" show. In the show, contestants had to name the tune in as few of notes as possible.<br />
<br />
I intend to recreate that with music, but let's start with something that might be a bit easier.<br />
<br />
So, I still need to start fleshing out all the ideas, features, and details, but at least I've got a <a href="https://github.com/ctreptow/name-that-book#name-that-book" target="_blank">repo</a> to hold some of my original thoughts and code on this.<br />
<br />
The first step, I think, is to ignore the front end and get a backend RESTful thingy working with tests.<br />
<br />
May this be my first baby step into a new job.<br />
<br />
Wish me luck.Craig Treptowhttp://www.blogger.com/profile/12090900006288638519noreply@blogger.com0tag:blogger.com,1999:blog-2459366060301184602.post-88217123890168847782014-04-03T19:39:00.001-05:002014-04-03T19:39:57.324-05:00Distractions...So, I said earlier that I was out to become a "Rubyist". This is still true, and I'm finally ready to get back on that wagon. What have I been doing? Well, I've been spending time on CodeSchool. I found a Groupon a while back and just went for it.<br />
<br />
I'm pretty happy with CodeSchool so far. According to them I am now a master in HTML/CSS and Javascript. Since most future work is probably going to be for the web, I thought this was a good investment. I like the modern HTML elements, I learned a bit about SASS which I knew nothing about before.<br />
<br />
The other "win" is with Javascript. I could get simple things done in JS, but I feel much more equipped to do something "real" with it. They even had courses on Bootstrap and Ember (with an Angular course coming). Although I probably couldn't write an Ember app from scratch without a lot of help, I did learn quite a bit and it solidified some concepts. <br />
<br />
So, with those two tracks accomplished, I'm excited to get back to Ruby and Rails. I've even thought of a couple of ideas of apps I want to build...one of which should be really fun if a few details pan out and when I get it working.<br />
<br />
So, I'm going to get busy with Ruby, but I might just make the Rails project to provide the backend for an Ember app. We'll see where this all leads.<br />
<br />
One last thing that I'll probably put on twitter also: I'm bummed that I'll never use this at my employer, so yes, I'm on the market for a progressive Perl or Ruby or Python shop. I'm ready to experience agile, pair programming, and modern web techniques.Craig Treptowhttp://www.blogger.com/profile/12090900006288638519noreply@blogger.com0tag:blogger.com,1999:blog-2459366060301184602.post-36986791735966737242014-01-29T19:00:00.000-06:002014-01-29T19:00:00.882-06:00Another diversionI was working through the Koans and got distracted. I'm still learning Ruby, I promise!<br />
<br />
Somewhere, I stumbled across <a href="https://www.bloc.io/ruby-warrior#/" target="_blank">Ruby Warrior</a>, and it looked fun. Plus it looked like something I could do without need to concentrate quite so hard, which helps if you're stuck on the couch watching "kid shows", for instance.<br />
<br />
This is a turn based game where you can only do one action on your turn. It is a two dimensional board, where you, as the warrior, have only a small set of abilities:<br />
<br />
<ul>
<li>walk</li>
<li>feel</li>
<li>attack</li>
<li>health</li>
<li>rest</li>
<li>rescue</li>
</ul>
<div>
Before you decide what to do, you can also "feel" a square. This tells you what is there. The result can be one of five states:</div>
<div>
<ul>
<li>empty</li>
<li>stairs</li>
<li>enemy</li>
<li>captive</li>
<li>wall</li>
</ul>
Currently, I am stuck on level 6, but I'll still give you a taste for the code:</div>
<div>
<br /></div>
<br />
<div>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">class Player</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> @last_known_health = nil</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> RUNAWAY = 20 * 0.40</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> BANZAI = 20 * 0.75</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> @found_wall = false</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> def play_turn(warrior)</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> @last_known_health = warrior.health unless @last_known_health</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> took_damage = @last_known_health > warrior.health</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> </span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> if !@found_wall</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> if warrior.feel(:backward).captive?</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> warrior.rescue! :backward</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> elsif warrior.feel(:backward).wall?</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> @found_wall = true</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> warrior.walk!</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> else</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> warrior.walk! :backward</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> end</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> else</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> if warrior.feel.empty?</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> if took_damage</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> if warrior.health <= RUNAWAY</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> warrior.walk! :backward</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> else</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> warrior.walk! :forward</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> end</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> else</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> if warrior.health < BANZAI</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> warrior.rest!</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> else</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> warrior.walk! :forward</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> end</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> end</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> else</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> if warrior.feel.captive?</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> warrior.rescue!</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> else</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> warrior.attack!</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> end</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> end</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> end</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> @last_known_health = warrior.health</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;"> end</span><br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">end</span></div>
<div>
<br /></div>
<div>
It doesn't really feel like I'm taking advantage of any of the Ruby idioms. Or maybe I am?</div>
<div>
<br /></div>
<div>
Time to go for a think about this...</div>
<br />
<br />
<br />Craig Treptowhttp://www.blogger.com/profile/12090900006288638519noreply@blogger.com0tag:blogger.com,1999:blog-2459366060301184602.post-70551402386070046322014-01-18T19:00:00.000-06:002014-01-18T19:00:00.970-06:00Your company might be making mistakes if...I recently found this <a href="http://www.infoworld.com/slideshow/128647/8-developer-shortcuts-will-cost-you-big-230924?source=IFWNLE_nlt_stradev_2013-12-31#slide1" target="_blank">article</a> about mistakes that companies make with development. In it, they list out these mistakes:<br />
<br />
<ol>
<li>Paying poorly</li>
<li>Providing inadequate equipment</li>
<li>Going into technical debt</li>
<li>Rolling your own when good alternatives exist</li>
<li>Not providing dedicated project management</li>
<li>Using developers for non-developer tasks</li>
<li>No learning for learning's sake</li>
<li>Offshoring Development</li>
</ol>
<div>
I have worked at firms that have committed all of these, except #1.</div>
<div>
<br /></div>
<div>
So, should you leave to get improvements in any of these? That, of course, is up to you. I only really see two options:<br />
<br />
<ol>
<li>Be an agent of change</li>
<li>Leave</li>
</ol>
<div>
Being an agent of change is very difficult in my experience. I wish I had some success stories to share with you, but I don't.</div>
<div>
<br /></div>
<div>
Here's one example: I have thus far unsuccessfully, argued for a group of developers to write unit tests.</div>
<div>
<br /></div>
<div>
You'd think that this would be easy, because isn't unit testing at this stage a given best practice? You'd think so, yet, I see many <a href="http://www.sundoginteractive.com/sunblog/posts/top-five-excuses-for-not-unit-testing" target="_blank">of</a> <a href="http://caines.ca/blog/programming/the-top-5-common-excuses-to-avoiding-unit-testing/" target="_blank">the</a> <a href="http://regulargeek.com/2010/08/13/writing-unit-tests-is-your-job-so-quit-making-excuses/" target="_blank">excuses</a> used. In fact, the "Word has been given" that we shall not write them at all on one project, and we may not commit them to the repository with the rest of the source on any other project.</div>
<div>
<br /></div>
<div>
So, I can write unit tests, somebody else will break them and be completely clueless about it.</div>
<div>
<br /></div>
<div>
I have <a href="https://speakerdeck.com/ctreptow/perl-testing-101" target="_blank">tried to educate</a>, but so far, it has meant nothing. If people don't want to change, it is unlikely they will.</div>
<div>
<br /></div>
<div>
As for the other points in that list.</div>
</div>
<div>
<br /></div>
<div>
#2 and #3 affect you every day when you start working. Does your PC work? Does the code stink? Both of those suck to deal with every single day you work. Incurring technical debt is natural, but if you can never go back and fix it, then that load of debt keeps growing and bogs down everything you do. Projects stall, or take longer than expected. Bugs are very difficult to fix, as well.</div>
<div>
<br /></div>
<div>
The worst thing is that without doing #7, people may not even know they are incurring more technical debt. Unaware of unit testing? Writing huge monolithic procedures?<br />
<br />
That's debt that you may never get out from under and you may not even know it.</div>
Craig Treptowhttp://www.blogger.com/profile/12090900006288638519noreply@blogger.com0tag:blogger.com,1999:blog-2459366060301184602.post-34469956242651441252014-01-16T19:00:00.000-06:002014-01-16T19:00:02.670-06:00Ruby's Data::DumperI was poking around a bit trying to find the Ruby equivalent of Perls <a href="https://metacpan.org/pod/Data::Dumper" target="_blank">Data::Dumper</a> or <a href="https://metacpan.org/pod/Data::Printer" target="_blank">Data::Printer</a>. At first, I didn't think anything like those existed.<br />
<br />
Upon further research, it seems that the "normal" way of doing this is to use <a href="http://www.ruby-doc.org/core-2.0/Marshal.html" target="_blank">Marshal</a> or <a href="http://ruby-doc.org/stdlib-2.1.0/libdoc/yaml/rdoc/YAML.html" target="_blank">YAML</a>.<br />
<br />
These are ok, and I'll probably play with them, but I got more excited when I subsequently discovered <a href="https://github.com/michaeldv/awesome_print" target="_blank">Awesome Print</a>.<br />
<br />
After installing...<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">gem install awesome_print</span><br />
<br />
First run:<br />
<br />
<div style="background-color: #1b2224; border: 0px; color: #28fe14; font-family: SourceCodePro, monospace; font-size: 14px; line-height: 17px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">
ctreptow@vm-0:~$ cat 1.rb </div>
<div style="background-color: #1b2224; border: 0px; color: #28fe14; font-family: SourceCodePro, monospace; font-size: 14px; line-height: 17px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">
#!/usr/bin/env ruby</div>
<div style="background-color: #1b2224; border: 0px; color: #28fe14; font-family: SourceCodePro, monospace; font-size: 14px; line-height: 17px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">
require "awesome_print"</div>
<div style="background-color: #1b2224; border: 0px; color: #28fe14; font-family: SourceCodePro, monospace; font-size: 14px; line-height: 17px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">
data = [ false, 42, %w(forty two), { :now => Time.now,</div>
<div style="background-color: #1b2224; border: 0px; color: #28fe14; font-family: SourceCodePro, monospace; font-size: 14px; line-height: 17px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">
:class => Time.now.class, :distance => 42e42 } ]</div>
<div style="background-color: #1b2224; border: 0px; color: #28fe14; font-family: SourceCodePro, monospace; font-size: 14px; line-height: 17px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">
ap data</div>
<div style="background-color: #1b2224; border: 0px; color: #28fe14; font-family: SourceCodePro, monospace; font-size: 14px; line-height: 17px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">
<br /></div>
<div style="background-color: #1b2224; border: 0px; color: #28fe14; font-family: SourceCodePro, monospace; font-size: 14px; line-height: 17px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">
<br /></div>
<div style="background-color: #1b2224; border: 0px; color: #28fe14; font-family: SourceCodePro, monospace; font-size: 14px; line-height: 17px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">
ctreptow@vm-0:~$ ./1.rb </div>
<div style="background-color: #1b2224; border: 0px; color: #28fe14; font-family: SourceCodePro, monospace; font-size: 14px; line-height: 17px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">
[</div>
<div style="background-color: #1b2224; border: 0px; color: #28fe14; font-family: SourceCodePro, monospace; font-size: 14px; line-height: 17px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">
<span class="bold textWhite" style="border: 0px; color: #eeeeec; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: bold; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">[0] </span><span class="bold textRed" style="border: 0px; color: #ef2929; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: bold; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">false</span>,</div>
<div style="background-color: #1b2224; border: 0px; color: #28fe14; font-family: SourceCodePro, monospace; font-size: 14px; line-height: 17px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">
<span class="bold textWhite" style="border: 0px; color: #eeeeec; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: bold; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">[1] </span><span class="bold textBlue" style="border: 0px; color: #729fcf; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: bold; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">42</span>,</div>
<div style="background-color: #1b2224; border: 0px; color: #28fe14; font-family: SourceCodePro, monospace; font-size: 14px; line-height: 17px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">
<span class="bold textWhite" style="border: 0px; color: #eeeeec; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: bold; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">[2] </span>[</div>
<div style="background-color: #1b2224; border: 0px; color: #28fe14; font-family: SourceCodePro, monospace; font-size: 14px; line-height: 17px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">
<span class="bold textWhite" style="border: 0px; color: #eeeeec; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: bold; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">[0] </span><span class="textYellow" style="border: 0px; color: #c4a000; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"forty"</span>,</div>
<div style="background-color: #1b2224; border: 0px; color: #28fe14; font-family: SourceCodePro, monospace; font-size: 14px; line-height: 17px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">
<span class="bold textWhite" style="border: 0px; color: #eeeeec; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: bold; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">[1] </span><span class="textYellow" style="border: 0px; color: #c4a000; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"two"</span></div>
<div style="background-color: #1b2224; border: 0px; color: #28fe14; font-family: SourceCodePro, monospace; font-size: 14px; line-height: 17px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">
],</div>
<div style="background-color: #1b2224; border: 0px; color: #28fe14; font-family: SourceCodePro, monospace; font-size: 14px; line-height: 17px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">
<span class="bold textWhite" style="border: 0px; color: #eeeeec; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: bold; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">[3] </span>{</div>
<div style="background-color: #1b2224; border: 0px; color: #28fe14; font-family: SourceCodePro, monospace; font-size: 14px; line-height: 17px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">
:now<span class="textWhite" style="border: 0px; color: #d3d7cf; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> => </span><span class="textGreen" style="border: 0px; color: #4e9a06; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">2014-01-15 22:49:02 +0000</span>,</div>
<div style="background-color: #1b2224; border: 0px; color: #28fe14; font-family: SourceCodePro, monospace; font-size: 14px; line-height: 17px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">
:class<span class="textWhite" style="border: 0px; color: #d3d7cf; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> => </span><span class="bold textYellow" style="border: 0px; color: #fce94f; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: bold; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">Time < Object</span>,</div>
<div style="background-color: #1b2224; border: 0px; color: #28fe14; font-family: SourceCodePro, monospace; font-size: 14px; line-height: 17px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">
:distance<span class="textWhite" style="border: 0px; color: #d3d7cf; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> => </span><span class="bold textBlue" style="border: 0px; color: #729fcf; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: bold; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">4.2e+43</span></div>
<div style="background-color: #1b2224; border: 0px; color: #28fe14; font-family: SourceCodePro, monospace; font-size: 14px; line-height: 17px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">
}</div>
<div style="background-color: #1b2224; border: 0px; color: #28fe14; font-family: SourceCodePro, monospace; font-size: 14px; line-height: 17px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">
]</div>
<div style="background-color: #1b2224; border: 0px; color: #28fe14; font-family: SourceCodePro, monospace; font-size: 14px; line-height: 17px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">
ctreptow@vm-0:~$ <span class="inverse" style="background-color: #28fe14; border: 0px; color: #1b2224; font-family: inherit; font-size: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"> </span></div>
<br />
I like that. I think it will come in handy when I get around to actually making something.<br />
<br />
<br />Craig Treptowhttp://www.blogger.com/profile/12090900006288638519noreply@blogger.com0tag:blogger.com,1999:blog-2459366060301184602.post-89876592919171655192014-01-16T12:36:00.002-06:002014-01-16T12:36:49.867-06:00Ruby Koans: current statusJust finished strings:<br />
<br />
<span style="font-size: xx-small;"><span class="textGreen" style="background-color: #1b2224; border: 0px; color: #4e9a06; font-family: SourceCodePro, monospace; line-height: 17.23076820373535px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">your path thus far [............</span><span class="textRed" style="background-color: #1b2224; border: 0px; color: #cc0000; font-family: SourceCodePro, monospace; line-height: 17.23076820373535px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">X</span><span class="textCyan" style="background-color: #1b2224; border: 0px; color: #06989a; font-family: SourceCodePro, monospace; line-height: 17.23076820373535px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">_____________________________________</span><span class="textGreen" style="background-color: #1b2224; border: 0px; color: #4e9a06; font-family: SourceCodePro, monospace; line-height: 17.23076820373535px; margin: 0px; padding: 0px; vertical-align: baseline; white-space: nowrap;">]</span><span style="background-color: #1b2224; color: #28fe14; font-family: SourceCodePro, monospace; line-height: 17.23076820373535px; white-space: nowrap;"> 70/280</span></span>Craig Treptowhttp://www.blogger.com/profile/12090900006288638519noreply@blogger.com0tag:blogger.com,1999:blog-2459366060301184602.post-46930391617676507452014-01-15T19:00:00.000-06:002014-01-15T19:00:01.009-06:00Knowing WhenI was a Computer Science major in <a href="http://www.wartburg.edu/" target="_blank">college</a>. This, of course, meant lots of programming. In my case, the majority was in Pascal, plus I dabbled in others: Modula-2 and C primarily.<br />
<br />
So, when it was time to graduate, I needed a job. I interviewed at a couple of local places (one insurance, one PC software). Well, neither one worked out, plus I felt I needed to farther away from home. I eventually took one in Des Moines. <br />
<br />
Was I programming? Nope. The choice was either program COBOL, or do something in their "Research & Development" department. So, I became a "Research Analyst". It was fun, but we didn't do much more than review software and hardware, write up the report and tell people in the company what to buy.<br />
<br />
One of those projects was to compare UNIX systems. That was actually pretty cool, I got to meet employee #33 at Sun (whatever his name was) and got me going on UNIX. <br />
<br />
So that led me around to a path of doing DBA work and sysadmin work. Eventually, I was sick of sysadmin work and wanted to program. Of course, since I hadn't been doing programming, I didn't think I'd ever get a programming job.<br />
<br />
That's when an old friend called and said "we need good people, will you come back?". "Is there programming?", I said. "No, not really". I took it anyway.<br />
<br />
The position was to manage our networking devices, thousands of routers, switches, and hubs. I also managed DHCP, and DNS. I did manage to find <i>some</i> programming, though. I modified the DHCP server using C, and wrote bunches of scripts in bash and Perl.<br />
<br />
That position turned into a dead end, but I didn't know when to call it a day and leave. I stayed probably 10 years too long.<br />
<br />
I finally did get another internal position supporting some software. I also found a way to get a little programming in using Java. I should have left after that first year, but once again, I didn't know when to leave.<br />
<br />
I and my team got transferred out to another area where I stuck it out for another two years. Here again, I didn't know when to leave and should have after the first year, because this new area was horrible.<br />
<br />
I finally did get out of there and into my current position. I think I've finally learned something, because in this case, I do think I know when to leave. More on the in the future perhaps.<br />
<br />
The lesson for you is: figure out when it is time to leave and leave. Sticking it out in something you hate is horrible, don't do it.Craig Treptowhttp://www.blogger.com/profile/12090900006288638519noreply@blogger.com0