Help re programming language
Dr_Acula
Posts: 5,484
I'm looking for a new programming language. I've been using Microsoft products starting withMicro-Soft BASIC from the late 1970s, all the way through to the latest version of vb.net. But vb.net is getting harder to use. If I try to run the latest version on an old operating system (XP) I get problems. So I tried to run an old version of vb.net on the newest OS (Win 8.1) but I can't find any old versions. It gets difficult developing for a wide range of users, and these days that includes Linux and Apple as well.
I want to rewrite my Propeller IDE (that does things like create movies for the propeller) into a format that more people can use.
So - I went searching for a language that will run on a variety of computers and operating systems, and which is similar to .net
I think I have found one called Xojo. At the bottom of this thread is a little program I wrote - I'd be very interested to know if it can run on different machines. Xojo seems to be free - but the catch is that you have to pay for the version that can compile programs. However, if anyone can open the original source and compile it themselves, maybe that does not matter?
I'm testing the limits of the program but so far things seem pretty cool. I managed to write a web broswer with one line of code!
Start with the main form. Drop in a button, a text box and an html viewer box. In the text box, change the default text to the website address. Then click on the button and in "actions", add this line of code.
Compile the program and run. Screenshots below.
Xojo will run on Apple, Windows and Linux machines.
Anyone have any experience with this program? And if so, if anyone would be so kind to unzip my little program and see if it runs, that would be very helpful.
http://www.xojo.com/
I want to rewrite my Propeller IDE (that does things like create movies for the propeller) into a format that more people can use.
So - I went searching for a language that will run on a variety of computers and operating systems, and which is similar to .net
I think I have found one called Xojo. At the bottom of this thread is a little program I wrote - I'd be very interested to know if it can run on different machines. Xojo seems to be free - but the catch is that you have to pay for the version that can compile programs. However, if anyone can open the original source and compile it themselves, maybe that does not matter?
I'm testing the limits of the program but so far things seem pretty cool. I managed to write a web broswer with one line of code!
Start with the main form. Drop in a button, a text box and an html viewer box. In the text box, change the default text to the website address. Then click on the button and in "actions", add this line of code.
htmlviewer1.LoadURL(TextField1.text)
Compile the program and run. Screenshots below.
Xojo will run on Apple, Windows and Linux machines.
Anyone have any experience with this program? And if so, if anyone would be so kind to unzip my little program and see if it runs, that would be very helpful.
http://www.xojo.com/
Comments
Win7/64
This reply send from your application.
I haven't used XOJO for anything so far, only played around a little.
C.W.
I've been reading through the tutorials - all looks familiar to my vb.net eyes, but at the same time, simpler and more intuitive.
--markM
.
Mark,
You need to install the free version of XOJO from this site: http://www.xojo.com/
C.W.
Noooo, no, no, I say no!
I admire you desire for a change.
You have been living in a cage, under a rock, in the dark, for too long. It's time to blossom.
What do I mean by all that?
With VB we have a single source of supply, a closed source, proprietary, pay for, non-standard system. That may be nice if you are in business but it's not the way to go if you want to share your creations with the wider community, perhaps even attract contributors to a project, or just let the takers take and have fun. It's a dead end, leaving you in a cage, under rock, in the dark.
Xojo is not the way out of that. It's just a jump out of the pan into the fire. Yet another single source of supply, closed source, proprietary, pay for, non-standard system. Useless. We cannot even run the code you posted without signing up before we can get a download of whatever it is that runs it. No thanks.
What to do?
I firmly believe that the tool you are looking for is right under your nose as you read this. Yes, that web browser.
You want to make GUI apps? Look at what happens in the browser: buttons, menus, pop ups, drop downs, check boxes, radio buttons, text input, images, maps, 3D accerated graphics even. Everything. If you can do it in VB you can do it in the browser.
What about the langage? Not VB, thank God, but JavaScript. A much more advanced language than even C++ but easy to learn anyway.
What about interacting with my Propeller? No problem, under Chrome at least you can use your computers serial ports. Admittedly that is not from a web page full of JS but a "Chrome App" for the Chrome browser. No problem, that is easy to do.
Or if you want to be really "web" centric what about running a web server on you local PC that the browser connects to? A simple web server in JavaScript is all of ten lines of code. It can then access all your local files and serial ports and whatever you want to do.
Think this is all crazy?
You have the brains and enthusiasm and tenacity, we need your help. Look at what is going on here:
http://parallax.msrobots.net/Editor13.htm
and here:
http://the.linuxd.org:3000/
Editing and compiling Spin in the browser. Soon programming the Prop, from the browser.
It's all very rude and crude at the moment, but it shows what can be done.
We need your help!
>$900 for 12 month? Then renewal needed? Even VS is not expensive like that.
Enjoy!
Mike
While all library-based solutions require additional components, you can create a distribution that has everything needed to run your program.
Just as a BTW, you can keep old versions of VB.Net on your computer. The solution files are tagged with the version that created them, so if that version is available, the solution will (or should) open with that version. I still have some projects dating back to VS Studio 2003. The projects won't recompile in later versions due to changes. My machine still has the Framework 2.0 files on it that the build requires, and Microsoft continues to make these available for download. Disregarding the fact that come April 8 Microsoft will no longer support XP (meaning no more security patches, making XP a danger to use), there should be fewer and fewer people who use it anyway.
No. I cannot let that stand. Did you check the links I gave above?
Go here: http://parallax.msrobots.net/Editor13.htm
Select a Spin file from the list on the right hand side.
Hit the "Compile binary" button from the bar at the top.
Be amazed as that Spin file is downloaded and compiled in your browser using JavaScript nearly as fast as it is using the Propeller tool or openspin natively!
Cross- browser is not an issue. This all works on Windows, Max and Linux with Chrome, Firefox, Opera. I have seen it working on Android and iPhones as well. Who cares if it does not work on some old IE versions?
By the way, JS itself was never really a "cross-browser" problem. Microsoft did a very good job of cloning JS from the very beginning, warts and all. so much so that those warts ended up in the ECMA standards for JS.
The browsers document object model is another story, but most of that can be ignored by using libraries like Bootstrap, jQuery, Angular etc.
Edit: By the way. Mono executables, AKA .Net assemblies or whatever they are called, are also interpreted. Same like Java.
How long should this take ?
All I see is one line - which is less than I expected ?
2014-03-11 13:22:29 . execute Openspin -e ADC.spin...
You have a legacy browser.
Do you have a moment for a quick experiment?
Go here http://the.linuxd.org:3000
Hit the "Spawn Worker", "Send files to worker", and "Compile" buttons. In that order.
What do you see in the window below the editor? Should look like:
That is a rude an crude experiment going on.
msrobots said ">$900 for 12 month? Then renewal needed? Even VS is not expensive like that."
I was hoping to get around that by sharing the source code so you could use the free version. With success above on Macs, that is a +1 to that little experiment. I would not spend $900 either. I spent $125 to get a better version of Eagle PCB, and I am happy to buy windows operating systems, but $900 is too much.
Mono looks interesting.
Like .net, XOJO has some things I now cannot live without - autocompletion of classes, auto indenting, syntax checking while typing.
Ok, to heater...
I've been following your work on the open source compiler. I check in almost every day and read what you are doing. It is great stuff!
So here is a challenge. Is there a programming language that has a modern IDE where it is possible to write that IDE in the same language?
For example, I have written several IDEs in vb.net for propeller projects. I wanted to add color syntax highlighting. I got inside the methods of the richtextbox and that does enable color highlighting, but it is very slow - 10 to 30 seconds for a not very big chunk of text. In vb.net and vb5,6 etc previously it seems that for the last 25 years there have been two ways to do things - the 'official' way where you use a class, and the 'old skool' way where you get right inside the code and break rules and use things like GOTO. And the old-skool way persists because it is fast enough to get the job done.
There is another problem trying to find a language that is good enough to write its own IDE, and that is that it is very hard to search for the information. Search for autocompletion and you will get lots of hits about how this works in an IDE, not how to code it. The ultimate would be a class called a 'richcodebox' which would do all this stuff automatically.
I've been following all the difficulties with javascript. And been very impressed as you have solved each problem.
Can you give me a crash course here? Can javascript open a file on my computer, edit it and close it? If yes, isn't that a security risk? And if no, how do you write a compiler?
Thinking of javascript (and yes, I'm tempted to check it out), some things I've had a need for in the past:
* Open, close and edit text files
* Talk to a serial port (FDTI chipset on a USB)
* Syntax color highlighting in real time, auto indenting, dropdown menus for class methods, squiggle underneath for syntax errors.
* Easy to use graphics - load in a bitmap into a picturebox, read the value of the pixel at location 50,50 and make that one pixel red.
Here's what would be really cool. You have an IDE and on the left side are pictures of buttons and text boxes etc, and you drag them to the main form, lay them out, and click on each element and write the code for each element. Next, you write a program to replicate that IDE - menu buttons down the left side etc. You save that program in your favorite language - let's say it might be C because this is the closest to working with C. Next, you write some primitives in C to do things like draw buttons. Then you run that program on the Propeller. What you would have is an open source IDE that you can run on a PC, and you would have the same open source IDE which would run on a propeller. Ok, the graphics won't be as good on the propeller, but it would be usable.
Right now we have all these different languages. Hardly anyone outside the propeller world knows Spin. Simple versions of BASIC run on the propeller, but not the versions of BASIC people have been using on PCs for the last few decades. C will run on both, and C is the closest to working.
So - javascript. Can javascript run on the propeller? Javascript is running in a browser. Can you write a browser in javascript.
Maybe I am going off on a tangent. It was really cool getting XOJO to write a browser with one line of text. And I know the propeller has the smarts to do all the graphics of a browser, especially with the full color touchscreens. It is just the code.
The QtCreator IDE is used for writing C++ GUI apps with the Qt GUI libraries. QtCreator is of course written in C++.
There may be others. Surely Microsoft Visual C++ or whatever it is called now a days is written in C++. I guess there just aren't that many people in the world wanting to write that kind of editor/IDE.
But let's take the case of Spin. Over the weekend I created a simple Spin Parser in pure JavaScript, uses no libraries, It takes a source file in and spits out a list of all the required sub-objects and all the PUP and PRI methods in the source plus all their parameters. Use that parser again on that list of sub-objects and you now have all the public methods available to the original file.
That is the start of auto-completion and those red squiggles whilst editing. If what you have typed is not in that list of PUBS it's an error. I won't say JS does not have difficulties of it's own but the big issues with getting openspin running in the browser, memory alignment and memory leaks, were issues in the original C++ code not the JS No. Of course you can get local files in and out of the browser but that manual intervention is always required for each one for security reasons.
However, my experimental Spin compiler in the browser read and writes files to my PC at the press of a load/save button all the time. All that requires is a web server running on the PC that accepts the files from the browser and writes them to disk.
That webserver in my case is 20 lines of JavaScript. Very easy and flexible. Yep. See above. Yep.
There are two ways to do this:
1) Use the Google Chrome browser and make your web page and JS into a "Chrome App". Then it has access to the serial ports. People use this for programming Arduino.
2) Use that simple 20 line web server mentioned above. That can easily be extended to talk to your Propeller or any other device and relay the characters to from he browser.
I intend looking at both those solutions soon. Yep. See the web editor links posted above and elsewhere. No. That where we need you help:) See parser above. We need your help. Can be done. I have seen some amazing demos of image editing in the browser. No idea if it's easy or not. Impossible I say Yes. Using the Espruino JavaScript engine, or rather it's forerunner TinyJS, and a pile of external memory. Don't think about it, it's very slow. We will no doubt see the Espruino JS engine running on the P2 just for fun if nothing else. Yes. The Qt GUI tool kit for C++ also allows writing your GUI code in QML. QML is actually JavaScript. From that you create a webview widget. That is actually the web kit browser engine. Bingo, a web browser built from a few lines of JS.
Why is this important?
A Browser on the Propeller? Impossible I say
I rest my case. You can't control the browsers your potential users have, and if you try to use JavaScript for UI (your Spin compiler is a very specific use case) you're dependent on a browser, and that leads to support issues from users who can't run your program. Programmers want to program, not field support issues all day.
JavaScript might be acceptable if your program also includes the core of a browser. Some applications do this, but in the end it's quite a bit of work. And they need to kept updated just as browsers do.
Are APIs like JQuery the answer? Possibly, but remember they're successful because they limit what you do. This is how they promote cross-browser compatibility. Want to create your own widget outside of the API? Better have a bunch of browsers on different platforms to test it.
Your case might be resting but it's leaking like a rusty old bucket True. But if they are using a recent releases of IE, Chrome, Firefox, Safari, whatever comes on iPhones, iPads, and Android devices then we are usable on Windows (back to XP), Mac, Linux, iOS and Android.
I would say that is covering a lot of ground. 99% of the computers we can expect people to be using. With no effort or support issues.
Please tell me how you do that with C++? Qt is great for cross platform work but even the Qt guys have adopted JavaScript for building interfaces. They call it QML.
Ah you say, "What about all those users of ancient IE versions." Good point, however they can easily grab FF or Chrome for free if they want to. If their boss won't let them, well tough. No. There are many browser out there that work. On many different operating systems. Unlike working in say, Visual Basic in the old days or Microsoft C++. Besides what the difference between being dependant on HTML/CSS/JS for my app and say Java or .Net? Exactly. Do I really want to set myself up with enough machines and operating systems that I can rebuild my code for all possibilities. And then fix all the cases where things fall down (See recent Propeller IDE thread for example.) Seems like a big waste of time when I could spend what precious little of it I have hacking the code. Why would I do that. Everybody and his dog has a browser or three already. I am not a browser vendor. For non-gui apps you don't need a browser node.js is fine. Change is inevitable whatever you do. I think you will find that HTML and JavaScript from the late 1990s works just as well today as it ever did. Not that people were writing web apps then. The web has been a very stable platform. Yes the end result of jQuery, Angular and the like is that they smooth out browser wrinkles provide polyfills for missing features where possible and provide a "lowest common denominator" API. However the common denominator is now pretty high. Then you are in for work if you are using HTM/CSS/JS or VB or Qt or Java or whatever. I'm not really in the business of hand crafting widgets. I'm mostly happy to use what is available. When I want to get weird I have done it in canvas or even webgl.
Speaking of which, over two years ago my company started building things using webgl and websockets etc. When we told customers they would need Chrome or FF to use it they did not bat an eyelid. That surprised me but we were very happy not to have to use FLASH.
Bottom line here is that if people are insistent on using old browsers that do not support modern standards then they have a problem not me:)
The other bottom line is that I'm not about to give up C/C++. As warty, brain damaged, unsafe and complex as they are I still love them and there are many places I would not go with JS. Horses for courses and all that.
Note I'm not talking about JavaScript (EcmaScript or anything else) in a non-browser container. There you have less of a problem with platform compatibility, but there's still the problem of the container.
JQuery's main strength is to avoid the hassles of cross-browser compatibility, so it's a little unfair to say there's no compatibility problem when JQuery and other popular JavaScript APIs are designed for this very purpose. I do a lot of work with HTML5 and video, areas the existing APIs don't support well. I don't get a choice whether or not to develop a custom widget. Without really knowing the end application, it's not possible to say that an API will address a programmer's needs. In my experience, that's actually seldom the case. It was a PITA but it was still overall easier to create video players in Flash, which provided a more reliable container.
While Flash may indeed be a bane, Abobe Air remains unreasonably popular for the very reason that JavaScript in a browser (or browser-based container) doesn't cut it for a lot of developers. With Air customers don't know they're using Flash. Air coding uses JavaScript (or ActionScript which is quite similar), so developers lose little porting over. The limitation of Air, besides not being open source, is that there is no longer Linux support. It does support Android and iOS, though, and generally more seemlessly than strictly browser-based JS.
Mind you, I don't like Air and I've always stayed away from it. But it would be an abandoned product if JavaScript was everything you're saying it is.
Hello!
Sorry Gordon. According to them formal support ends. Paid support may or may not, depending on how many machines someone is trying to maintain for a business. They will be releasing some hotpatches covering the security issue. Server 2003 ended its support shortly after they released the second service pack, yet they are still delivering an amazing amount of patches.
Dr_A is right "It gets difficult developing for a wide range of users". As I said "Horses for courses". What this boils down to is "what are the requirements you are working to ?"
If your remit is to provide a "web experience" for the widest range of users across a many browsers as possible and specifically going back to IE6 then I can imagine you are going to end up hand crafting your HTML and CSS to work around all the browser incompatibilities and/or using FLASH.
Video: You had to bring out the big gun didn't you
I have to admit I know nothing of video, in FLASH or HTML5. Again I can imagine that if video is what you need then perhaps web standards for that are not widely supported. It's all new stuff that has not matured yet. Again FLASH may be the best way to go, for now.
But what of my requirements? Or perhaps Dr_A's?
Hacking is a hobby. Playing with new toys. Experimenting with new ideas. Hopefully finding others with the same interests who want to play along or just use whatever comes out. To that end the requirements are for maximum reach to like minds. Open source and cross platform is essential to that. How can you share otherwise?
I have no desire to support anyone obstinate enough to insist stuff work in old browsers when they are perfectly able to get better ones. I have no desire to make any special effort to support closed platforms like iPads.
Video is not in the picture (as it were). Neither is pixel perfect rendering of the interface.
What about my companies requirements?
Turned out I got curious, discovered the new fangled webgl and web-sockets and that I could make that real-time animated data visualizations my company needed those few years ago. I got the thing up and running before the FLASH guru consultant who was hired to do the job. That was me starting from zero knowledge of all the new HTML5 stuff and with a dead line of 6 weeks before we had to demo at an expo. In fact the FLASH version missed the expo and never worked properly afterwards. So the company policy became that we don't care about legacy browsers.
FLASH is dead anyway. Last time I installed the FLASH plugin the download page told me it was the last ever version for Linux there will be. I don't understand that. All software has a container. All containers have problems and limitations. Assembler needs a CPU, C++ needs a compiler and OS to run on. .Net, Java, FLASH all need run times. JS has the browser, the most widely spread container for GUI apps in history!
jQuery, Angular and friends paper over browser incompatibilities but with that as your API you have huge reach.
Ok, I'll accept your offer to look at javascript. I have multiple browsers on my computer, including IE, Firefox, Opera and Chrome. I mainly use Opera but installing any new browser is no big deal.
Right, let's jump into some javascript. http://www.w3schools.com/js/js_examples.asp
So - now I know how to print 'Hello World' in a popup box. All the math and string routines are all there, so that is all pretty familiar. Now let's move things up a notch.
If language X is so good, can you show me an example of language X doing something real and difficult, such as being able to write an IDE in language X, for language X?
Well, to answer this question, I have been on a quest looking for javascript IDEs. I have found some great text compilers, even ones that have autocomplete and colored text, and the code to do this using regular expressions. But I haven't found a fully fledged IDE quite yet.
Maybe one is hidden in amongst this list http://en.wikipedia.org/wiki/Online_JavaScript_IDE
Oh, and yes, if javascript runs on browsers, then in order to maintain symmetry in the universe, the IDE ought to run on a browser too. Hence that website is a list of Online IDEs. I'm going to leave out IDEs that you have to download for the moment, partly because I am at work and my work doesn't let me install anything on the computer. Not even Flash (hence most of youtube can't be played, which is probably the reason this policy is in place!). But I have a browser and it certainly will run all the little demos on the W3schools website.
So, here is what I would like. An IDE that has a blank form - presumably a blank html page. And on the side of the screen I'd like a list of all the familiar buttons, textboxes, labels etc. And I'd like to drag those onto my form, and then click on the item and it brings up a code box and I put in some javascript, and then I compile it and it produces some code which will run.
And then what I'd like to do is to be able to pull apart that IDE and look at the source code, because if I was to write my own IDE, pretty much everything I'd need would be inside that source code.
Is this crazy talk?!
The professional Free Pascal RAD IDE
I need to chime in here. What @heater and me are doing here IS exactly that.
http://www.parallax.msrobots.net/Editor13.htm
Currently it consists out of 3 TEXT files.
Editor13.htm - the IDE
editorww.js - a webworker (parallel process)
openspin.js - Roys OpenSpin compiler converted to JavaScript.
You need not to install anything (except those 3 TEXT files if you want to run this from your computer.)
You even can edit the editor in itself. We have code completion, syntax highlighting for spin. c, html JavaScript even Cobol.
Its not Drag and Drop yet but - well Text files. You just need a current Browser IE/Chrome Windows/Linux does not matter.
But you have here a example how to load/save/upload/download/edit spin and js and html or whatever you want.
All sources included, no external links (except those to my spin sources...)
Enjoy!
Mike
Checking it out now. It does tick a lot of the boxes
I'm biased because I love Pascal. The current Propeller tool was made with Object Pascal Delphi.
Here's a help Wiki:
http://en.wikipedia.org/wiki/Lazarus_(IDE)
You can get a Lazarus book or Pascal magazine here;
http://www.blaisepascal.eu/index.php?actie=portal
Reading the posts here clearly we all have a different idea of what an IDE is.
For some having an editor with syntax highlighting, auto completion, "red sqigglies" on syntax errors, perhaps some kind of concept of a project and how to build it and perhaps being able to load and run the resulting program is an IDE. All from a single editor program. That is where IDEs started after all. The Prop Tool is an example, as is Simple IDE.
For others, including yourself it seems, an IDE also has to include a GUI interface for building GUI interfaces. A form editor/builder, something that generates code and/or data required to create that form at run time of the program you are working on.
Personally I consider these problems as "hard". They are big projects. Consider those "red sqigglies". To get that right almost requires you right a compiler, at least a parser, for the language you are writing in. That's why for Propeller IDE they are discussing making the actual inner workings of the openspin compiler available to the editor.
The whole world of building GUI forms using a GUI form is another order of magnitude bigger problem.
As such, yep, it's crazy talk Impossible!
msrobots has made a good start on putting together a Propeller Tool like IDE that runs in the browser (No GUI builder of course).
But WARNING ! Looking at that code will but you off JS and the web platform forever! It really has not been written to be read. At least not by a beginner. Sorry msrobots but you must admit that is true.
I was thinking....
The big hurdles for developing in-browser applications are HTML and CSS.
HTML is what you write to get all your elements onto a web page of course: Text, heading, buttons, input boxes, lists tables, etc etc etc. Mostly that ends up looking horrible out of the box.
CSS is what you use to style things, colours, sizes, boarder widths, positioning etc etc. With that you can make things look how you like.
Personally I loath and detest both HTML and CSS. They are horrible to write and horrible to read and frankly CSS is impossible to understand. I want to avoid them as much as possible. Web developers love this stuff. I think it's nuts. Especially as there is a lot of variability in how they work between browsers.
Javascript is really nothing to do with any of this. It's a wonderful simple but powerful language. It's what you need to get inputs from those HTML elements and make them jump at your will.
So the name of the game is how to make a web app with as little use of HTML and CSS as possible. Most people are using some kind of library to that now a days. You may have heard of jQuery or Angular.
There is one extreme example of this where you can write entire complex applications that look like anything you might get from VB or Qt creator with no HTML CSS knowledge or effort required at all.
It has the weirdest name "qooxdoo". But check out these http://demos:http://demo.qooxdoo.org/devel/playground/#Hello World-ria
The JS you have to write to get those buttons, input boxes, windows, etc should be quite understandable to someone from the VB world.
qooxdoo makes drag and drop of buttons and other widgets easy. Might be just what you are looking for....
Yes, exactly. Many online ways of building websites where the user never sees html. Perhaps programming could be made simpler too?
qooxdoo?
hmm, that looks fun http://demo.qooxdoo.org/current/widgetbrowser/
Pretty cool what my browser is capable of. Much quicker than downloading and installing software on my computer. Maybe this is the future?
I posted some more thoughts about this over on the web based compiler thread. Ideas coming thick and fast at the moment!
JavaScript's weakness is not the language. It's a fine language (though I don't much care for its weak typing), but IMO its primary implementation in *browsers* is what is lacking. I realize we're talking about close to 20 years of browsers since the introduction of JavaScript. But even when you remove all but the last 5-7 or so years worth -- a reasonable timeframe for the general population worldwide -- you still get tons of issues where features only slightly out of the ordinary either don't work, or don't work as expected. There's a not-insignificant number of Firefox users that block JavaScript, for example, unless explicitly allowed for a site. And some corporate firewalls restrict it on a wholesale level except for previously whitelisted sites.
All these things are issues I had to deal with when I was pushing browser-based video solutions in the 2005-2010 timeframe -- and this was even before I started with HTML5. Never again. It was the most frustrating experience in my life.
It comes down to this: When someone says "JavaScript" most are planning on using it in a client-side browser. Unless you're in a controlled environment, you don't get to choose how your users experience your efforts. You have to count on a certain number of them unable to access your site as you intended. Some of those will just keep surfing, and some will email you asking for assistance. Neither is a great situation, especially when you're putting out examples for free, and aren't being paid.
For all of these cross-platform solutions it pays to know what you're getting into before heading there. What looks easy at first sometimes isn't.