{"id":18019622,"url":"https://github.com/muratcakmak/swift-vs-ruby","last_synced_at":"2025-04-04T16:41:27.934Z","repository":{"id":91391725,"uuid":"103892298","full_name":"muratcakmak/Swift-vs-Ruby","owner":"muratcakmak","description":"Comparison of Swift and Ruby","archived":false,"fork":false,"pushed_at":"2017-11-10T18:52:52.000Z","size":2,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T04:29:00.982Z","etag":null,"topics":["comparison","rubyists","swift"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/muratcakmak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-18T04:40:35.000Z","updated_at":"2017-11-10T18:50:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"1d9b52bc-f61d-4a0c-92df-2edb20fd9656","html_url":"https://github.com/muratcakmak/Swift-vs-Ruby","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muratcakmak%2FSwift-vs-Ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muratcakmak%2FSwift-vs-Ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muratcakmak%2FSwift-vs-Ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muratcakmak%2FSwift-vs-Ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muratcakmak","download_url":"https://codeload.github.com/muratcakmak/Swift-vs-Ruby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247214143,"owners_count":20902727,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["comparison","rubyists","swift"],"created_at":"2024-10-30T05:11:32.792Z","updated_at":"2025-04-04T16:41:27.918Z","avatar_url":"https://github.com/muratcakmak.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swift-vs-Ruby\n\n## Comments\nBoth languages support one-line and multi-line comments\n```\n# Ruby \n\n=begin\n  multi-line \n  code comment\n=end\n\n\n// Swift \n\n/*\n  multi-line\n  code comment\n*/\n```\n\n\n## Constant and Variable declaration\nRuby doesn't have constant. Swift does.\n\n```\n# Ruby\n\nlegal_age = 18\n\n// Swift \n\nlet legalAge = 18 //This is a constant\n\nvar currentAge = 27 //This is variable\n```\n\n## String Interpolation\n\n```\n# Ruby\n\nname = \"Oguzhan\"\nputs \"Hello, #{name}.\"\n\n// Swift\n\nlet name = \"Oguzhan\"\nprint(\"Hello, \\(name)\")\n```\n\n## Type Inference\nRuby is a dynamic type language. A variable can store anything: integers, strings, floats, objects.\nSwift is a type safe language. Compiler yells at your code, if you try to reassing an integer to string variable. However, Swift has a type inference. \n```\n# Ruby \nname = \"Oguzhan\"\nname = 89.00\n\n// Swift \nvar name = \"Oguzhan\"\nname = 89.00 // Compiler Error!\n\n```\n\n## Further Readings\n* [An introduction to Swift for Ruby Developers](http://www.aidanf.net/posts/an-introduction-to-swift-for-ruby-developers)\n* [Swift for Rubyists](https://academy.realm.io/posts/swift-for-rubyists/)\n* [5 Reasons Why Rubyist Will Love Swift](https://littlelines.com/blog/2014/06/11/why-rubyist-will-love-swift)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuratcakmak%2Fswift-vs-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuratcakmak%2Fswift-vs-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuratcakmak%2Fswift-vs-ruby/lists"}