Thursday, March 31, 2011

How to determine whether a grammar is LL(1) LR(0) SLR(1)

Is there a simple way to determine wether a grammar is LL1, LR0, SLR1... just from looking on the grammar without doing any complex analysis?

For instance: To decide wether a BNF Grammar is LL1 you have to calculate First and Follow sets first - which can be very time consuming in some cases.

Has anybody got an idea how to do this faster? Any help would really be appreciated!

From stackoverflow
  • First off, a bit of pedantry. You cannot determine whether a language is LL(1) from inspecting a grammar for it, you can only make statements about the grammar itself. It is perfectly possible to write non-LL(1) grammars for languages for which an LL(1) grammar exists.

    With that out of the way:

    • You could write a parser for the grammar and have a program calculate first and follow sets and other properties for you. After all, that's the big advantage of BNF grammars, they are machine comprehensible.

    • Inspect the grammar and look for violations of the constraints of various grammar types. For instance: LL(1) allows for right but not left recursion, thus, a grammar that contains left recursion is not LL(1). (For other grammar properties you're going to have to spend some quality time with the definitions, because I can't remember anything else off the top of my head right now :).

    Bruce Alderman : Good point about the distinction between language and grammar. If a grammar is not LL(1), it may still be possible to construct an LL(1) grammar for the language.
    Jason Orendorff : +1 for pedantry. It's a key distinction, and the fact that it's usually glossed over is an obstacle to understanding.
  • One aspect, "is the language/grammar ambiguous", is a known undecidable question like the Post correspondence and halting problems.

  • In answer to your main question: For a very simple grammar, it may be possible to determine whether it is LL(1) without constructing FIRST and FOLLOW sets, e.g.

    A → A + A | a

    is not LL(1), while

    A → a | b

    is.

    But when you get more complex than that, you'll need to do some analysis.

    A → B | a
    B → A + A

    This is not LL(1), but it may not be immediately obvious

    The grammar rules for arithmetic quickly get very complex:

    expr → term { '+' term }
    term → factor { '*' factor }
    factor → number | '(' expr ')'

    This grammar handles only multiplication and addition, and already it's not immediately clear whether the grammar is LL(1). It's still possible to evaluate it by looking through the grammar, but as the grammar grows it becomes less feasable. If we're defining a grammar for an entire programming language, it's almost certainly going to take some complex analysis.

    That said, there are a few obvious telltale signs that the grammar is not LL(1) — like the A → A + A above — and if you can find any of these in your grammar, you'll know it needs to be rewritten if you're writing a recursive descent parser. But there's no shortcut to verify that the grammar is LL(1).

    jpalecek : BTW, you don't need to compute FOLLOW for LL(1), since it's only defined in terms of FIRST.
  • aardvark,

    thanks a lot for the clear explanation of LL(1) grammar. it has helped me a lot.

    zaza

Why should I use an IDE?

In another question, Mark speaks highly of IDEs, saying "some people still just dont know "why" they should use one...". As someone who uses vim for programming, and works in an environment where most/all of my colleagues use either vim or emacs for all of their work, what are the advantages of IDEs? Why should I use one?

I'm sure this is a charged issue for some people, and I'm not interested in starting a flame war, so please only reply with the reasons you believe an IDE-based approach is superior. I'm not interested in hearing about why I shouldn't use an IDE; I already don't use one. I'm interested in hearing from "the other side of the fence", so to speak.

If you think that IDEs may be suitable for some types of work but not others, I'm also interested to hear why.

From stackoverflow
  • Saves time to develop
    Makes life easier by providing features like Integrated debugging, intellisense.

    There are lot many, but will recommend to use one, they are more than obvious.

    Simon Howard : Thanks for the reply, but if I thought they were obvious, I wouldn't have asked the question in the first place!
  • Intellisense. It helps a lot with exploring code.

    thursdaysgeek : s/alot/a lot/ (sorry, pet peeve.)
    Darren : ;) thats alright, my spelling, and grammar for that matter, is atrocious. Dictionary.com is my best friend.
    Yassir : I would say code completion instead of Intellisense
  • Having an IDE has the following advantages:

    • Compiling is usually "on the fly" which means no more switching to the command line to compile
    • Debugging is integrated, and having that in an IDE means that the step debugger actually uses your in-place editor to visually show you which code is executed
    • IDE's usually have more semantic knowledge of the language you're working in, and can show you possible problems while typing. Refactoring is much more powerfull than the "search replace".

    There are much more, maybe you should give it a try.

  • It really depends on what language you're using, but in C# and Java I find IDEs beneficial for:

    • Quickly navigating to a type without needing to worry about namespace, project etc
    • Navigating to members by treating them as hyperlinks
    • Autocompletion when you can't remember the names of all members by heart
    • Refactoring (massive one)
    • Organise imports (automatically adding appropriate imports in Java, using directives in C#)
    • Warning-as-you-type (i.e. some errors don't even require a compile cycle)
    • Hovering over something to see the docs
    • Keeping a view of files, errors/warnings/console/unit tests etc and source code all on the screen at the same time in a useful way
    • Ease of running unit tests from the same window
    • Integrated debugging
    • Integrated source control
    • Navigating to where a compile-time error or run-time exception occurred directly from the error details.
    • Etc!

    All of these save time. They're things I could do manually, but with more pain: I'd rather be coding.

    Svante : I guess emacs is an IDE, then ;)
    Jon Skeet : With the right plugins (or whatever they're called in emacs) then it certainly is. If you can build and debug in it, it's an IDE :)
    greyfade : Almost all of this can also be done in Vim for most of the popular languages. Integrated debugging needs a little work, but it's there.
    Jon Skeet : When it's acting in that way, I'd say Vim counts as an IDE then.
    Joachim Sauer : In my experience the biggest thing Vim and Emacs are missing from "real" IDEs (yes, I know they can be greate Development Environment) is the warning-as-you-type part. That would basically mean embedding an advanced compiler in the editor and I don't think they get that level of integration.
    polyglot : saua: have you looked at Flymake, http://flymake.sourceforge.net/? It at least provide some warnings-as-you-type functions to Emacs
    bene : there's also a vim pendant which started as GSoC project: http://code.google.com/p/codecheck/
    Casey : Warning-as-you-type, I assume John Skeet needs this for warning the IDE trying to correct the following code would be an attempt in futility.
    Roman A. Taycher : This is not what you meant, but I thought emacs was largly a emacs-lisp interpreter.
    Peter Ajtai : @Joachim Sauer - Emacs has a warning as you type .el available (I know it works for C++ and I think some other languages as well) ;)
    Bart van Heukelom : In Eclipse: - Viewing the class hierarchy - Finding references to a type or member throughout the workspace
    Josh Stuart : I recently had to go back to using a non php 'IDE' (new job didn't have one :S) and it was incredibly painful. You appreciate how much time it saves you when you have to go without! I usually use Komodo IDE for php dev and it is fantastic. Just the ability to ctrl-click a function or class call and be taken to it is a real time saver!
  • There might be different reasons for different people. For me these are the advantages.

    1. Provides an integrated feel to the project. For instance i will have all the related projects files in single view.
    2. Provides increased code productivity like
      1. Syntax Highlighting
      2. Referring of assemblies
      3. Intellisense
      4. Centralized view of database and related UI files.
      5. Debugging features

    End of the day, it helps me to code faster than i can do in a notepad or wordpad. That is a pretty good reason for me to prefer an IDE.

  • The short answer as to why I use an IDE is laziness.

    I'm a lazy soul who doesn't like to do things a difficult way when there is an easy way to do it instead. IDE's make life easy and so appeal to us lazy folk.

    As I type code, the IDE automatically checks the validity of the code, I can highlight a method and hit F1 to get help, right click and select "go to to definition" to jump straight to where it is defined. I hit one button and the application, with debugger automatically attached is launched for me. And so the list goes on. All the things that a developer does on a day to day basis is gathered under one roof.

    There is no need to use an IDE. It is just much harder work not to.

    Knobloch : If you are using Visual Studio .NET, F12 is mapped to "Go to definition." (I just discovered that) So you don't need to right-click to get to it. 8)
    David Arno : @Knobloch, I tend to use both VS2008 and Eclipse. Priviously I used FlashDevelop a lot. The "Go to definition" shortcut is different for all three, so I tend to rely on right clicking :)
    Simon Howard : Lazy is good. Thanks!
    le dorfier : And you can get intimately familiar with right-clicking on the menu bar, and choosing Customize/Keyboard Shortcuts.
  • I like an IDE because it puts a lot of functionality at my fingertips. Editing/Compilation/visibility of files in the project are all things I value in an IDE. I use Visual Studio now but in a former life I used SlickEdit and found that it made my development process more streamlined than when I wasn't using it.

  • IDEs are basically:

    • Editor w/code completion, refactoring and documentation
    • Debugger
    • Filesystem explorer
    • SCMS client
    • Build tool

    all in a single package.

    You can have all this (and some more) using separate tools or just a great programmable editor and extra tools, like Emacs (Vim as well but has a little less IDEbility IMO).

    If you find yourself switching a lot between one utility and the next that could be integrated in the environment or if you are missing some of the abilities listed here (and more completely in other posts), maybe it's time to move to an IDE (or to improve the IDEbility of your environment by adding macros or what not). If you have built yourself an 'IDE' (in the sense I mention above) using more than one program, then there's no need to move to an actual IDE.

  • I don't think it's fair to do the classic "text editor and console window vs IDE" when "text editor" is really emacs. Most features that are typical for IDE:s are also in emacs. Or perhaps they even originated there, and modern IDE:s are mainly interface improvements/simplifications.

    This means that for the original question, the answer is not so clear-cut. It depends on how people at the site in question use emacs, if they mainly use it as a text editor, or if they go all out and use custom scripting, learn the commands for the relevant modes, know about code tagging and so on.

    Simon Howard : Thanks. Apologies for the ambiguity; to clarify, as far as I know, the emacs users here use it as an editor, ie. in the same way that people would use vim. It is not used like an IDE.
    Jonathan Arkell : For the record, I use emacs like an IDE.
    jfm3 : Yeah, that's not a safe generalization. I use Emacs for all the IDE features mentioned in these answers.
    J.F. Sebastian : I think a time it takes to configure IDE-like features in a powerful text editor could be better spend coding in an IDE using out-of-the-box features.
    Dan : I use vim like I use an IDE.
  • A very good reason for using IDEs is that they are the accepted way of producing modern software. If you do not use one, then you likely use "old fashioned" stuff like vi and emacs. This can lead people to conclude - possibly wrongly - that you are stuck in your ways and unable to adapt to new ways of working. In an industry such as software development - where ideas can be out of date in mere months - this is a dangerous state to get into. It could seriously damage your future job prospects...

    Simon Howard : A valid point, although I think it depends on where you work. When I had my interview for my current job, I was specifically asked, "what editor do you use?" and when I replied that I use vim, the answer was "good!"
    Rich Bradshaw : Yeah, that sounds a very microsofty view of things. Using an IDE (without being able to code without) implies that you have no idea what's going on, using vi/a cli interface means that you actually know what's happening.
    David Arno : @Rich, that is just too funny. LOL.
    Xiong Chiamiov : I find it amusing that I could be seen as being "stuck in my ways" for using vim (or Komodo with vi-bindings) when I'm 20, starting serious programming 2 years ago, and these bindings for less than a year. Yes, I chose to work on a large-ish Java project in this environment, rather than Eclipse or Netbeans. I also rewrote all the Ant build scripts in Rake, because I consider Ant to be too old and verbose; how's that for not accepting new technologies?
  • Eclipse:

    Having code higlighting, compiling in the background, pointing out my errors as I go along.

    Integration with javadoc, suggesting variable names with ctrl-Space.

    When I compile, I get errors right there. I can double click on an error, and it displays the appropriate line.

    Really well integrated with JUnit, ctrl-F11 runs the test, tells me the tests have failed. If there is an exception in the output window, I can double click on a line, and takes me to the line that failed. Not only that, but ctrl-F11 makes sure everything is compiled before it runs the tests (which means I never forget to do that).

    Integration with ant. One command to build and deploy the application.

    Integration with debuggers, including remote debugging of web servers.

    FANTASTIC refactoring tools, searching for references to a section of code. Helps me know the impact of a change.

    All in all, it makes me more productive.

  • There's only one thing to consider when deciding whether to use an IDE or not, and that's whether it makes you more productive or not.

    Short question so short answer :)

    Simon Howard : Thanks for the response, but it was obvious that some people believe this before I submitted the question. I really want to know why you think it might make you more productive? Does it make you productive in some scenarios but not others?
  • Couple of reasons I can think of for using an IDE.

    Integrated help is a favorite. The built in Refactor with Preview of the Visual Studio Intellisense, syntax hightlighting, ease of navigation for large projects, integrated debugging, etc (although I know with addins you can probably get a lot of this with emacs and vim). Also, I think IDE's these days have a wider user-base, and probably more people developing add-ins for them, but I might be wrong.

    And quite frankly, I like my mouse. When I use pure text based editors it gets lonely.

  • It definitely leads to an improvement in productivity for me. To the point where I even code Linux applications in Visual Studio on Vista and then use a Linux virtual machine to build them.

    You don't have to memorize all of the arguments to a function or method call, once you start typing it the IDE will show you what arguments are needed. You get wizards to set project properties, compiler options, etc. You can search for things throughout the entire project instead of just the current document or files in a folder. If you get a compiler error, double-click it and it takes you right to the offending line.

    Integration of tools like model editors, connecting to and browsing external databases, managing collections of code "snippets", GUI modeling tools, etc. All of these things could be had separately, but having them all within the same development environment saves a lot of time and keeps the development process flowing more efficiently.

  • I'm not sure there's a clear dividing line between a text editor and an IDE. You have the likes of Notepad at one end of the scale, and the best modern IDEs at the other, but there are a lot of thing in between. Most text editors have syntax highlighting; editors aimed at programmers often have various other features such as easy code navigation and auto complete. Emacs even lets you integrate a debugger. The IDEs of even ten years ago had far less features to help programmers than you'd expect of a serious text editor these days.

  • Simply put, an IDE offers additional time-saving features over a simple editor.

    Simon Howard : What features in particular? This doesn't answer my question at all.
    Brian Knoblauch : Question was "Why should I use an IDE?". Answer is "It saves time".
    J.F. Sebastian : What features do you consider the time-saving?
    Brian Knoblauch : Just a few off the top of my (currently caffeine deprived) head. Code completion, code insertion/building. Syntax aware highlighting. Automated builds.
  • It depends highly on what you're doing and what language you're doing it in. Personally, I tend to not use an IDE (or "my IDE consists of 3 xterms running vim, one running a database client, and one with a bash prompt or tailing logs", depending on how broadly you define "IDE") for most of my work, but, if I were to find myself developing a platform-native GUI, then I'd reach for a language-appropriate IDE in an instant - IMO, IDEs and graphical form editing are clearly made for each other.

  • An IDE handles grunt work that saves you time.

    It keeps all associated project files together which makes it easy to collaborate.

    You can usually integrate your source control into your IDE saving more grunt work and further enhancing collaboration.

    If it has auto complete features, it can help you explore your language of choice and also save some typing.

    Basically, an IDE reduces non-programming work for the programmer.

  • An IDE can be a 'superior' choice based depending upon what a developer is trying to accomplish.

    An IDE can be 'superior' because IDEs are typically geared toward one (or a small selection) of languages.

    If a developer spends most of his/her time in a single languge or a 'cluster' of related languages (like C# and T-SQL), in one OS, then the GUI design, debug, intellisense, refactoring etc. tools offered by a good IDE can be very compelling. If, for instance, you spend most of your time working in VB.NET, with maybe a little T-SQL now and then, in a Windows environment, then you'd be pretty silly to not look at Visual Studio or a comparable IDE.

    I have no prejudice towards those who prefer IDEs or text editors, both can be very productive and useful if learned well!

  • Being the author of the response that you highlight in your question, and admittedly comming in to this one a bit late :) I'd have to say that among the many many reasons that have already been listed, the productivity of a professional developer is one of the highest regarded skills of a developer.

    By productivity, I mean the ability to do you job efficiently with the best possible results. IDE's provide this to you on many levels. Im not an emac expert, but I doubt that there are features that emacs have that any of the major IDE player dont have.

    Design, Document, Track, Develop, Build, Analyse, Deploy, Maintain (being key stepping stones in an enterprise application) can all be done within an IDE.

    I just dont see why you wouldnt use something so powerful if you have the choice.

    As an experiment, why dont you force yourself to use an IDE for, say, 30 days, and just commit youself to it, and after that 30 days, see how you feel. I would love to read your thoughts on what was learnt, etc...

    Porculus : There are features Emacs has that Eclipse, at least, either lacks or hides extremely well. For example, the ability to select a chunk of lines and sort them in-place. Emacs' fill-paragraph is also hard to beat when editing comments; Eclipse kind of has a similar feature, but it's extremely weak in comparison.
  • I think it has mostly to do with scope of awareness for the developer. The IDE provides a macroscopic view of the developer's work context. You can simultaneously see class hierarchies, referenced resources, database schemas, SDK help references, etc. And with so many things affected by, and affecting, your keystrokes, and the expanding volume of architectures and architectural intersections, it gets more and more difficult to work solely from one island of code at a time.

    OTOH, "just me and vim and the man pages" gives me a much leaner microscopic - but intense and precise - view of my work. This is ok if I have a well-designed, well-partitioned, sparsely coupled highly cohesive codebase built in one language with one set of static libraries to work from - not your typical situation, especially as dev team sizes grow and reshape the code structure over time, distance, and personal preference.

    I'm currently working on projects in Flex and .NET. One of the nicer things about Flex is how few different ways there are to accomplish a standard thing - pull data from a database, open/close/read/write a file, etc. (Yet I'm using the Flex Builder/Eclipse IDE - a typical heavy-weight example like VS, because I'm still learning the basics and I need the training wheels. I expect to evolve back to vim once I'm confident of my patterns.) In this view, I can do what I need to do professionally by knowing a few things really really well.

    OTOH, I can't imagine getting to that point with .NET because the view I'm expected to maintain keeps expanding and shifting. There much less conceptual integrity, and over several developers on a project over several months, much less consistency - but the IDE supports that, maybe encourages it. So the developer really needs to (and can more easily) know many more things adequately. Which also has the benefit of helping them answer (or even understand) a lot higher percentage of the questions on StackOverflow. I.e. we can have a deeper knowledge stack. And we can respond to a wider variety of help-wanted ads.

    Things can go too far in both directions. Maybe with the "editor-only" scope, it's like "if you only have a hammer, everything looks like a nail". With the IDE approach, for whatever you want to fasten together, you have a broad selection of fasteners and associated ranges of tools to choose from - nals/hammers, screws/screwdrivers, bolts/wrenches, adhesives/glue-guns/clamps, magnets, and on and on - all at your fingertips (with a wizard to help you get started).

  • I have used Emacs as my primary environment for both development and mail/news for about 10 year (1994-2004). I discovered the power of IDEs when I forced myself to learn Java in 2004, and to my surprise that I actually liked the IDE (IntelliJ).

    I will not go into specific reasons since a lot of them have already been mentioned here -- just remember that the different people love different features. Me and a colleague used the same IDE, both of us used just a fraction of the features available, and we disliked each others way of using the IDE (but we both liked the IDE itself).

    But there is one advantage with IDEs over Emacs/Vim related environments I want to focus on: You spend less time installing/configuring the features you want.

    With WingIDE (for python) I'm ready to start developing 15-20 minutes after installation. No idea how many hours I would need to get the features I use up and running with Emacs/Vim. :)

  • I do not understand what you are asking. You ask "Should I use an IDE instead of..." but I don't understand what the alternative is - VIM and Emacs fulfil many functions any IDE will give you, the only aspect they do not handle that a larger IDE may are things like UI designers. Then your question boils down to simply "what IDE should I use" with arguments to be made for the simpler realm of VIM and Emacs.

  • I prefer an IDE because it permits me to integrate editing/compiling/debugging, with a 1-click jump from error to line generating the error. Further, it permits multiple panes of information with OS-standard interfaces displaying the information. In short, it gives the user a mouse-based input interface with a modern output interface instead of relying on 1970s technology and interfaces for my help.

    There are more sophisticated users and uses for an IDE, I don't claim to use them or to know them all. When I have need, I will learn them.

    Luc Hermitte : Both vim and emacs have. Only the debugging could be a little awkward -- as most other gdb/dbx wrappers.
    Paul Nathan : I don't even want to think about the time I'd waste trying to get vim/emacs to do that. Time that I could be happily coding away on Visual Studio....getting real work done.
  • Don't think of it as exclusive. Use the IDE for the benefits it provides, and switch to vim/preferred text editor when you need some serious focus.

    I find the IDE better for refactoring and browsing and debugging and for figuring out what to do. Small things are then done right in the IDE, large things I flip to vim to finish the job.

  • In addition to the other answers, I love combining the developing power of an IDE with the editing power of vim using something like the ViPlugin for Eclipse.

  • Because ReSharper for vim and ReSharper for emacs don't exist.

  • I'm not entirely sold on the use of IDEs, however, I think that the most valuable aspect of a good IDE, like Eclipse, is the well-integrated Cscope-style functionality rapid comprehension of a large code base.

    e.g. In Eclipse, you see a method takes an argument of type FooBar, yet you have no idea what it means. Rather than waste a minute finding the definition the hard way (and risk all sorts of distractions along the way), just select FooBar, hit F3, and it opens the relevant source file to the very line that FooBar is defined.

    The downside of IDEs, in my opinion, is that they give you a bigger learning curve, except in the case in which you want to use the absolutely default configuration. (This is true for Emacs as well.)

    Xiong Chiamiov : Of course, that is why in Python we have docstrings. But alas, not everyone can be so lucky as to work in Python.
  • My main reason to use one is when the code goes beyond 100 files.

    Although ctags can do the work, some IDEs have a pretty good way to navigate the files easily an super fast.

    It saves time when you have a lot of work to do.

  • I come at this question from the opposite direction. I was brought up in programming with very few pitstops in Makefile+Emacs land. From my very earliest compiler on DOS, Microsoft Quick C, I had an IDE to automate things. I spent many years working in Visual C++ 6.0, and as I graduated into Enterprise Java, I worked with Borland JBuilder and then settled on Eclipse, which has become very productive for me.

    Throughout my initial self-teaching, college, and now professional career, I have come to learn that any major software development done solely within the IDE becomes counterproductive. I say this because most IDE's wants you to work in their peculiar I-control-how-the-world-works style. You have to slice and dice your projects along their lines. You have manage your project builds using their odd dialog boxes. Most IDE's manage complex build dependencies between projects poorly, and dependencies can be difficult to get working 100%. I have been in situations where IDE's would not produce a working build of my code unless I did a Clean/Rebuild All. Finally, there's rarely a clean way to move your software out of development and into other environments like QA or Production from an IDE. It's usually a clicky fest to get all your deployment units built, or you've got some awkward tool that the IDE vendor gives you to bundle stuff up. But again, that tool usually demands that your project and build structure absolutely conforms to their rules - and sometimes that just won't work for your projects' requirements.

    I have learned that, to do large-scale development with a team, we can be the most productive if we develop our code using an IDE and do all of our builds using manually written command line scripts. (We like Apache Ant for Java development.) We've found that running our scripts out of the IDE is just a click fest or an automation nightmare for complex builds, it's much easier (and less disruptive) to alt+tab out to a shell and run the scripts there.

    Manual builds requires us to miss out on some of the niceties in the modern IDE like background compilation, but what we gain is much more critical: clean and easy builds that can live in multiple environments. The "one click build" all those agile guys talk about? We have it. Our build scripts can be directly invoked by continuous integration systems as well. Having builds managed through continuous integration allows us to more formally stage and migrate your code deployments to different environments, and lets us know almost immediately when someone checks in bad code that breaks the build or unit tests.

    In truth, my taking the role of build away from the IDE hasn't hurt us too badly. The intellisense and refactoring tools in Eclipse are still completely useful and valid - the background compilation simply serves to support those tools. And, Eclipse's peculiar slicing of projects has served as a very nice way to mentally break down our problem sets in a way everyone can understand (still a tad bit verbose for my tastes though). I think one of the most important things about Eclipse is the excellent SCM integrations, that's what makes team development so enjoyable. We use Subversion+Eclipse, and that has been very productive and very easy to train our people to become experts at.

  • Intellisense, the integrated debugger, and the immediate window make me enormously more productive (VS 2008). With everything at my fingertips, I can keep the vast majority of an enormous project inside of my head while writing code. MS may keep dropping the ball on their OSs, but VS is one of the finest products ever developed.

  • An ide allows to work faster and more easily...

    I noticed I spent a lot of time navigating in the code in a simple text editor...

    In a good ide, that time goes down if the ide supports jumping to functions, to previous editing position,to variables... Also, a good ide reduces the time to experiment with different language features and projects, as the start-up time can be small.

  • For me, an IDE is better because it allows faster navigation in code which is important if you have something in your mind to implement. Supposed you do not use an IDE, it takes longer to get to the destination. Your thoughts may be interupted more often. It means more clicks/more keys have to be pressed. One has to concentrate more on the thought how to implement things. Of course, you can write down things too but then one must jump between the design and implementation. Also, a GUI designer makes a big difference. If you do that by hand, it may take longer.

  • GUI-based IDEs like Visual Studio and Eclipse have several advantages over text-based IDEs like Emacs or vim because of their display capabilities:

    • WYSIWYG preview and live editing for GUI design
    • Efficient property editors (eg. color selection using a GUI palette, including positioning gradient stops etc)
    • Graphical depiction of code outlines, file interrelationships, etc
    • More efficient use of screen real-estate to show breakpoints, bookmarks, errors, etc
    • Better drag and drop support with OS and other applications
    • Integrated editing of drawings, images, 3D models, etc
    • Display and edit of database models

    Basically with a GUI-based IDE you can get more useful information on screen at once and you can view/edit graphical portions of of your application as easily as text portions.

    One of the coolest things to experience as a developer is editing a method that computes some data and seeing the live output of your code displayed graphically in another window, just as your user will see it when you run the app. Now that's WYSIWYG editing!

    Text-based IDEs like Emacs and vim can add features like code completion and refactoring over time, so in the long run their main limitation is their text-based display model.

  • Its really VERY simple. But this answer is a bit of a paradox in that I am discussing something only EMBEDDED level developers ever encounter. The reason this is an odd view is that frankly when I was doing embedded work (the brief time I was making any real money) an IDE would be down right STRANGE and most of your coworkers would wonder why you can't remember enough about SNMP/ASN1 or whatever protocol you were dealing with to just /do your job/. BUT you can NOT as far as I know do a graphical simulation of what your ucontroller is doing in something like /real time/ without an "IDE".

Overriding ReadOnly Property in a subclass to make it Read/Write (VB.NET)

In C# I can have a base class with a property containing just a getter. Subclasses can then override the property and give it both a getter and a setter. This doesn't seem possible in VB.NET with properties since the property statement itself must describe whether it is ReadOnly or not.

In my example below, it doesn't let me make the ReadWriteChild compile. I guess I could make the parent Read/Write and then have the ReadOnlyChild's setter not do anything, but that seems sort of hacky. The best alternative seems to be abandoning properties in favor of getter/setting methods in this case.

Public MustInherit Class Parent

    Public MustOverride ReadOnly Property Foo() As String

End Class

Public Class ReadOnlyChild
    Inherits Parent

    Public Overrides ReadOnly Property Foo() As String
        Get
            // Get the Property
        End Get
    End Property

End Class

Public Class ReadWriteChild
    Inherits Parent

    Public Overrides Property Foo() As String
        Get
            // Get the property.
        End Get
        Set(ByVal value As String)
           // Set the property.
        End Set
    End Property

End Class
From stackoverflow
  • Might be a longshot ... given that my knowledge of VB.NET is minimal ...

    In C# you can specify the visibility of a property accessor independently of the property:

    public virtual string Name
    {
        get { ... }
        protected set { ... }
    }
    

    In this example, child classes can access the settor, but other classes cannot.

    Also note that overrides can have greater visibility than what they override - so you can do this:

    public overide string Name
    {
        get { ... }
        public set { ... }
    }
    

    Could you do something like this in VB.NET ?

  • Unfortunatly I haven't got visual studio on here so I can't confirm.

    Have you looked at using Shadows, this is effectivly the same as saying "new" in C# property declaration.

  • Given what you're trying to accomplish, and with the sample code you posted, VB.NET will not let you do this.

    Ordinarily, you can declare a property in VB.NET like so:

    Public Class qwqwqw
      Public Property xyz() As String
          Get
              Return ""
          End Get
          Private Set(ByVal value As String)
              //
          End Set
      End Property
    End Class
    

    Basically marking the overall property as public, but giving a more restrictive scope to the setter (or getter).

    The main problem in your case is the MustInherit (i.e. abstract) base class. Since the property you're defining in there is marked as MustOverride, you can't provide a default implementation (i.e. it, too, is abstract), and this includes the "Get" and "Set" outlines, therefore, whichever "overall" scope you give to this abstract property declaration, VB.NET will force you to use this scope for both the getters and setters within derived classes.

    Having the ReadOnly qualifier on the base class's property will force all derived classes and the implementations of this property to also be ReadOnly. Leaving off the ReadOnly qualifier still will not work, since whatever scope you give to the abstract property will be the scope you must apply to both the setters and getters within derived implementations.

    For example:

    Public MustInherit Class Parent
      Public MustOverride Property Foo() As String
    End Class
    
    Public Class ReadOnlyChild
      Inherits Parent
    
      Public Overrides Property Foo() As String
        Get
            //
        End Get
        Private Set(ByVal value As String)
            //
        End Set
      End Property
    End Class
    

    (Note the Private scoping on the setter). This will not work as VB.NET is insisting that since you're overriding the base classes property, your entire property must have the same scope as the property you're overriding (in this case, public).

    Attempting to make the base class's abstract property protected will not work either, since you would then be required to implement the property at the same level of scoping as it's declared in your base class (i.e. protected). Ordinarily, when not overriding a base class's abstract definition with a specific scoping level, you can give a getter or setter a more restrictive scoping level, but you can't give it a less restrictive scoping level.

    Therefore:

    Public MustInherit Class Parent
      Protected MustOverride Property Foo() As String       
    End Class
    
    Public Class ReadOnlyChild
      Inherits Parent
    
      Protected Overrides Property Foo() As String
          Public Get
              //
          End Get
          Set(ByVal value As String)
              //
          End Set
      End Property
    End Class
    

    (Note the public scoping on the getter). Doesn't work either due to the public scope being less restrictive than the overall property scope of protected, and moreover, not of the same scoping level as defined on the base class's abstract property declaration.

    If the design of your classes is as you mention in your question, I personally, would go with a "java-style" getter and setter methods as they can then be declared separately with their own scoping levels.

  • Confirm that MrEdmuno is correct in that you can use Shadow, however it appears you can't directly shadow something that is marked MustInherit, so you need to inherit into a class (Parent 2) ... then into your readonly (actually thinking about it you probably don't need to use shadows if you inherit into a class)

    I think my comment question still stands, why are you needing to do this ? If they are your own classes would you be better to modify those, or implement as a interface ?

    Public MustInherit Class Parent
    
        Public MustOverride ReadOnly Property Foo() As String
    
    End Class
    
    Public Class ReadOnlyChild
        Inherits Parent
    
        Public Overrides ReadOnly Property Foo() As String
            Get
                'Get the Property
                Return "Return"
            End Get
        End Property
    
    End Class
    
    Public Class Parent2
        Inherits Parent
    
        Public Overrides ReadOnly Property Foo() As String
            Get
                Return "Return 2"
            End Get
        End Property
    End Class
    
    Public Class ReadWriteChild
        Inherits Parent2
    
        Public Shadows Property Foo() As String
            Get
                '// Get the property.
                Return "2"
            End Get
            Set(ByVal value As String)
                '** Set something
            End Set
        End Property
    
  • To address what Bevan suggested, in VB.NET you can declare a property as having a public getter and a protected setter, as follows:

    Private _ExpectedTotalRoyalties As Decimal
    
    Public Property ExpectedTotalRoyalties() As Decimal
        Get
            Return _ExpectedTotalRoyalties
        End Get
        Protected Set(ByVal value As Decimal)
            If Not _ExpectedTotalRoyalties.Equals(value) Then
                _ExpectedTotalRoyalties = value
                SendPropertyChanged("ExpectedTotalRoyalties")
            End If
        End Set
    End Property
    
  • Do not try to override the property since it is not virtual. Override the OnReadOnlyChanged methods and handle your business there. Good luck

Harnessing the power of .NET Attributes

I would like to know if attributes can be used to "mix-in" functionality to a class / method / property.

Something like:

[TrackChanges]
public Foo
{
   get;
   set;
}

Does anyone how this would be implemented, if at all possible?

From stackoverflow
  • They certainly can but you will have to use reflection to do it. Also just because you can do it does not mean it is easy or elegant.

    Reflection will give you access to every member in any type you wish. You would have to retrieve those members and work through the .NET reflection API to manipulate them. While this may work it would not be the easiest thing to maintain or read.

  • Have a look at PostSharp, an AOP framework. It is a post-compiler, which uses custom attributes to inject additional behavior to existing code. Most of the examples are usually tracing and security.

Cross Domain Cookies With FormsAuthentication

I know the security risk associated and have brought it up with the business, but they want to have their 5 domains to share the login cookie.

We are using and have no plan to stop using ASP.Net Membership and Profiles. Is this possible? A hack would even be greatly appreciated.

From stackoverflow
  • It is not possible with out of the box ASP.NET.

    Forms based authentication is based on a cookie and cookies can only be set to a specific domain.

    If you want true cross domain (not sub domains) shared authentication, you need a Single Sign On solution.

    I've rolled my own and it's relatively simple. The basic principle is that you have a master domain which holds your authentication cookie (ticket). You then redirect to that domain from all other domains. It's not really pretty, but event Microsoft Passport worked that way.

    You can find a lot of examples on the net, take a look at these two links:

    Authentication cookies

    Cross domain authentication

  • Not only with ASP.Net is this not possible, but not at all. Cookies are always domain-specific - no commercial browser will work any other way. This is by design and very much necessary to prevent widespread abuse of cookies. Muerte pointed you into the right direction (single sign-on).

Java equivalent to WPF

DUPE: http://stackoverflow.com/questions/285147/what-is-javas-answer-to-wpf

Is there an Java equivalent to the WPF platform?

From stackoverflow

Good Economics book for developers

Joel mentions in several of his blog posts that it is very important for a developer/software entrepreneur to have solid understanding of Economics. Yet the Fog Creek MBA book reading list does not include any Economics books.

Is there any good material that people can recommend? Obviously, I am not as concerned about mathematical treatise as foundations and basic principles. For example, I was able to find a very good high-level read on Macroeconomics:

Concise Guide to Macroeconomics

but I am yet to find anything similar on Microeconomics. Any suggestions and reading pointers would be highly appreciated.

From stackoverflow
  • "Free to Choose" by Milton Friedman is an excellent treatise on free-market supply and demand economics

    ʞɔıu : Friedman is known mostly for macroeconomics, though (monetarism)
  • I think the best book for developers is one that would be entertaining and keep you reading. So while not exactly textbooks, I would recommend the Armchair Economist and Freakonomics as entertaining and educational reads.

    As a developer I also really enjoyed Trading and Exchanges which talks a lot about actual markets, and what the various participants are doing.

  • "Economics" by Paul A. Samuelson (MIT) and William D. Nordhaus (Yale).

    This is a classic and yet very readable. I cannot say how much I appreciate that book.

    I also recommend this a lot to my friends, though not necessarily on Economics.

    A Random Walk Down Wall Street: Including a Life-Cycle Guide to Personal Investing

    by Burton G. Malkiel

    JDelage : +1 for the Random Walk reference.
  • Economics in One Lesson by Henry Hazlitt. Informal writing style. Short. Good intro to economics. Comes from a Friedman bent. This is a great place to get an introduction to the subject.

    Jon : Actually Hazlitt was an Austrian and not a supporter of Friedman.
    Steve Rowe : Fair enough. It feels to my economically uneducated mind like something Friedman would agree with, but I'm probably mistaken.
  • Well, not exactly Economics, but The Complete Guide to Capital Markets for Quantitative Professionals is a fantastic book for developers in the financial sector.

    http://www.amazon.com/Complete-Quantitative-Professionals-McGraw-Hill-Investment/dp/0071468293

    I hope this was not too far off topic.

  • It's out of print, but look in your library for 'Famous Financial Fiascos ' by the Wall Street Journal editor John Train. This is a small, short, and fun informal book that will give life to the weightier tombs you'll need to read. It's very relevant to today, for sure.

  • It's a broad question, and the answer's likely to vary based on what precisely you're interested in. The Undercover Economist by Tim Harford is nice if you're just looking for a math- and theory-light explanation of basic concepts like rent seeking, etc.

  • All economics lies therein - as an outside observer it's a fascinating subject :)

  • The Undercover Economist is the journalist Tim Harford who writes for the FT and has written a book by the same name. In the same vein as Freakonomics - also an excellent book

  • I recommend Economics for Real People by Gene Callahan.

    While this book is a great intro for everyone, it's particularly suited to developers/entrepreneurs for several reasons.

    Economics is actually about people, and our choices and actions, not central planning and statistical models. Entrepreneurs who understand this reality and how it works are far more likely to succeed than those exposed solely to more traditional, mathematical approaches.

    Callahan presents economics from the Austrian School perspective. The Austrian School is based on deductive reasoning from simple first principles, which resonates strongly with me as a developer steeped in logic. It also doesn't hurt that Austrian School economists are the only people who foresaw our current economic disaster and offer the only rational approach to dealing with it.

  • Listen to Peter Schiff

    JDelage : +1 but he's mostly concerned with macro, not micro.
  • Listen to the radio (podcast) broadcasts at Financial Sense and read the articles.

  • A couple of other suggestions:

    The World is Flat by Thomas Friedman may be a useful book about globalization, businesses and a few other topics that are a tangent to economics.

    Reading List over on the Efficient Frontier site may also be worth reading from an investing or business view rather than the pure outsider perspective.

  • Economics by Walter J. Wessels, Fourth edition. Chapter 3 (from my own copy) sections:

    How to study supply and demand.

    Price.

    The demand curve.

    Supply and the law of supply.

    The supply curve.

    Market equilibruim.

    etc...

    I'm also a geek turned business owner. I also became fascinated with macro economics during the 2008 meltdown. Between this book, NPR's planet money podcast and a monthly subscription to the online version of ft.com I feel a lot more empowered. Also if you can get it, watch Bloomberg and listen to Tom Keene "On the economy" on Bloomberg radio available on Siruis satellite radio.

Visual Studio plugin to allow opening 2005 solutions with 2008?

Does anyone know if there's a plugin for Visual Studio 2008 that makes it possible to open VS2005 solutions in a non-destructive way?

What I'm thinking is that the converted project file is kept in memory rather than replacing the original on disk, and .Net framework 2.0 would be targeted by default?

The current behavior requires a complicated conversion process that destroys the original solution file and ends up with a project targeting the newer framework. I want something that would allow developers still using 2005 to continue working on the project.

From stackoverflow
  • The way I've seen this handled in open source projects is to create a solution file for each version of VS. Since the project files (csproj, vbproj, etc) are compatible across versions, you don't need separate versions of those.

    Joel Coehoorn : In that case, do you know a utility that, given a vs2005 solution, can create an equivalent vs2008 solution that still targets .Net 2.0?
    John Sheehan : By default, Visual Studio 2008 will open a 2005 solution and save it to 2008 format without changing the CLR version target. You'd have to manually specify .NET 3.5, it doesn't happen automatically.
  • Just open your 2005 project in 2008 and allow it to upgrade your solution/projects. You may get a dialog asking you to update CLR versions, just say no.

    Once you've got a working 2008 solution, copy the *.sln file to another name (I call my copy *.2005.sln), open the copied *.sln file in notepad, or your favourite text editor. Find "Format Version 10.0" on the 2nd line, and change to "Format Version 9.0". Save the file.

    That's it, your upgraded solution file works in VS 2008, and the one you copied and changed works in VS 2005.

    There's one extra step if you've got Web Application Projects. In the Web Application's vbproj or csproj file, find the line:

    <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplications.targets" Condition="" />
    

    and replace that one line with these two:

    <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v8.0\WebApplications\Microsoft.WebApplications.targets" Condition="'$(Solutions.VSVersion)' == '8.0'" />
    <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplications.targets" Condition="'$(Solutions.VSVersion)' == '9.0'" />
    

    Those two lines will conditionally select the correct MSBuild path depending on the version of VS used.

Change web project to class library

Is there any way but copying the .cs files?

Changing the .csproj file? But how?

There is a related question, but I'm not satisfied with the answer: link

From stackoverflow
  • You may not be satisfied with the answer, but it's still the right one and this is still a dupe I'm afraid.

    Honestly, it would take no more than an hour to refactor.

    Bertvan : It seems I *could* be changing the project file, but recreating the projects will probably be the fastest and most eye-friendly solution. Thanks!

How to use XFBML.ProfilePic

I am trying to display a Facebook user's profile picture using XFBML. I am using the following code:

var container = document.getElementById("profilePicture");
var profilePic = new FB.XFBML.ProfilePic(container);
//profilePic.setAttribute("uid", userId);
FB.XFBML.Host.addElement(profilePic);

How do I set the uid attribute of the element? (the commented line does not work)

From stackoverflow
  • Set the attribute before sending it to ProfilePic for processing:

    var container = document.getElementById("profilePicture");
    container.setAttribute("uid", userId);
    var profilePic = new FB.XFBML.ProfilePic(container);
    FB.XFBML.Host.addElement(profilePic);
    

Why can I not close a form in C#?

I cannot close one of my forms programmatically. Can someone help me?

Here's the code:

    private void WriteCheck_Load(object sender, EventArgs e) {
        SelectBankAccountDialog sbad = new SelectBankAccountDialog();
        DialogResult result = sbad.ShowDialog();
        if (result == DialogResult.Cancel) {
            this.Close();
        } else {
            MessageBox.Show(result.ToString());
        }
        MessageBox.Show(sbad.bankaccountID.ToString());
    }
From stackoverflow
  • By calling Form.Close(), the form should close, but not until all waiting events have been processed. You also still have a chance to cancel the form closing in the FormClosing event.

    First, you'll probably want to return after your call to this.Close(). If it still doesn't close, step through your code and see what is happening. You may have to set and check a "forciblyClose" flag and return from any other processing methods before it'll actually close.

  • I would wrap all of that code in a try/catch and log the exception. By default, event handlers in Windows Forms will swallow exceptions, and I assume that is the case here.

    Malfist : What does wrapping everything in a try/catch block have to do with the question? Nothing is throwing an exception.
    Geoffrey Chetwood : @Malfist: Your tone conveys a severe lack of appreciation for people who are trying to help you.
    Malfist : No, I was just asking a question. I was not being hostile. However, you sir, are. I express my severe lack of appreciation for you Rich B.
  • The actual problem is that windows won't let a form close on it's load method. I have to show the dialog on construction, and then if the dialog result is cancel I have to throw an exception and catch the exception on form creation.

    This place talks more about it

    configurator : It's a little more subtle than that; the Close() call does close the form, but that is before the Show() or ShowDialog() has had the chance to show the form - so what happens is the form is first hidden, then shown (outside the Load event).
    Malfist : Ah, thank you for the clarification.
  • As configurator mentioned (in comments), the form must be shown before it can be closed, so, instead of the Load event, you should be doing this in the Shown event instead.

    If you don't want the form visible for the Dialog box, I guess you can wrap the event code in a Visible = false;

    In summary, the basic code would be

        private void WriteCheck_Shown(object sender, EventArgs e)
        {
            Visible = false;
            SelectBankAccountDialog sbad = new SelectBankAccountDialog();
            DialogResult result = sbad.ShowDialog();
            if (result == DialogResult.Cancel) {
                this.Close();
            } else {
                MessageBox.Show(result.ToString());
            }
            MessageBox.Show(sbad.bankaccountID.ToString());
            Visible = true;
        }
    
    Malfist : it can be visible, it just didn't have it as such.
    johnc : That's cool. It's a gotcha that caught be a year back, so happy to pass it on.

License restrictions on including a DLL in another repo?

Answered:

They don't allow any kind of redistribution with 2.6, supposedly, unless you have licenses for it. But they don't sell licenses for it. But they give it away free. But, who knows, i think they just want us to buy an overpriced thing we don't need to write a free utility. I guess I'll look at NVelocity or TaHoGen...

I am concerned about placing some DLLs that go with a project, which is also free (on SF.net), but hasn't had a particular license associated with it yet. This is a bit lawerly, but hopefully not so much so that it can't be answered through experience. And there is a lot of that here :)

I think the issues is really with CodeSmith 2.6, since they have their own "custom" eula. To view the "sourcelicense.txt" you need to download the zip and open it, but i've copied the relevant parts into the post (sorry they are so long!)

Edit:

What the app does it use CodeSmith 2.6 dlls, along with a collection of custom templates, to generate class files/etc. We don't need the codesmith source, only the compiled result. Of course, those dll's will be distributed with the application in the .exe. The question is whether or not stuffing them in to the repo is somehow different (or legally more questionable) than putting them into a .msi/.exe installer.

I'll approach codesmith about this, but I would like a better understanding than I have now, is all. They are currently not in the repo, but it would ease things for the dev processess if they were. End Edit

  • 1 MIT Licensed component (doesn't seem like an issue)
  • Mysql.Data.dll (not sure of the license)
  • CodeSmith 2.6 Freeware DLLS
    • Compiled to DLL form
    • SchemaExplorer.dll / etc
    • CodeSmith.Engine.dll

I'd like to be able to make the project self hosting, and not have the user go traipsing around, downloading and/or compiling copies of the source (especially if they find a newer version or older verision, which could easily happen with the MIT/msql components.)

There will be nice instructions if the DLLs can't be included, but life is infinitely simpler if they can, and there are no chances of the project going "dead" if one of them is suddenly yanked.


SOURCE CODE LICENSE (from CodeSmith 2.6 eula/sourcelicense.txt)

The SOURCE CODE is protected by United States copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The SOURCE CODE is licensed, not sold.

  1. GRANT OF LICENSE. This EULA grants you the following rights:

    1. Source Code. You may install and compile one copy of the SOURCE CODE on a single computer. The primary user of the computer on which the SOURCE CODE is installed may make a second copy for his or her exclusive use on a portable computer.
    2. Storage/Network Use. You may also store or install a copy of the SOURCE CODE on a storage device, such as a network server, used only to install or compile the SOURCE CODE on your other computers over an internal network; however, you must acquire and dedicate a license for each separate computer on which the SOURCE CODE is installed or compiled from the storage device. A license for the SOURCE CODE may not be shared or used concurrently on different computers.
    3. Use and Modification. SMITH grants you the right to use and modify the SOURCE CODE to better fit your needs. You may not distribute the SOURCE CODE, or any modified version of the SOURCE CODE, in any form. Any modifications made to the SOURCE CODE will continue to be subject to the terms and conditions of this EULA. Any modified versions of the SOURCE CODE may only be executed in object form by users also owning a SOURCE CODE LICENSE or by users owning a CodeSmith Professional license.
    4. Use of Generated Output. You may distribute the output of your custom templates or the included templates in any way.
  2. DESCRIPTION OF OTHER RIGHTS AND LIMITATIONS.

    1. Separation of Components. The SOURCE CODE is licensed as a single product.
    2. Redistribution. The SOURCE CODE may not be redistributed in any way.
    3. Custom Template Distribution. You may distribute your custom templates for the SOURCE CODE only if they are offered free of charge.
    4. No Rental. You may not rent, lease, lend or provide commercial hosting services to third parties with the SOURCE CODE.
    5. Non-Transferable. This license may not be transfered or sold in any way.
    6. Termination. Without prejudice to any other rights, SMITH may terminate this EULA if you fail to comply with the terms and conditions of this EULA. In such event, you must destroy all copies of the SOURCE CODE and all of its component parts.
  3. ADDITIONAL SOFTWARE/SERVICES.

    1. Support Services. SMITH may, but is not obligated to, provide you with support services related to the SOURCE CODE.
    2. Supplements. This EULA applies to additional software and updates of the SOURCE CODE, including without limitation supplements, service packages, hot fixes, or add-on components (collectively "Supplements") that SMITH may provide to you or make available to you after the date you obtain your initial copy of the SOURCE CODE, unless other terms are provided along with such Supplements.
  4. COPYRIGHT. All title and copyrights in and to the SOURCE CODE (including but not limited to any images, photographs, animations, video, audio, music, text, SAMPLE CODE, and "applets" incorporated into the SOURCE CODE) and any copies of the SOURCE CODE are owned by SMITH. The SOURCE CODE is protected by copyright laws and international treaty provisions. Therefore, you must treat the SOURCE CODE like any other copyrighted material except that you may install the SOURCE CODE.

From stackoverflow
  • I'm not familiar with what CodeSmith does, and I don't know exactly what you're doing with it. Obviously, you aren't going to redistribute source code, but they don't seem all that concerned with what you might redistribute.

    There's that "Use of Generated Output" clause; are you going to be distributing template output only? Were you going to change their source code for this project? Without knowing the answers to questions like these, I can't advise you.

    You could clarify what you're doing, or ask CodeSmith. I'm not sure that finding a lawyer who can answer your specific questions is going to be easy, as there's a lot of technical stuff going on in that license.

  • First: Stackoverflow is not a lawyer and can not provide legal advice. Take any legal information here with a grain of salt, and ask a lawyer if it matters.

    Umm, that isn't anything close to a free software license, so I don't think it follows sf.net rules.

    It doesn't grant you any permission to redistribute, either. In fact, it bars it:

    2.2 Redistribution. The SOURCE CODE may not be redistributed in any way.

    Possibly, your DLL is a "custom template", in which case it must be distributed free of charge, which violates clause 1 of the Open Source Definition

    Custom Template Distribution. You may distribute your custom templates for the SOURCE CODE only if they are offered free of charge.

    Other than that, you definitely need to clarify what you're doing.

    Andrew Backer : Well... since it is codesmith, and I indicate that I am including the CodeSmith .DLL files (from the nice file list), i'm probably (and actually) using it to generate output from custom templates. As part of an integrated app. Since it doesn't say you can't redist the compilation artifacts...