Stream

Join this community to post or comment

Nathan Follmer

Everything Else!  - 
 
Just a warning to anybody using services like Codecademy - I've heard that major errors are often marked as acceptable with many of these learn online services, so I thought it'd try for myself... Well, it does let some pretty sloppy errors though, BUT if you look at the output, most of the time it will tell you there's a problem. Have a look at this Dog class from one of the PHP lessons - The constructor is wrong, it's not IN the class, so what is it constructing? Yet, Codecademy let it go (but the program output shows an error). 

Just something to remember while using services like this... Always listen to the output and not success/failure message ;)
2
Add a comment...

Adrian Chung

Episode Discussion  - 
 
Computerphile also used playing cards to explain sorting algorithms. This one explains quick sort.
1
Add a comment...

Lee Crocker

Everything Else!  - 
 
The joys of embedded programming: Working on firmware for a hydraulic valve controller, I'm thinking "Wait, these numbers don't look right. If the coil were drawing that much current, it would heat up." So I pick up the coil... and drop it before it burns my hand. Hmm, physics works.
4
Add a comment...

Omega Nine

Everything Else!  - 
 
Stand back Microsoft! Oracle eat your heart out.  ArnoldC is here to put your all your languages to shame.
IT'S SHOWTIME TALK TO THE HAND "hello world" YOU HAVE BEEN TERMINATED java -jar ArnoldC.jar hello.arnoldc java hello. Stop whining and start coding! Now with Sublime support. Download the markup. Linux folder. ~/.config/sublime-text-v/Packages/ArnoldC. Windows folder ...
3
1
Carlos Urrutia's profile photo
Add a comment...
 
If you enjoy learning about data and algorithms as much as I do (it's a sickness... I'm sorry) - Check this book out. It was one of the first books I ever purchased on the subject and I still have a gander in it from time to time. Yes, it's pretty heavy on game related algorithms, but it's still a good resource to learn from and you can use the topics covered really for any type of dataset. Haven't been able to find it in eBook form yet... 
3
Nathan Follmer's profile photoLee Crocker's profile photo
3 comments
 
I thought the sorting show was a good idea, if for no other reason than to introduce the concept of "algorithm", and showing that there are different ways of doing the same thing, and some ways are better than others in some circumstances. Even showing bubblesort (which is never the right choice) is fine is an example. It's also good to point out that it's often good to write your own custom-suited to certain kinds of data and applications.

Need to do a similar thing with data structures like trees and hashtables.
Add a comment...

Lee Crocker

Everything Else!  - 
 

A (half-hearted) defense of JavaScript

The JavaScript language has been mentioned in passing here a few times, but I think its popularity and importance merit more detail.

JavaScript is an extremely powerful and flexible language with a few spectacularly bad features that give the language as a whole a bad rap. First among these is the name, which implies that it has some relationship with Java, with which it has absolutely nothing in common but some basic syntax that both languages got from C. Second is the fact that is has a global object that users can manipulate, causing modules to interfere with each other. Worse, the keyword "this" refers to user objects, newly created objects, or the global object depending on context, causing programmers to stomp on the global object unintentionally without warning. JavaScript's == and != do implicit type conversion with strange results, so they have to have === and !== to behave more sanely. Likewise, there are two "bottom" values: null and undefined, with different behavior. Finally, all values have true/false evaluations, but some are bizarre. For instance, Python programmers used to checking for empty arrays with "if myList:" will be surprised to discover that empty arrays are true in JavaScript, though empty strings are false as normal. Variables are function scoped rather than block scoped as most would expect from a language with C's block syntax, and are untyped and declared implicity so such errors are hard to find. Stack-frame based exceptions don't fit well with the rest of the language.

Despite these flaws and others for which the language suffers well-deserved ridicule, other parts of the language are quite elegant and powerful, and the language can be implemented quite efficiently, as demonstrated by Google's "V8" engine in Chrome (and used by Node.js and others). JavaScript's object system is prototype-based like Self and Lua, rather than class-based like more traditional OO languages. I personally think this is better, though enough people are so used to Java's way of doing things that they are trying to patch a class-like syntax onto the new version of the language that doesn't really fit it well. JavaScript has first-class function objects with full closure. It has an extremely simple and powerful object-literal notation similar to Python's that is so good it is often used to encode data by programs in other languages (where it is called "JSON"). These features fit together remarkably well, allowing some very powerful programming patterns that even Lisp programmers might envy.

If one takes great care to avoid the bad parts (perhaps helped by tools like JSLint), and one learns how to make the best of the good features, one can make (and people have made) quite large and elegant programs.

In short, JavaScript makes it very easy to do very, very bad things. But also fairly easy to do good things. Its expressive power and orthogonality and flexibility compare well with many other popular languages.

Because JavaScript is open, there are many implementations, not just in browsers but for standalone programming as well (I think Node.js is deservedly the most popular of these). Because of its flaws and oddities, there are also languages that modify, add to, or compile down to JavaScript while presenting what they think is a better programming experience. TypeScript, for example, adds a lot of type-checking to the otherwise typeless language, which makes finding certain types of bugs easier at the expense of some flexibility. CoffeeScript lets you program with a more Python-like syntax including things like list comprehensions and string interpolation. You can get compilers that translate languages like Python and Go directly to JavaScript. But frankly, I think if you're going to write code for a JavaScript target, learn the language as it is, warts and and all, and learn to use the good stuff to do it well.
8
Lee Crocker's profile photoNathan Follmer's profile photo
5 comments
 
I've been using Javascript heavily over the past year. Not for web, but with a service called Appcelerator. You write your 'app' in Javascript and then get the Android and iOS builds, it also does Windows Phone and BlackBerry but I've never tried those - I wouldn't say it's 100% native code, but you get Java or Objective-C code after building, it just has a lot more helper functions and classes than it would if you did things natively. It does a pretty decent job, obviously it isn't the best solution but when you're a sole developer, needing to work on 2 apps at a time AND they're 'side projects' it's a lot faster for me to handle 1 code base than deal with Objective C (or Swift) and Java. It gets a bad rap, but you really just have to know how to handle memory youself and know when to open/close windows or use views, etc... but I digress.

I've really enjoyed using JS and have already started using it a lot more in my web development (used to just find what I needed because I don't have original ideas... Somebody has already always done what I needed to do ). It's a great language to learn, but I sometimes hate how loose it is. 

Edit: I haven't watched the recording yet, but I think I tuned in yesterday to catch the tail end of Lou talking about these new cross platform development tools? Patrick's lens flare blinded me and I forgot what I saw before that... 
Add a comment...

Matthew Reardon

Episode Discussion  - 
 
For the geek who just wants know....One's complement info. 
2
Add a comment...
 
Finally caught up with coding 101 Episode 51. Listening to Steve, I have to agree that the knowledge of computer hardware is both critical and missing from current curricula in many college programs. (I wonder how many computer majors could explain the usage of a 1s complement or 2s complement...)

When the Navy trained me to repair computers (Many many years ago.) We were taught troubleshooting to the NOR gate level (trust me, with electronics, everything is a NOR gate.) As well as Assembly programming (lovely Binary coded octal)

Understanding how computers work on this kind of fundamental level has paid dividends in my understanding of problems over the course of my career as a software developer.
1
Add a comment...

Jason Perry

Everything Else!  - 
 
Anyone here with recommendations on a Zigbee radio other than the Xbee? Furthest distance the signal would have to travel is 25ft and up or down a floor, more realistically 10ft since it is a mesh network. 
1
Toby Robb's profile photoJason Perry's profile photo
7 comments
 
Price is right and the form factor also fits what I am after. I think I may start with something like that and build with the thought in mind that I may switch radios down the road. I would rather. buying 20 cheap radios that will work for my purpose makes more sense than buying 1 radio that goes above and beyond.
Add a comment...
 
This guy has it figured out. He is up to 12 episodes on his smart house. I have to say there are a few things I am not 100% with his model; but, with the time he has spent on it there is probably a reason I am not thinking of. 
1
Add a comment...

About this community

Join the Digital Jesuit, Father Robert Ballecer, as he speaks with programmers, engineers and software tinkerers to tease out the secrets of becoming a code warrior. With a combination of classroom-style teaching, interviews and start-to-finish project, Coding 101 will offer something for everyone, no matter if your a newbie, advanced, or in possession of great code-fu. Records live every Thursday at 1:30pm PT / 4:30pm ET.

Fuzzy Wuzzy

Episode Discussion  - 
 
Here's a different way of explaining sorting algorithms :D
1
Add a comment...

Adrian Chung

Episode Discussion  - 
 
Visualizations of sorting algorithms are more interesting to listen to when sound is added.
4
Add a comment...

Matthew Reardon

Episode Discussion  - 
 
Some ideas for break episodes:

How github works/what it is for. Possible know how crossover. I was copy and pasting from coding101 posts for previous modules. Have not had time to investigate thoroughly.

Collections: What are they used for, with examples. What purpose do they serve in overall program design. Dictionary and hashes appear to be same thing. How are they used?

Just some random ideas.

Matt
3
Nathan Follmer's profile photoMatthew Reardon's profile photo
6 comments
 
+Nathan Follmer  has got it.  I can look up the different collection types on internet.  I find it valuable why a specific way of doing things was choosen.  For example although I didn't follow all the details of the apps +Louis Maresca made, seeing how he set things in terms of design was valuable.
Add a comment...
 
I just noticed the description of this G+ community in the top-left corner and had a good laugh.
3
Darryl Medley's profile photoFr. Robert Ballecer, SJ's profile photo
2 comments
Add a comment...

Lee Crocker

Episode Discussion  - 
 
Sounds like you've got the next few months planned out with stuff I'm not into at all (C# again, Perl again, Ruby). At least with Ruby you'll probably finally get around to talking about web apps, which have been lacking here.

I wonder if there's any news on the TWIT API? That would be a great way to demonstrate modern web apps, and I can imagine some things I'd like to do in that regard.
1
1
Lee Crocker's profile photoLouis Maresca's profile photomick jones's profile photo
2 comments
 
TWiT API goodness
Add a comment...

Lee Crocker

Episode Discussion  - 
 
State and Behavior

Another cool episode with Smitty, but I think Lou and Padre's opening bit about structures and objects was more confusing than useful. In particular, they make it sound like a matter of choice. Apparently it is if you're using C#--I'll take Lou's word for that. For the other 95% of programmers, the choice is easy: in C++, use structs to interface with C code, otherwise use classes. In every other programming language in the world, use the one your language has.

Lou also emphasized the value of information hiding, which is indeed a benefit of OO design, but not what I'd call it's defining characteristic. Padre got this one right: what makes objects different from structures is behavior. That is, object have methods as well as data, and because they do, they can have data that is private to those methods.

The more general question of why to use either one was never really answered clearly, but the answer is quite simple: computer programs model parts of the world, and structures are ways to encapsulate the representation of complex things. Things in the world have state, which is to say more-or-less static (but perhaps changeable) properties: a car has a make, model, color, location, direction, occupants, and so on. You might be able to come up with many such properties. Which ones you choose to track is a matter of what you need your program to do, but collecting them into a structure of some type makes it clear that they belong to a single thing, and simplifies dealing with those things. Things also have behavior, which is what they do, or what can be done to them, and how they interact with other things (drive, paint, sell. etc.)

Structures in programming languages collect into one place the state of something. Objects collect both state and behavior. Some languages (Java, Go, ...) have collections of behavior only, called "interfaces". Classes are a further way to organize and, well, classify, different kinds of objects. Some languages (JavaScript, Lua, ...) have objects, but not classes. To further complicate things, languages use all kinds of different terms for these things: "records" (Pascal...), "tuples" (Erlang...), etc. Go calls its objects "structures". :-)

But it's all about state and behavior: what are the "things" in your program, how do you describe and differentiate them, and what do they do?
2
Darryl Medley's profile photoLee Crocker's profile photo
6 comments
 
Yes, but grouped and named for a purpose, in that they collectively represent a thing.
Add a comment...

mike klaene

Episode Discussion  - 
 
In plain old 'C' - a structure is a way to group together a set of data that are to be used together.  A good example is the 'FILE' structure that is defined in the stdio.h file. The FILE structure contains all of the values that are needed by the standard I/O functions to manage all of the file operations for you.

In languages that support classes, the basic 'C' type structure concept is expanded such that one or more of the data values in the structure can be defined as private. Also a class may include the specific functions, called 'methods', for acting upon the class.

Both 'C' and OOP languages have their uses - they are just tools. You, as the programmer, should selected the best tool for the task at hand.
1
mike klaene's profile photo
5 comments
 
+Louis Maresca Lou - thanks for the compliment.
Add a comment...
 
I was just thinking of an Arduino project the other day that could use something like this... I'm throwing money at the screen as I type this: https://www.kickstarter.com/projects/sparkdevices/spark-electron-cellular-dev-kit-with-a-simple-data
Spark IO is raising funds for Spark Electron: Cellular dev kit with a simple data plan on Kickstarter! The Electron is an Arduino-like cellular development kit with a SIM card and affordable data plan from the creators of the Spark Core.
2
Louis Maresca's profile photo
 
This is going to be fun!
Add a comment...

Hector Coluccio

Episode Discussion  - 
 
I don't see the location of the libraries for the RTC and Time in the show notes. I found some in the internet but I don't know if they are all the same, I prefer to use the same libraries being used in the show.
1
Fr. Robert Ballecer, SJ's profile photoHector Coluccio's profile photo
2 comments
 
Thank you Padre, bendiciones.
Add a comment...
 
Libraries can consist of your own code.  It is a very good way to re-use your own code without having to include the actual source into your project.
Coding is fun and anybody CAN do it.  But not everybody will be a Steve Gibson class coder.
1
Add a comment...