conventions

How do you USE Fortran 90 module data

拥有回忆 提交于 2019-11-27 12:20:46
Let's say you have a Fortran 90 module containing lots of variables, functions and subroutines. In your USE statement, which convention do you follow: explicitly declare which variables/functions/subroutines you're using with the , only : syntax, such as USE [module_name], only : variable1, variable2, ... ? Insert a blanket USE [module_name] ? On the one hand, the only clause makes the code a bit more verbose. However, it forces you to repeat yourself in the code and if your module contains lots of variables/functions/subroutines, things begin to look unruly. Here's an example: module

Python: using 4 spaces for indentation. Why? [closed]

一世执手 提交于 2019-11-27 11:10:51
While coding python I'm using only 2 spaces to indent, sure PEP-8 really recommend to have 4 spaces, but historically for me it's unusual. So, can anyone convince me to use 4 spaces instead of 2? What pros and cons? P.S. And finally, what's easy way to convert all existing codebase from 2 spaces to 4 spaces? P.P.S. PEP-8 Also srictly recommend not using tabs for indention. read here So, to summarize: Pros: Have more space to arrange when wraping string more than 80 lines long. Can copy code from snippets and it just works. Cons: With deeper level of nested statements you have less space for

What are common conventions for using namespaces in Clojure?

拥有回忆 提交于 2019-11-27 11:06:07
I'm having trouble finding good advice and common practices for the use of namespaces in Clojure. I realize that namespaces are not the same as Java packages so I'm trying to tease out the conventions in Clojure, which seem surprisingly hard to determine. I think I have a pretty good idea how to split functions into clj files and even roughly how I'd want to organize those files into directories. But beyond that I'm having trouble finding the mechanics for my dev environment. Some inter-related questions: Do I use the same uniqueness conventions for Clojure namespaces as I would normally use

What is trunk, branch and tag in Subversion? [duplicate]

感情迁移 提交于 2019-11-27 09:08:34
问题 Possible Duplicate: What do “branch”, “tag” and “trunk” really mean? What is a trunk, branch and tag in Subversion and what are the best practices to use them? What tools can I use for Subversion in Visual Studio 2008? 回答1: The trunk is the main line of development in a SVN repository. A branch is a side-line of development created to make larger, experimental or disrupting work without annoying users of the trunk version. Also, branches can be used to create development lines for multiple

Objective-C: Assertion vs. Exception vs. Error

天涯浪子 提交于 2019-11-27 09:05:04
问题 In Cocoa, when should I use NSAssert, NSException, NSError? Here's what I've been thinking: NSAssert - When creating any client program used for the programmers own benefit to double check rules, conventions, assumptions, or pre-conditions and post-conditions? NSException - When creating a third-party library for the benefit of other programmers that use the library, so that they immediately know when an input is invalid? NSError - When interfacing with an external system to get data like a

What's the best way to do string building/concatenation in JavaScript?

a 夏天 提交于 2019-11-27 06:35:22
问题 Does JavaScript support substitution/interpolation? Overview I'm working on a JS project, and as it's getting bigger, keeping strings in good shape is getting a lot harder. I'm wondering what's the easiest and most conventional way to construct or build strings in JavaScript. My experience so far: String concatenation starts looking ugly and becomes harder to maintain as the project becomes more complex. The most important this at this point is succinctness and readability, think a bunch of

What does it mean when a css property starts with a dash? [duplicate]

好久不见. 提交于 2019-11-27 06:20:57
问题 This question already has an answer here: Why do browsers create vendor prefixes for CSS properties? 2 answers I just downloaded a css file from this website and it contains properties such as -webkit-transform and -moz-transform . What does the dash mean and under what circumstances is it required? For the nity grity does the phrase "vendor prefix" refer to the - or the content between the - and - (exuding the - and -) or the content between the - and - (including the - themselves)? In other

Do people use the Hungarian Naming Conventions in the real world? [closed]

不想你离开。 提交于 2019-11-27 05:41:54
问题 Is it worth learning the convention or is it a bane to readability and maintainability? 回答1: Considering that most people that use Hungarian Notation is following the misunderstood version of it, I'd say it's pretty pointless. If you want to use the original definition of it, it might make more sense, but other than that it is mostly syntactic sugar. If you read the Wikipedia article on the subject, you'll find two conflicting notations, Systems Hungarian Notation and Apps Hungarian Notation

Why would font names need quotes?

白昼怎懂夜的黑 提交于 2019-11-27 05:34:07
问题 As far as I know, one needs to use double or single quotes for fonts if they contain spaces, like: font-family: "Times New Roman", Times; font-family: 'Times New Roman', Times; But on Google Fonts (http://www.google.com/webfont), I also see font-family: 'Margarine', cursive; Some even use it like so: font-family: 'Margarine', 'Helvetica', arial; I find this weird, as the following works as well: font-family: Arial, Helvetica, sans-serif; font-family: Cambria, serif; So what is the correct

AS3: cast or “as”?

僤鯓⒐⒋嵵緔 提交于 2019-11-27 04:49:45
Is there any difference of use, efficiency or background technique between var mc:MovieClip = MovieClip(getChildByName("mc")); and var mc:MovieClip = getChildByName("mc") as MovieClip; ? The choice is just matter of convention, preference or are there cases where you can't use one? Paul Bellora This article describes the differences well: A key difference between casting and the as operator is the behavior on failure. When a cast fails in ActionScript 2, null is returned. When a cast fails in ActionScript 3, a TypeError is thrown. With the as operator in ActionScript 3, whenever a cast fails