Reserved words as names or identifiers

This is a valid question. Such a thing is possible in other languages. In C#, prefix the identifier with @ (as asked before); in Delphi, prefix with &. But Java offers no such feature (partly because it doesn’t really need to interact with identifiers defined by other languages the way the .Net world does).

What is the preferred way (better style) to name a namespace in Ruby? Singular or Plural?

Use: module FooLib end module FooLib::Plugins end class FooLib::Plugins::Plugin; end #the base for plugins class FooLib::Plugins::Bar < FooLib::Plugins::Plugin; end class FooLib::Plugins::Bar2 < FooLib::Plugins::Plugin; end or in a different words: module FooLib module Plugins class Plugin; end #the base for plugins class Bar < Plugin; end class Bar2 < Plugin; end end end Also arrange the … Read more

What does .dist used as an extension of some source code file mean?

.dist files are often configuration files which do not contain the real-world deploy-specific parameters (e.g. Database Passwords, etc.), and are there to help you get started with the application/framework faster. So, to get started with such frameworks, you should remove the .dist extension, and customize your configuration file with your personal parameters. One purpose I … Read more

Renaming SVN repository project name

In order to rename a repository you only have to rename its root directory and generate a new UUID. Assuming the repository is in /var/svnroot/my_repo you have to run this commands (as root) to rename a repository: $ mv /var/svnroot/my_repo /var/svnroot/my_new_repo $ svnadmin setuuid /var/svnroot/my_new_repo After that, you can access it through your favorite protocol.

What kind of prefix do you use for member variables?

No doubt, it’s essential for understanding code to give member variables a prefix so that they can easily be distinguished from “normal” variables. I dispute this claim. It’s not the least bit necessary if you have half-decent syntax highlighting. A good IDE can let you write your code in readable English, and can show you … Read more

tech