Javascript built-in documentation/help functionality [closed] - javascript

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
When writing code in Java, the nice thing is that the IDE provides code-completion and auto suggestions mainly because Java is strongly typed language and therefore static type analysis can be achieved. When writing code with any library, or even with the standard JDK for that matter, I can easily reason about APIs (return types, and input parameters, etc.) for any given method of a class. If I need further understanding, I read up on standard JDK documentation or documentation for that given library.
With python, since the language is dynamically typed, type inference happens at runtime, for me, it's often a bit trickier to reason about APIs because there is no compile time checking. However, I can still be as productive because python offers built-in things such as the "dir" command which tells me everything about a particular object (methods, magic methods, fields, etc.) and also the built-in "help" command provides documentation at the command line for any type/class/module.
Does Javascript provide anything similar to python in that regard? I'd like to be more productive when coding in Javascript, but tabbing back and forth betweeen documentation and writing code has slowed me down a bit. Is there a better suggested approach?

Sublime text has a plugin called docblockr that works quite well. However, many IDE's (eclipse/intellij/sublime text are my favorite three) support this feature.

Languages and IDEs are two different things. A language can be supported by multiple IDEs, and it is possible for an IDE to support multiple languages. So, there is no such thing as "the Java IDE" -- there are many IDEs that support Java. The same applies to Javascript.
What you need to do is just search for an IDE (and/or plug-in for that IDE) that supports the features that you would like for your chosen language.
I happen to be partial to the eclipse IDE, which supports many, many different languages, including Javascript. Here is a link that might be helpful. But there are many other choices out there. The choice is up to you.

Related

How to Remove Unused javascript From Website [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I'm trying to speed up my website. I used www.unused-css.com/ to trim away excess CSS, but I cannot find anything similar for JavaScript. Is there an online service that can detect the js code being used and then trim away the unused code?
Here is the website with the problem: IQ Tests for Kids
I'm using bootstrap code and it is very bloated. I'm sure that I'm only using a fraction of js because I trimmed down my HTML as well.
The best you are going to get is running the JavaScript itself through a dead code removal process, such as the one provided by the Google Closure Compiler with ADVANCED_OPTIMIZATIONS enabled or Uglify's dead_code option. Some people even combine both of these.
Tree shaking is an even better process you will hear people talk about. But this is more difficult to achieve in your case, because tree shaking involves using ES6 modules, which the code you are dealing with almost certainly is not. Thus it would be a lot of work to get that going, as you would have to modify the code.
Don't know any online tool for that, but there are techniques to do what is called "tree shaking". You can google about it more.
Best my used tools to have it working are webpack and Flow
Webpack is quite general tool to make all kind of magic with JS, while Flow is type checking tool which, if you have type checking active can provide very good tree shaking.
But as you mentioned, you are using Bootstrap, so best place to start looking at would be customize your build:
http://getbootstrap.com/customize/

Javascript library for graphs (in the mathematical sense) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Are there any significant Javascript libraries for graph and network representation, with common algorithms, optimization, etc.? I'm imagining something like the C++ lemon library, with graph search, shortest path, maximum flow, and so on.
Google draws a blank, because the results are completely flooded with graph- and chart-drawing libraries.
Take a look at http://www.graphdracula.net/
It's got a number of algorithms including:
bellman-ford
dijkstra
floyd-warshall
You may be interested in Cytoscape.js, an open-source JS graph theory library. It can be run headlessly or with an interactive visualisation. It is styleable via CSS-like files, has built in gestures, support for touch devices, node.js, etc.
There's a bunch of algorithms now, and there will be many more shortly -- i.e. more complex algorithms like PageRank etc.
http://cytoscape.github.io/cytoscape.js/
Disclaimer: I work on the project
node-dijkstra
A NodeJS implementation of Dijkstra's algorithm
Study a graph, generally require a lot of computer effort, expecially for large graph (I don't know what kind of graph you are trying to analyze) but if it is simple, probably you didn't need libraries. You will never find what you're looking for... it's even difficult to find something like that for the common languages, I don't think that a scripting language studied to render HTML page can help you, expecially because it lives embedded in a browser that is neither studied nor capable to have the proper performance to your purposes.
I'm sure that you're only way is programming and perform analyzes on your graph through a server side programming language, in this case you will have a dedicated machine that performs operation on a graph and it has more sense.
I suggest you .NET because you can use your lemon library ... By the way have you ever tried SNAP http://snap.stanford.edu/ it's the best library you will ever find, I really suggest as a C++ library... take care that it lacks on documentation.
I'm sorry for javascript, but you will realize that I'm right

Tutorial or Book on implementing a metalanguage in Javascript [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I've been working in Javascript and PHP but I find that the hardest part isn't the implementation but the design of the webapp architecture [as usual . . .] In that direction, I wanted to create a sort of meta-language that takes PHP code as input but outputs JavaScript code thus making the design and implementation phase less painful [s.t. similar to GWT, Google Web Toolkit]. I found writing the this interpreter from scratch [parser, lexer, . . .] a viable option but an long one. Then I came across Processing.js [a library created by John Resig] where the user actually write java-like code that is transformed in Javascript by Processing.js then evaluated. I've searched the web for tutorials that introduces this powerful Javascript capability but didn't find even one! Can anyone PLEASE help me with any link, book title where I can get a least an intorduction? Thanx for your response!!!!
I would say your best deal would be to go with Haxe.
Haxe is a language that is designed to target (be exported) into the following platforms:
JavaScript
Flash
PHP
C++
Making it a very powerfull resource when creating web Apps as you can write in Haxe and have all your code ported to JavaScript, Flash, PHP or C++ without hassle.
Honestly, I think processing.js is not suitable for what you want, it was made to deal with the new canvas element, not the webpage.
Also, I think (honestly) think it sucks. They parse processing using Regex, it is totally wrong, you can't parse a programming language using Regex.
There is a javascript compiler compiler, called JS/CC, it is very easy to use, just learn the grammar and you can make a simple programming language.
But if you wanna make a complicated language (like processing, or php) by yourself, get ready for the nightmares.
PS: You'll need to know Javascript to implement a programming language in Javascript...
How about creating some PHP-functions that generate JavaScript-code? I do not think that you really need to write an interpreter for a custom script language. Ruby on Rails used to generate some JavaScript with simple Ruby-code, for example.

Any good javascript BBCode parser? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
Currently i'm parsing bbcode server side but i'd like to show a preview just like this site does.
If I process the bbcode serverside using ajax it's a bit laggy, so i thought doing it client side, to just show the preview.
Do you guys know any bbcode parser written in javascript?
It is a bit late, and the question has certainly been answered. However if you are still open to suggestions, and have not yet spent your time converting the indicated parser from C# to JavaScript, I have written a parser (originally in PHP) which I converted myself[2] to JavaScript. It is available at bitbucket under the 3-clause BSD license. The parser seems to be reasonably fast, but I haven't performed any analysis on its speed.
It may not be as flexible in some ways as other possible projects out there, but it does allow defining your own codes ("bb-code" or not, with quite a few properties), and is also all contained within the one file. This is not a simple find-and-replace parser, and is not based on regex.
If this is of any interest to you, it might save you from having to convert that other library. Technically, I'm a relative "unknown", but that's the great things about JS/OSS: you can check out the source to see what I've done.
[2] As a result, there are a few remaining "compatibility functions", but I rewrote things which had native equivalents available.
I haven't personally used any Javascript BBcode parsers, but the top two Google results (bbcodejs and this blog post) seem pretty weak. The former only seems to support simple find-and-replace, and the latter seems to have pre-set BBcode built in, so you'd probably have to hack it a bit if you chose that solution.
Your best options are probably to roll your own solution (possibly basing your work off one of the two links here), or just use AJAX and move on. That's probably the best way to ensure that previews are accurate, and previewing doesn't have to be real-time on every keypress, anyway; a delay before even sending the request is acceptable.
I encountered the same problem, so I wrote my own. That supports BBCode -> AST Array -> any kind of markup, now supports HTML and React. And has plugins and presets support
https://github.com/JiLiZART/bbob

which ajax script library do you recommend? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
There are a lot of JavaScript libraries out there these days (extJs, Scriptaculous, Dojo, prototype, Solvent and many more). Couldn't find any site comparing cons and pros.
Could anyone give recommendations?
Things to consider:
- size
- performance
- Cross-Platform
- ease of use and documentation
- (special reason to use a specific one when developing in python/Django?)
Thanks!
Yaniv
jQuery is very good, and probably the most common.
jQuery is the most popular right now, and for good reason!
It is very lightweight. The mimified version is only 19kb.
You can use the jQuery hosted by google for increased speed, (using this there is a chance that your user already has it cached).
It (almost always) works the same in all browsers, stopping the need for a lot of the previously hated cross-browser development testing.
It is based on CSS which is familiar with web designers.
It uses CSS3 componenets.
It has a HUGE number of plugins available from the community. It is also easy to write your own.
It is used by some massive web companies. StackOverflow, digg, Dell, Google etc.
Don't forget jQuery
And I think it's more like cross browser than cross platform.
In my opinion, the most important thing to consider when choosing a framework is coding style. Every framework does roughly the same thing, but in different ways.
My advice is to choose the one that makes most sense to you. The size, performance and browser compatibility is about the same in every framework.
You may also want to take a look at "Comparison of JavaScript frameworks" at Wikipedia for some technical details about each framework.
I'll have to agree with the above (i.e. jQuery) - but also recommend Prototype
Prototype is a clean, simple, lightweight javascript engine that is server side language agnostic.
My answer to a very similar question:
Jquery
Fast
Well documented
Easy to use
Chaining
Unlike prototype it doesn't extend an object if you didn't specifically ask for it (try looping an array in prototype)
easy-to-use AJAX (I love the $.ajaxSetup() function)
Nice Event handlers
CSS selectors
filtering your selection
did I mention chaining?
Small (only 30kb)
Nice little build-in effects.
Plugins
(https://stackoverflow.com/questions/394601/which-javascript-framework-jquery-vs-dojo-vs/394837#394837)

Categories

Resources