Vegard Skjefstad

www.vegard.net

Menu Close

Tag: Programming (page 1 of 4)

C# for Java Developers, Part II: Methods

This is the second part of my C# for Java Developers series. Let’s have a look at how to write methods in C#.

Note that this is the second and last post in this series. I’ve decided that there are a lot more interesting languages to learn than C#. The reason I’m finally publishing this second part of the guide – over two years after the first part was published – is that I’m going through my old drafts.

Please consider reading the first part before you jump into this one. All the code you see – and more – is available in the C# for Java Developers GitHub repository. A word of warning: I’m writing this guide as I learn C# myself, so don’t except everything to be 100% accurate. Consider reading this as a way to kick start your own C# adventure.

With that out of the way, let’s have a look at methods.

Read more

Yandex Translate Firefox Extension

I made a Yandex Translate Firefox extension1 that lets you translate between any two language from the Firefox address bar. Awesome!

When I write for this site, I use many different tools2. To spice up the language a little, I use Thesaurus.com. Dictionary.com is a life saver when I want to look up definitions of words. And Yandex Translate is handy because English is my second language, and I often find myself in need of a little translation from Norwegian.

Both Thesaurus.com and Dictionary.com are easily available through Firefox search engine integrations. I simply open a new tab, hit either t for thesaurus or d for dictionary, enter the word I’m looking for, and the respective site in queried. It’s all very convenient. For a while I’ve been looking for a similar solution for Yandex Translate, but I’ve found none. The Firefox extensions that exist for Yandex Translate are either massive feature creeps, or very limited.

I needed a simple extension that made it possible to translate between any of the languages supported by Yandex Translate. And what’s the programmer’s approach when we have a problem that isn’t already solved by someone else? We solve it ourselves, of course!

Read more

Google Translate Firefox Extension

I made a Google Translate Firefox extension that lets you translate between any two language from the Firefox address bar. Awesome!

When I write for this site, I use many different tools1. To spice up the language a little, I use Thesaurus.com. Dictionary.com is a life saver when I want to look up definitions of words. And Google Translate is handy because English is my second language, and I often find myself in need of a little translation from Norwegian.

Both Thesaurus.com and Dictionary.com are easily available through Firefox search engine integrations. I simply open a new tab, hit either t for thesaurus or d for dictionary, enter the word I’m looking for, and the respective site in queried. It’s all very convenient. For a while I’ve been looking for a similar solution for Google Translate, but I’ve found none. The Firefox extensions that exist for Google Translate are either massive feature creeps, or very limited.

I needed a simple extension that made it possible to translate between any of the languages supported by Google Translate. And what’s the programmer’s approach when we have a problem that isn’t already solved by someone else? We solve it ourselves, of course!

Read more

December One-liners: Programming Special!

Here are the new one-liners for December. This time it’s programming special, with a few sprinkles of less nerdy wisdom. Most of the quotes below are collected from the Twitter account Programming Wisdom. They’re not exactly haha-funny, but if you’re a programmer they should make you think. Enjoy!

  • “It’s all talk until the code runs.” – Ward Cunningham
  • “In theory, there is no difference between theory and practice. But, in practice, there is.” – Jan L.A van de Snepscheut
  • I’ve got an idea for a really scary Halloween costume. How do I dress up as “The World Right Now”?
  • “What one programmer can do in one month, two programmers can do in two months.” – Fred Brooks
  • “Good software, like good wine, takes time.” – Joel Spolsky
  • “Debugging is like being the detective in a crime movie where you are also the murderer.” – Filipe Fortes
  • Trying again to persuade my wife to participate in a twosome.
  • “We build our computer systems the way we build our cities: over time, without a plan, on top of ruins.” – Ellen Ullman
  • “Think about it; and think about it carefully. Nothing happens in our society without software. Nothing.” – Robert “Uncle Bob Martin
  • “I ran a half marathon” sounds so much better than “I quit halfway through a marathon”.
  • “A language that doesn’t affect the way you think about programming is not worth knowing.” – Alan J. Perlis
  • “Programs must be written for people to read, and only incidentally for machines to execute.” – Harold Abelson & Gerald Jay Sussman
  • “Debugging time increases as a square of the program’s size.” – Chris Wenham
  • “One of the best programming skills you can have is knowing when to walk away for awhile.” – Oscar Godson
  • The trick to really enjoying someone’s company is to not spend a lot of time with them.
  • “The strength of JavaScript is that you can do anything. The weakness is that you will.” – Reg Braithwaite
  • “The best programs are the ones written when the programmer is supposed to be working on something else.” – Melinda Varian
  • “A primary cause of complexity is that software vendors uncritically adopt almost any feature that users want.”- Niklaus Wirth
  • “Every great developer you know got there by solving problems they were unqualified to solve until they actually did it.” – Patrick McKenzie
  • Life doesn’t hand me lemons, it fires them at me rapidly from a lemon cannon.
  • “The next best thing to having good ideas is recognizing good ideas from your users. Sometimes the latter is better.” – Eric Raymond
  • “Looking at code you wrote more than two weeks ago is like looking at code you are seeing for the first time.”– Dan Hurvitz
  • Having nutrition information on a bag of Cheetos is like having dating tips on a box of Crocs.

C# for Java Developers, Part I

If all the planets align correctly, and World War III doesn’t break out, I might be dabbling in C# within the next 12 months. But I’m a hard core Java developer. How do I effectively learn C# while at the same time staying sane? Here’s my quick and dirty C# for Java Developers guide.

C# (pronounced see sharp) first appeared in the year 2000, 5 years after Java. It’s currently at version 7, which was released in March this year. The language is similar to Java in many ways, but it’s also very different. Both Java and C# are typed statically and strongly, object orientated, use curly braces to define scope, and semi colons to indicate line endings. While they have similar syntax, the C# syntax differs enough from Java that it might look a bit confusing to a long time Java developer at first sight.

The structure of this guide is as follows: Each hand picked topic consists of three sub sections. One code sample from each camp, and then some quick bullet points that cover what I consider the most important takeaway from the particular subject. All code you see is also available in the C# for Java Developers GitHub repository.

A word of warning: I’m writing this guide as I learn C# myself, so don’t except everything to be 100% accurate. Consider reading this as a way to kick start your own C# adventure.

Without further ado, let’s jump in the deep end of the pool.

Read more

Copyright © 2000-2019 www.vegard.net | Privacy Policy | Statement of Audience | Hosted on vbox4.vbox-host.com